2024-05-22 21:43:49 +02:00
|
|
|
import { S } from "deka-dom-el/signals";
|
|
|
|
const count= S(0);
|
2023-11-29 18:25:21 +01:00
|
|
|
|
|
|
|
import { el } from "deka-dom-el";
|
|
|
|
document.body.append(
|
2024-05-22 21:43:49 +02:00
|
|
|
el("p", S(()=> "Currently: "+count())),
|
2024-12-13 15:04:52 +01:00
|
|
|
el("p", { classList: { red: S(()=> count()%2 === 0) }, dataset: { count }, textContent: "Attributes example" }),
|
2023-11-29 18:25:21 +01:00
|
|
|
);
|
|
|
|
document.head.append(
|
|
|
|
el("style", ".red { color: red; }")
|
|
|
|
);
|
|
|
|
|
|
|
|
const interval= 5 * 1000;
|
|
|
|
setTimeout(clearInterval, 10*interval,
|
|
|
|
setInterval(()=> count(count()+1), interval));
|