Feedback & Interaction · What a tap feels like
Swing摇摆
- hanging
- pendulum
- pivot above
The element swings about its top edge like a sign on a nail, each arc smaller than the last, until it settles. The pivot is above it, which is what makes it a pendulum rather than a spin — and that is decided entirely by transform-origin. Put the origin at the centre and it becomes a different effect.
When to use it
Use it on things that genuinely hang: tags, bells, lanterns, seasonal decorations. On a square button it looks wrong — a box has no edge anything could hang from.
Parameters
transform-origin: top center · transform: rotate 0→15deg→-10deg→5deg→0deg · 1000ms ease-in-out
Recipe
Swing → transform-origin: top center · transform: rotate 0→15deg→-10deg→5deg→0deg · 1000ms ease-in-out
One sentence for your AI
Build a hanging swing: set transform-origin to top center and rotate through 15deg, -10deg, 5deg and back to 0deg over 1000ms ease-in-out. Never omit the origin — without it the rotation happens about the centre, which is a different effect entirely.