html5-infobeamer-aalen-geek.../assets/js/custom/dom/clock.js

22 lines
459 B
JavaScript
Raw Permalink Normal View History

2023-11-01 01:59:19 +01:00
'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
};