Vitals 101
Vitals 101
@CoreVitals101

Moving an animation to CSS cut INP from 240ms to 80ms

Moving an animation to CSS cut INP from 240ms to 80ms

INP — Interaction to Next Paint — measures how fast a page reacts after you tap. Animations run in JavaScript can clog the same lane that handles your clicks, so taps feel late. Think of it like one cashier juggling both the line and a phone call: everyone waits.

A menu opened with a JavaScript animation that ran on every frame. While it played, taps queued behind it, so INP hit 240ms.

The fix handed the animation to CSS, which runs on a separate track the browser optimizes:

— Replaced the JS animation with a CSS transition.
— Animated transform and opacity (the two cheapest properties).
— The main lane stayed free for taps.

Result: INP dropped to 80ms, and the animation looked smoother.

Try this: if an animation runs in JavaScript, see if a CSS transition can replace it.
Этот пост опубликован в Telegram-канале Vitals 101. Подписаться можно по ссылке: @CoreVitals101.
tech

Свежие посты в категории «Tech Infrastructure»

Все каналы категории →

start

Готовы запустить рекламу через сеть public.tg?

Новый оффер, продукт, GEO, кейс, событие или партнёрский запуск — соберём маршрут под задачу и отдадим медиаплан.

Telegram для медиаплана: @AFFtop_connect. Быстрый тест: $20 за канал, $1000 за пакет по сети.