|
|
|
|
|
by James0x57
2158 days ago
|
|
The timer itself is a CSS animation with 1000 keyframes evenly spread, that runs once for 999s (just realized it should be running for 1000s, oops!). I can't link to lines in the source code because of the 1.23MB filesize but you can search for "timer" in the raw source to see the relevant code: https://raw.githubusercontent.com/propjockey/css-sweeper/mas... Here's the part that controls when the animation is running: #level-none:not(:checked) ~ #ram #timer::before {
animation: timer step-end 1;
animation-duration: 999s;
animation-fill-mode: forwards;
--pause-if-won: var(--win-state) paused;
--pause-if-lost: var(--game-over) paused;
--pause-if-randommenu: var(--randommenu-visible) paused;
animation-play-state: var(--pause-if-won, var(--pause-if-lost, var(--pause-if-randommenu, running)));
}
Though the design is responsive to the width of the window, I suspect you mean how slow it is: it's 1.23MB of HTML + CSS, and clicking anything causes almost everything to redraw. It's only a little laggy on my computer but the idea was to test the limits of what's possible and is expected! :)Thank you for checking it out! |
|