html5-infobeamer-dhcp/assets/js/custom/dom/clock.js

22 lines
459 B
JavaScript

'use strict';
const html = htm.bind(preact.h);
const update_main_slide = (data, time, config) => {
const hour = time.toFormat('HH');
const minute = time.toFormat('mm');
const sep = time.second % 2 === 0 ? ':' : '.';
const inner = html`<div class="clock">${hour}${sep}${minute}</div>`;
const anchorElId = "clock";
const el = document.getElementById(anchorElId);
preact.render(inner, el);
};
export {
update_main_slide
};