I build InviteMeOut, an app for invitations and small-business pages that open with an animation: a wax seal that breaks, curtains that part, a towel that wipes dust off a car. The opening is the first thing a guest sees, so it has to be smooth on a three-year-old phone, not just on my laptop.

One of them wasn't. Here's what was wrong and the rules I follow now.

The slow version

The opening for a car-detailing business page wipes a layer of dust off the screen with a towel. The first version did it the "obvious" way:

  • a full-screen SVG mask that grew as the towel moved,
  • feGaussianBlur and feTurbulence filters for soft, dusty edges,
  • the towel itself as a filtered SVG, animated with SMIL,
  • a scale on the whole layer, and a backdrop-filter: blur() pill floating on top.

In Chrome's phone emulation it ran at about 35 fps. On a real phone it was worse. Every frame the browser had to re-run the filters over the whole screen, re-rasterize the mask, and re-blur whatever sat under the pill.

The fast version

Same look, different work per frame:

  1. The dust is a <canvas> drawn once. Each frame only erases the new strip the towel just covered, using globalCompositeOperation = "destination-out". Nothing is redrawn from scratch.
  2. The towel is rendered once and only moved, with transform: translate3d(...). The GPU moves a texture it already has.
  3. Sheen, glints and dust puffs are transform + opacity only. These two properties can be animated without layout or repaint.
  4. The backdrop-filter element is removed before the animation starts. A blur over something that changes every frame is one of the most expensive things you can ask a phone to do.
  5. Sizes are in px, not SVG viewBox units, so the same towel looks the same on a narrow phone and a wide one.

Result in the same emulation: about 140 fps, and smooth on real phones.

The rules I use for every opening now

  • Draw heavy textures once (a canvas or a static image), then never redraw them.
  • Animate only transform and opacity.
  • No animated masks, filters or background-position.
  • No backdrop-filter over anything that moves.
  • Measure before calling it done. I use a tiny requestAnimationFrame logger that records frame times in phone view:
const times = []; let last = performance.now(); function tick(now) { times.push(now - last); last = now; if (times.length < 300) requestAnimationFrame(tick); else { const avg = times.reduce((a, b) => a + b, 0) / times.length; console.log("avg fps:", Math.round(1000 / avg), "worst frame ms:", Math.max(...times).toFixed(1)); } } requestAnimationFrame(tick); 

One more thing: sound needs a tap

Phones won't play audio until the user touches the page. Instead of fighting that, the tap that breaks the seal (or starts the wipe) is the same gesture that starts the music. It feels intentional, and it's the only reliable way.

If you want to see the openings in action, they're at invitemeout.app. Free on the web and on the iPhone. I'm building it solo, so feedback on what stutters on your phone is very welcome.