# Double tap photo to like

> Tap the photo twice and a big heart beats right where you tapped, while the small heart fills and adds one like.

- Category: [Microinteractions](https://library.aimran.es/components/microinteractions)
- Built with: HTML + CSS
- Live editor: https://library.aimran.es/blocks/uv-mi27-double-tap
- Library: AIMRAN Library (https://library.aimran.es), free, no sign-up, by Aimran Oukham

## Where to use it

Double tapping a photo to like it is a gesture people already know from social apps, and this card reproduces it without libraries. A large white heart pops and beats at the exact point of the double tap, then floats away, while the heart button below fills with a bounce and a ring and the like count goes up by one.

The main color is the filled heart and the secondary one the avatar ring. The photo is an inline SVG, so swap it for an image element of your own. With the keyboard, Enter on the photo likes it from the center, and the heart button toggles as usual.

## Code

### HTML

```html
<div class="uvq15-dbl"><header><span class="av" aria-hidden="true">N</span><div><b>nuria.viaja</b><small>Merzouga</small></div></header><button type="button" class="ph" aria-label="Double tap to like"><svg viewBox="0 0 320 240" preserveAspectRatio="xMidYMid slice" aria-hidden="true"><defs><linearGradient id="uvq15-dbl-s" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#fdba74"/><stop offset=".6" stop-color="#fed7aa"/><stop offset="1" stop-color="#fde68a"/></linearGradient></defs><rect width="320" height="240" fill="url(#uvq15-dbl-s)"/><circle cx="214" cy="104" r="34" fill="#fff7ed" opacity=".9"/><path d="M0 150C60 120 120 128 170 146S260 132 320 118V240H0Z" fill="#f59e0b"/><path d="M0 182C70 150 130 160 190 178S280 168 320 160V240H0Z" fill="#d97706"/><path d="M0 214C80 190 150 196 220 212S300 206 320 202V240H0Z" fill="#b45309"/><path d="M96 168l6-14 4 14M88 172h22" stroke="#7c2d12" stroke-width="3" stroke-linecap="round" fill="none"/></svg><span class="bh" aria-hidden="true"><svg viewBox="0 0 24 24"><path d="M12 20.5s-7.5-4.6-9.3-9.2C1.4 8 3.4 4.5 6.9 4.5c2.1 0 3.6 1.2 5.1 3 1.5-1.8 3-3 5.1-3 3.5 0 5.5 3.5 4.2 6.8-1.8 4.6-9.3 9.2-9.3 9.2Z"/></svg></span></button><footer><button type="button" class="lk" aria-pressed="false" aria-label="Like"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 20.5s-7.5-4.6-9.3-9.2C1.4 8 3.4 4.5 6.9 4.5c2.1 0 3.6 1.2 5.1 3 1.5-1.8 3-3 5.1-3 3.5 0 5.5 3.5 4.2 6.8-1.8 4.6-9.3 9.2-9.3 9.2Z"/></svg></button><p class="ct"><b class="n">3.218</b><span>likes</span></p></footer><p class="cap">Sunset over the dunes</p><p class="sr" aria-live="polite"></p></div>
```

### CSS

```css
.uvq15-dbl {
  --c1: #e11d48;
  --c2: #f59e0b;
  --s: 16px;
  /* tamaño */
  --k: 1;
  /* velocidad */
  --fg: #1d1d1f;
  /* texto */
  --bg: #f5f5f7;
  /* fondo */
}

.uvq15-dbl {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  position: relative;
  border-radius: 1.3em;
  background: color-mix(in srgb,var(--fg) 3%,var(--bg));
  box-shadow: 0 0 0 1px color-mix(in srgb,var(--fg) 10%,transparent),0 1.4em 2.6em -1.8em rgba(0,0,0,.35);
  width: 17em;
  overflow: hidden;
}

.uvq15-dbl header {
  display: flex;
  align-items: center;
  gap: .55em;
  padding: .7em .8em;
}

.uvq15-dbl .av {
  display: grid;
  place-items: center;
  width: 2em;
  height: 2em;
  border-radius: 50%;
  font-size: .85em;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg,var(--c2),var(--c1));
  box-shadow: 0 0 0 2px var(--bg),0 0 0 3.5px var(--c1);
}

.uvq15-dbl header b {
  display: block;
  font-size: .82em;
}

.uvq15-dbl header small {
  display: block;
  font-size: .68em;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq15-dbl .ph {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  touch-action: manipulation;
  user-select: none;
}

.uvq15-dbl .ph>svg {
  display: block;
  width: 100%;
  height: 100%;
}

.uvq15-dbl .ph:focus-visible {
  outline: 3px solid var(--c1);
  outline-offset: -3px;
}

.uvq15-dbl .bh {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5.5em;
  height: 5.5em;
  margin: -2.75em 0 0 -2.75em;
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 .4em .8em rgba(0,0,0,.3));
}

.uvq15-dbl .bh svg {
  width: 100%;
  height: 100%;
  fill: #fff;
}

.uvq15-dbl .bh.go {
  animation: uvq15-dbl-b calc(1s / var(--k)) cubic-bezier(.25,.1,.25,1) both;
}

@keyframes uvq15-dbl-b {
  0% {
    opacity: 0;
    transform: scale(0) rotate(-12deg);
  }
  15% {
    opacity: 1;
    transform: scale(1.25) rotate(4deg);
  }
  28% {
    transform: scale(.92) rotate(-2deg);
  }
  40% {
    transform: scale(1.05) rotate(0);
  }
  75% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-2.5em) scale(.6);
  }
}

.uvq15-dbl footer {
  display: flex;
  align-items: center;
  gap: .5em;
  padding: .5em .6em 0;
}

.uvq15-dbl .lk {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  display: grid;
  place-items: center;
  width: 2.4em;
  height: 2.4em;
  border-radius: 50%;
  color: var(--fg);
}

.uvq15-dbl .lk svg {
  width: 1.5em;
  height: 1.5em;
  fill: transparent;
  stroke: currentColor;
  stroke-width: 1.8;
  transition: fill calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),stroke calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq15-dbl .lk::after {
  content: "";
  position: absolute;
  inset: .2em;
  border-radius: 50%;
  border: 2px solid var(--c1);
  opacity: 0;
}

.uvq15-dbl .lk:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq15-dbl .lk:active svg {
  transform: scale(.88);
}

.uvq15-dbl.on .lk svg {
  fill: var(--c1);
  stroke: var(--c1);
}

.uvq15-dbl .lk.go svg {
  animation: uvq15-dbl-l calc(0.5s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq15-dbl .lk.go::after {
  animation: uvq15-dbl-r calc(0.55s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

@keyframes uvq15-dbl-l {
  0% {
    transform: scale(.6);
  }
  50% {
    transform: scale(1.25);
  }
}

@keyframes uvq15-dbl-r {
  0% {
    opacity: 1;
    transform: scale(.4);
  }
  100% {
    opacity: 0;
    transform: scale(1.5);
  }
}

.uvq15-dbl .ct {
  display: flex;
  gap: .3em;
  margin: 0;
  font-size: .8em;
}

.uvq15-dbl .ct b {
  font-variant-numeric: tabular-nums;
}

.uvq15-dbl .cap {
  margin: .2em .9em .9em;
  font-size: .8em;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq15-dbl .sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (prefers-reduced-motion:reduce) {
  .uvq15-dbl,.uvq15-dbl *,.uvq15-dbl *::before,.uvq15-dbl *::after {
    animation-duration: .01ms!important;
    animation-iteration-count: 1!important;
    transition-duration: .01ms!important;
  }
}
```

### JavaScript

```js
document.querySelectorAll(".uvq15-dbl").forEach(el => {
  const k=parseFloat(getComputedStyle(el).getPropertyValue("--k"))||1,rm=matchMedia("(prefers-reduced-motion:reduce)").matches;const ph=el.querySelector(".ph"),bh=el.querySelector(".bh"),lk=el.querySelector(".lk"),n=el.querySelector(".n"),sr=el.querySelector(".sr");let on=false,c=3218,lt=0,lx=0,ly=0;
const like=v=>{if(on===v)return;on=v;lk.setAttribute("aria-pressed",String(v));el.classList.toggle("on",v);c+=v?1:-1;n.textContent=c.toLocaleString("de-DE");lk.classList.remove("go");void lk.offsetWidth;if(v)lk.classList.add("go");sr.textContent=v?"You like this photo":"You no longer like this photo"};
const burst=(x,y)=>{if(rm)return;const h=bh.cloneNode(true);h.classList.add("go");h.style.left=x+"px";h.style.top=y+"px";ph.appendChild(h);h.addEventListener("animationend",()=>h.remove())};
ph.addEventListener("click",e=>{const r=ph.getBoundingClientRect(),sc=r.width/ph.offsetWidth||1;if(e.detail===0){burst(ph.offsetWidth/2,ph.offsetHeight/2);like(true);return}
const t=performance.now(),x=(e.clientX-r.left)/sc,y=(e.clientY-r.top)/sc;if(t-lt<350&&Math.hypot(x-lx,y-ly)<40){burst(x,y);like(true);lt=0;return}lt=t;lx=x;ly=y});
lk.addEventListener("click",()=>like(!on))
});
```

### React

```tsx
// @ts-nocheck: setup() es JavaScript del DOM sin tipos, el mismo de la pestaña JS.
import { useEffect, useRef, type CSSProperties } from "react";

const css = `
.uvq15-dbl {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  position: relative;
  border-radius: 1.3em;
  background: color-mix(in srgb,var(--fg) 3%,var(--bg));
  box-shadow: 0 0 0 1px color-mix(in srgb,var(--fg) 10%,transparent),0 1.4em 2.6em -1.8em rgba(0,0,0,.35);
  width: 17em;
  overflow: hidden;
}

.uvq15-dbl header {
  display: flex;
  align-items: center;
  gap: .55em;
  padding: .7em .8em;
}

.uvq15-dbl .av {
  display: grid;
  place-items: center;
  width: 2em;
  height: 2em;
  border-radius: 50%;
  font-size: .85em;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg,var(--c2),var(--c1));
  box-shadow: 0 0 0 2px var(--bg),0 0 0 3.5px var(--c1);
}

.uvq15-dbl header b {
  display: block;
  font-size: .82em;
}

.uvq15-dbl header small {
  display: block;
  font-size: .68em;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq15-dbl .ph {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  touch-action: manipulation;
  user-select: none;
}

.uvq15-dbl .ph>svg {
  display: block;
  width: 100%;
  height: 100%;
}

.uvq15-dbl .ph:focus-visible {
  outline: 3px solid var(--c1);
  outline-offset: -3px;
}

.uvq15-dbl .bh {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5.5em;
  height: 5.5em;
  margin: -2.75em 0 0 -2.75em;
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 .4em .8em rgba(0,0,0,.3));
}

.uvq15-dbl .bh svg {
  width: 100%;
  height: 100%;
  fill: #fff;
}

.uvq15-dbl .bh.go {
  animation: uvq15-dbl-b calc(1s / var(--k)) cubic-bezier(.25,.1,.25,1) both;
}

@keyframes uvq15-dbl-b {
  0% {
    opacity: 0;
    transform: scale(0) rotate(-12deg);
  }
  15% {
    opacity: 1;
    transform: scale(1.25) rotate(4deg);
  }
  28% {
    transform: scale(.92) rotate(-2deg);
  }
  40% {
    transform: scale(1.05) rotate(0);
  }
  75% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-2.5em) scale(.6);
  }
}

.uvq15-dbl footer {
  display: flex;
  align-items: center;
  gap: .5em;
  padding: .5em .6em 0;
}

.uvq15-dbl .lk {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  display: grid;
  place-items: center;
  width: 2.4em;
  height: 2.4em;
  border-radius: 50%;
  color: var(--fg);
}

.uvq15-dbl .lk svg {
  width: 1.5em;
  height: 1.5em;
  fill: transparent;
  stroke: currentColor;
  stroke-width: 1.8;
  transition: fill calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),stroke calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq15-dbl .lk::after {
  content: "";
  position: absolute;
  inset: .2em;
  border-radius: 50%;
  border: 2px solid var(--c1);
  opacity: 0;
}

.uvq15-dbl .lk:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq15-dbl .lk:active svg {
  transform: scale(.88);
}

.uvq15-dbl.on .lk svg {
  fill: var(--c1);
  stroke: var(--c1);
}

.uvq15-dbl .lk.go svg {
  animation: uvq15-dbl-l calc(0.5s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq15-dbl .lk.go::after {
  animation: uvq15-dbl-r calc(0.55s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

@keyframes uvq15-dbl-l {
  0% {
    transform: scale(.6);
  }
  50% {
    transform: scale(1.25);
  }
}

@keyframes uvq15-dbl-r {
  0% {
    opacity: 1;
    transform: scale(.4);
  }
  100% {
    opacity: 0;
    transform: scale(1.5);
  }
}

.uvq15-dbl .ct {
  display: flex;
  gap: .3em;
  margin: 0;
  font-size: .8em;
}

.uvq15-dbl .ct b {
  font-variant-numeric: tabular-nums;
}

.uvq15-dbl .cap {
  margin: .2em .9em .9em;
  font-size: .8em;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq15-dbl .sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (prefers-reduced-motion:reduce) {
  .uvq15-dbl,.uvq15-dbl *,.uvq15-dbl *::before,.uvq15-dbl *::after {
    animation-duration: .01ms!important;
    animation-iteration-count: 1!important;
    transition-duration: .01ms!important;
  }
}
`;

// Interacción en JavaScript del DOM: la misma que en la pestaña JS.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function setup(el: any) {
  const k=parseFloat(getComputedStyle(el).getPropertyValue("--k"))||1,rm=matchMedia("(prefers-reduced-motion:reduce)").matches;const ph=el.querySelector(".ph"),bh=el.querySelector(".bh"),lk=el.querySelector(".lk"),n=el.querySelector(".n"),sr=el.querySelector(".sr");let on=false,c=3218,lt=0,lx=0,ly=0;
const like=v=>{if(on===v)return;on=v;lk.setAttribute("aria-pressed",String(v));el.classList.toggle("on",v);c+=v?1:-1;n.textContent=c.toLocaleString("de-DE");lk.classList.remove("go");void lk.offsetWidth;if(v)lk.classList.add("go");sr.textContent=v?"You like this photo":"You no longer like this photo"};
const burst=(x,y)=>{if(rm)return;const h=bh.cloneNode(true);h.classList.add("go");h.style.left=x+"px";h.style.top=y+"px";ph.appendChild(h);h.addEventListener("animationend",()=>h.remove())};
ph.addEventListener("click",e=>{const r=ph.getBoundingClientRect(),sc=r.width/ph.offsetWidth||1;if(e.detail===0){burst(ph.offsetWidth/2,ph.offsetHeight/2);like(true);return}
const t=performance.now(),x=(e.clientX-r.left)/sc,y=(e.clientY-r.top)/sc;if(t-lt<350&&Math.hypot(x-lx,y-ly)<40){burst(x,y);like(true);lt=0;return}lt=t;lx=x;ly=y});
lk.addEventListener("click",()=>like(!on))
}

export default function Mi27DoubleTap() {
  const ref = useRef<HTMLDivElement>(null);

  useEffect(() => {
    const el = ref.current?.firstElementChild;
    return el ? setup(el) : undefined;
  }, []);

  return (
    <>
      <style>{css}</style>
      <div
        ref={ref} style={{
          "--c1": "#e11d48",
          "--c2": "#f59e0b",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq15-dbl"><header><span className="av" aria-hidden="true">N</span><div><b>nuria.viaja</b><small>Merzouga</small></div></header><button type="button" className="ph" aria-label="Double tap to like"><svg viewBox="0 0 320 240" preserveAspectRatio="xMidYMid slice" aria-hidden="true"><defs><linearGradient id="uvq15-dbl-s" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stopColor="#fdba74" /><stop offset=".6" stopColor="#fed7aa" /><stop offset="1" stopColor="#fde68a" /></linearGradient></defs><rect width="320" height="240" fill="url(#uvq15-dbl-s)" /><circle cx="214" cy="104" r="34" fill="#fff7ed" opacity=".9" /><path d="M0 150C60 120 120 128 170 146S260 132 320 118V240H0Z" fill="#f59e0b" /><path d="M0 182C70 150 130 160 190 178S280 168 320 160V240H0Z" fill="#d97706" /><path d="M0 214C80 190 150 196 220 212S300 206 320 202V240H0Z" fill="#b45309" /><path d="M96 168l6-14 4 14M88 172h22" stroke="#7c2d12" strokeWidth="3" strokeLinecap="round" fill="none" /></svg><span className="bh" aria-hidden="true"><svg viewBox="0 0 24 24"><path d="M12 20.5s-7.5-4.6-9.3-9.2C1.4 8 3.4 4.5 6.9 4.5c2.1 0 3.6 1.2 5.1 3 1.5-1.8 3-3 5.1-3 3.5 0 5.5 3.5 4.2 6.8-1.8 4.6-9.3 9.2-9.3 9.2Z" /></svg></span></button><footer><button type="button" className="lk" aria-pressed="false" aria-label="Like"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 20.5s-7.5-4.6-9.3-9.2C1.4 8 3.4 4.5 6.9 4.5c2.1 0 3.6 1.2 5.1 3 1.5-1.8 3-3 5.1-3 3.5 0 5.5 3.5 4.2 6.8-1.8 4.6-9.3 9.2-9.3 9.2Z" /></svg></button><p className="ct"><b className="n">3.218</b><span>likes</span></p></footer><p className="cap">Sunset over the dunes</p><p className="sr" aria-live="polite"></p></div>
      </div>
    </>
  );
}
```

## Prompt for AI assistants

Paste this into ChatGPT, Claude, Cursor, v0 or Lovable to adapt the block to your stack (Tailwind, Vue, Svelte…):

````text
I want to add the “Double tap photo to like” block (Microinteractions) from AIMRAN Library to my project.

## What it is
Tap the photo twice and a big heart beats right where you tapped, while the small heart fills and adds one like.

## Chosen settings
- Main color: #e11d48
- Secondary color: #f59e0b
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- Text: "Atardecer en las dunas"

## What I need
1. Add it to my project with the same look and animation as the reference code: same sizes, colours, radii, shadows, timings and easing.
2. It is built with plain HTML and CSS (the reference wraps it in a React component with its CSS). If my project uses something else (Vue, Svelte, Astro, plain HTML…), translate it without losing any behaviour. If I use Tailwind, turn the styles into classes; if not, keep the CSS in its own file.
3. Expose the settings above as props (or CSS variables) with those values as defaults.
4. Make it work well on phones: nothing that depends only on hover, touch targets of at least 44 px and no overflow on 320 px screens.
5. Make it look right in light and dark mode.
6. Keep it accessible: semantic HTML, roles and aria-* where needed, visible focus and keyboard support.
7. Respect prefers-reduced-motion: with reduced motion, no big animations but the same end result.

## Reference code
```tsx
// @ts-nocheck: setup() es JavaScript del DOM sin tipos, el mismo de la pestaña JS.
import { useEffect, useRef, type CSSProperties } from "react";

const css = `
.uvq15-dbl {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  position: relative;
  border-radius: 1.3em;
  background: color-mix(in srgb,var(--fg) 3%,var(--bg));
  box-shadow: 0 0 0 1px color-mix(in srgb,var(--fg) 10%,transparent),0 1.4em 2.6em -1.8em rgba(0,0,0,.35);
  width: 17em;
  overflow: hidden;
}

.uvq15-dbl header {
  display: flex;
  align-items: center;
  gap: .55em;
  padding: .7em .8em;
}

.uvq15-dbl .av {
  display: grid;
  place-items: center;
  width: 2em;
  height: 2em;
  border-radius: 50%;
  font-size: .85em;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg,var(--c2),var(--c1));
  box-shadow: 0 0 0 2px var(--bg),0 0 0 3.5px var(--c1);
}

.uvq15-dbl header b {
  display: block;
  font-size: .82em;
}

.uvq15-dbl header small {
  display: block;
  font-size: .68em;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq15-dbl .ph {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  touch-action: manipulation;
  user-select: none;
}

.uvq15-dbl .ph>svg {
  display: block;
  width: 100%;
  height: 100%;
}

.uvq15-dbl .ph:focus-visible {
  outline: 3px solid var(--c1);
  outline-offset: -3px;
}

.uvq15-dbl .bh {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5.5em;
  height: 5.5em;
  margin: -2.75em 0 0 -2.75em;
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 .4em .8em rgba(0,0,0,.3));
}

.uvq15-dbl .bh svg {
  width: 100%;
  height: 100%;
  fill: #fff;
}

.uvq15-dbl .bh.go {
  animation: uvq15-dbl-b calc(1s / var(--k)) cubic-bezier(.25,.1,.25,1) both;
}

@keyframes uvq15-dbl-b {
  0% {
    opacity: 0;
    transform: scale(0) rotate(-12deg);
  }
  15% {
    opacity: 1;
    transform: scale(1.25) rotate(4deg);
  }
  28% {
    transform: scale(.92) rotate(-2deg);
  }
  40% {
    transform: scale(1.05) rotate(0);
  }
  75% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-2.5em) scale(.6);
  }
}

.uvq15-dbl footer {
  display: flex;
  align-items: center;
  gap: .5em;
  padding: .5em .6em 0;
}

.uvq15-dbl .lk {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  display: grid;
  place-items: center;
  width: 2.4em;
  height: 2.4em;
  border-radius: 50%;
  color: var(--fg);
}

.uvq15-dbl .lk svg {
  width: 1.5em;
  height: 1.5em;
  fill: transparent;
  stroke: currentColor;
  stroke-width: 1.8;
  transition: fill calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),stroke calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq15-dbl .lk::after {
  content: "";
  position: absolute;
  inset: .2em;
  border-radius: 50%;
  border: 2px solid var(--c1);
  opacity: 0;
}

.uvq15-dbl .lk:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq15-dbl .lk:active svg {
  transform: scale(.88);
}

.uvq15-dbl.on .lk svg {
  fill: var(--c1);
  stroke: var(--c1);
}

.uvq15-dbl .lk.go svg {
  animation: uvq15-dbl-l calc(0.5s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq15-dbl .lk.go::after {
  animation: uvq15-dbl-r calc(0.55s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

@keyframes uvq15-dbl-l {
  0% {
    transform: scale(.6);
  }
  50% {
    transform: scale(1.25);
  }
}

@keyframes uvq15-dbl-r {
  0% {
    opacity: 1;
    transform: scale(.4);
  }
  100% {
    opacity: 0;
    transform: scale(1.5);
  }
}

.uvq15-dbl .ct {
  display: flex;
  gap: .3em;
  margin: 0;
  font-size: .8em;
}

.uvq15-dbl .ct b {
  font-variant-numeric: tabular-nums;
}

.uvq15-dbl .cap {
  margin: .2em .9em .9em;
  font-size: .8em;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq15-dbl .sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (prefers-reduced-motion:reduce) {
  .uvq15-dbl,.uvq15-dbl *,.uvq15-dbl *::before,.uvq15-dbl *::after {
    animation-duration: .01ms!important;
    animation-iteration-count: 1!important;
    transition-duration: .01ms!important;
  }
}
`;

// Interacción en JavaScript del DOM: la misma que en la pestaña JS.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function setup(el: any) {
  const k=parseFloat(getComputedStyle(el).getPropertyValue("--k"))||1,rm=matchMedia("(prefers-reduced-motion:reduce)").matches;const ph=el.querySelector(".ph"),bh=el.querySelector(".bh"),lk=el.querySelector(".lk"),n=el.querySelector(".n"),sr=el.querySelector(".sr");let on=false,c=3218,lt=0,lx=0,ly=0;
const like=v=>{if(on===v)return;on=v;lk.setAttribute("aria-pressed",String(v));el.classList.toggle("on",v);c+=v?1:-1;n.textContent=c.toLocaleString("de-DE");lk.classList.remove("go");void lk.offsetWidth;if(v)lk.classList.add("go");sr.textContent=v?"You like this photo":"You no longer like this photo"};
const burst=(x,y)=>{if(rm)return;const h=bh.cloneNode(true);h.classList.add("go");h.style.left=x+"px";h.style.top=y+"px";ph.appendChild(h);h.addEventListener("animationend",()=>h.remove())};
ph.addEventListener("click",e=>{const r=ph.getBoundingClientRect(),sc=r.width/ph.offsetWidth||1;if(e.detail===0){burst(ph.offsetWidth/2,ph.offsetHeight/2);like(true);return}
const t=performance.now(),x=(e.clientX-r.left)/sc,y=(e.clientY-r.top)/sc;if(t-lt<350&&Math.hypot(x-lx,y-ly)<40){burst(x,y);like(true);lt=0;return}lt=t;lx=x;ly=y});
lk.addEventListener("click",()=>like(!on))
}

export default function Mi27DoubleTap() {
  const ref = useRef<HTMLDivElement>(null);

  useEffect(() => {
    const el = ref.current?.firstElementChild;
    return el ? setup(el) : undefined;
  }, []);

  return (
    <>
      <style>{css}</style>
      <div
        ref={ref} style={{
          "--c1": "#e11d48",
          "--c2": "#f59e0b",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq15-dbl"><header><span className="av" aria-hidden="true">N</span><div><b>nuria.viaja</b><small>Merzouga</small></div></header><button type="button" className="ph" aria-label="Double tap to like"><svg viewBox="0 0 320 240" preserveAspectRatio="xMidYMid slice" aria-hidden="true"><defs><linearGradient id="uvq15-dbl-s" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stopColor="#fdba74" /><stop offset=".6" stopColor="#fed7aa" /><stop offset="1" stopColor="#fde68a" /></linearGradient></defs><rect width="320" height="240" fill="url(#uvq15-dbl-s)" /><circle cx="214" cy="104" r="34" fill="#fff7ed" opacity=".9" /><path d="M0 150C60 120 120 128 170 146S260 132 320 118V240H0Z" fill="#f59e0b" /><path d="M0 182C70 150 130 160 190 178S280 168 320 160V240H0Z" fill="#d97706" /><path d="M0 214C80 190 150 196 220 212S300 206 320 202V240H0Z" fill="#b45309" /><path d="M96 168l6-14 4 14M88 172h22" stroke="#7c2d12" strokeWidth="3" strokeLinecap="round" fill="none" /></svg><span className="bh" aria-hidden="true"><svg viewBox="0 0 24 24"><path d="M12 20.5s-7.5-4.6-9.3-9.2C1.4 8 3.4 4.5 6.9 4.5c2.1 0 3.6 1.2 5.1 3 1.5-1.8 3-3 5.1-3 3.5 0 5.5 3.5 4.2 6.8-1.8 4.6-9.3 9.2-9.3 9.2Z" /></svg></span></button><footer><button type="button" className="lk" aria-pressed="false" aria-label="Like"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 20.5s-7.5-4.6-9.3-9.2C1.4 8 3.4 4.5 6.9 4.5c2.1 0 3.6 1.2 5.1 3 1.5-1.8 3-3 5.1-3 3.5 0 5.5 3.5 4.2 6.8-1.8 4.6-9.3 9.2-9.3 9.2Z" /></svg></button><p className="ct"><b className="n">3.218</b><span>likes</span></p></footer><p className="cap">Sunset over the dunes</p><p className="sr" aria-live="polite"></p></div>
      </div>
    </>
  );
}
```

Give me the complete final code, ready to paste, and tell me in one line where to put it in my project.
````
