01 — The trick
A checkbox does the thinking
A hidden <input type="checkbox"> plus a <label> gives us real,
persistent state with zero script. The :checked selector drives every single frame.
Interaction № 01 — State & Motion
One hidden checkbox, eighteen keyframe animations and absolutely no JavaScript. Click the heart — or tab to it and hit Space. Click it again to reset the blast.
A hidden <input type="checkbox"> plus a <label> gives us real,
persistent state with zero script. The :checked selector drives every single frame.
Shockwave rings, sixteen sparks, twelve confetti shards, a camera shake, a white flash,
a flying BOOM! and a heart that overshoots, wobbles and settles.
Open view-source: there is no <script> tag in this document.
Uncheck to reset, then hit it again — the animation fully replays every time.