freecoding.school100% FREE · NO SIGNUP
Neon DistrictISSUE #5 of 50

animations · keyframes · iteration · direction

PrismaVSJank the Janitor
Prisma says@keyframes + animation create multi-step, looping motion independent of state changes.

Where transitions need a trigger, animation runs on its own. Define stages with @keyframes name { 0%{…} 100%{…} }, then apply animation: name 2s infinite. Control iteration count, direction (alternate), delay, fill mode. Perfect for spinners and pulses.

Power-ups you unlock

Jank the Janitor attacks — common mistakes

Boss battleMake a pulsing dot with @keyframes scaling opacity and size, looping infinitely.

Example code

<!doctype html><html><head><meta charset="utf-8">
<style>.dot{width:40px;height:40px;border-radius:50%;background:#b388ff;animation:pulse 1.4s ease-in-out infinite}@keyframes pulse{0%,100%{transform:scale(1);opacity:1}50%{transform:scale(1.4);opacity:.5}}</style></head><body style="background:#06040d;padding:30px"><div class="dot"></div></body></html>
▶ Open the interactive comic issue
‹ Timing Functions · Ease · Cubic-Bezier · StepsAnimation Events · Animationstart · Animationend ›