Attention
Vertical Shake Animation
A short shudder up and down, for rejecting input.
Opens with this animation loaded. Nothing is uploaded — the scene travels in the link.
.shake-y {
transform: translate3d(165px, 137px, 0);
width: 150px;
height: 46px;
background: #6366f1;
border-radius: 999px;
color: #ffffff;
font-size: 15px;
font-weight: 600;
animation: shake-y-anim 700ms linear 0ms infinite both;
will-change: transform, opacity;
}
@keyframes shake-y-anim {
0% {
transform: translate3d(165px, 137px, 0);
animation-timing-function: ease-in-out;
}
15% {
transform: translate3d(165px, 125px, 0);
animation-timing-function: ease-in-out;
}
30% {
transform: translate3d(165px, 147px, 0);
animation-timing-function: ease-in-out;
}
45% {
transform: translate3d(165px, 129px, 0);
animation-timing-function: ease-in-out;
}
60% {
transform: translate3d(165px, 143px, 0);
animation-timing-function: ease-in-out;
}
75% {
transform: translate3d(165px, 133px, 0);
animation-timing-function: ease-in-out;
}
100% {
transform: translate3d(165px, 137px, 0);
}
}
@media (prefers-reduced-motion: reduce) {
.shake-y {
animation: none;
transition: none;
}
}Why it is built this way
Horizontal shake is the near-universal signal for a wrong password. Vertical reads differently — more like something failing to lift — so use it for a different kind of refusal rather than as a stylistic swap.
What it animates
1 property across 1 CSS declaration. The bar shows when each one is moving.
transformWhat it costs to run
Y is 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.70s across 7 keyframe stops, with every property moving over the same window.
One curve throughout: Ease In Out on a button. Keeping a single easing across every property is what makes a multi-property animation read as one movement rather than several things happening at once.
Accessibility
Nothing here hides content — y moves over 0.70s and the element is visible throughout. The exported prefers-reduced-motion guard still silences it, which matters most for the looping ones: motion that never stops is the kind that makes people feel unwell.