アナログ時計を表示するUserScript
Scrapboxの右上辺りにアナログ時計を表示するUserScript https://gyazo.com/93cff5a06dc1ce66d3e0f5da76b9b289
code:js
setup();
目的
実装
時計UI
code:script.js
export function setup(hidden = false) {
const clock = document.createElement("analog-clock");
clock.dark = true;
clock.offset = 9;
clock.style.position = "fixed";
clock.style.right = "80px";
clock.style.top = "45px";
clock.style.width = "20rem";
clock.style.height = "20rem";
clock.hidden = hidden;
document.body.append(clock);
scrapbox.PageMenu.addMenu({
title: "Analog Clock",
code:script.js
onClick: () => clock.hidden = !clock.hidden,
});
}