On every `pointerdown`, compare the current time to the previous tap's time; within 350ms counts as a double-tap. Too short a window and it misses real double-taps; too long and two unrelated taps accidentally register as a like.
Once recognized, bounce a heart open in the center — `scale(0.3) → scale(1.15) → scale(1)` — while fading `opacity` to zero, all in one `@keyframes` pass. If it's already liked, most social apps don't unlike it; they just replay the heart animation.
If a single tap needs to do something else (like opening the photo), you can't react on the first tap alone — wait out the 350ms window, and only treat it as a plain single tap if no second tap arrived in time.
When to use
Use it as a fast reaction over photos in a social feed. It's a discoverable-later gesture, so keep an explicit like button alongside it.