22 lines
459 B
JavaScript
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
|
||
|
};
|