Entrances
Roll In Animation
Rolls in from the left, rotating as it travels.
Opens with this animation loaded. Nothing is uploaded — the scene travels in the link.
.roll-in {
transform: translate3d(180px, 100px, 0);
width: 120px;
height: 120px;
background: #6366f1;
border-radius: 20px;
animation: roll-in-anim 800ms linear 0ms infinite both;
will-change: transform, opacity;
}
@keyframes roll-in-anim {
0% {
transform: translate3d(-20px, 100px, 0) rotate(-180deg);
opacity: 0;
animation-timing-function: ease-out;
}
50% {
transform: translate3d(116.929px, 100px, 0) rotate(-56.764deg);
opacity: 1;
}
100% {
transform: translate3d(180px, 100px, 0);
opacity: 1;
}
}
@media (prefers-reduced-motion: reduce) {
.roll-in {
animation: none;
transition: none;
}
}Why it is built this way
Rotation and translation in one transform, so the element appears to roll rather than spin in place. The rotation ends at zero, which matters: leaving it at a multiple of 360 makes the CSS longer for no visible difference.
What it animates
3 properties across 2 CSS declarations. The bar shows when each one is moving.
opacitytransformtransformWhat it costs to run
Opacity, rotate and x are handled by the compositor: no layout, no repaint, and the work can run off the main thread. This is the cheap end of CSS animation, which is why it stays smooth on a slow phone where other properties will not.
It runs for 0.80s across 7 keyframe stops, with every property moving over the same window.
2 curves in play — Ease Out and Linear on a plain box. Different properties easing differently is how a movement gets texture: the eye reads the mismatch as weight rather than as a mistake.
Accessibility
Starting at opacity 0 makes the reduced-motion guard load-bearing rather than polite: strip it and a reader who asked for less movement gets no content at all, because nothing ever fades it in. It fades over 0.80s alongside rotate and x, and the guard skips all of it together. The generated CSS ends on the resting state, so skipping straight there is safe.