CSS animation delay
Achieve complex animation effects with animation pause state and control animation delay.
Simple animation
Medium animation
Complex animations
Core principles
animation-play-state: paused
(animation paused state)
- In CSS:
animation: move 1s linear forwards paused
; - Purpose: freeze the animation so it does not play automatically
- Effect: the animation is "stuck" at a specific time point and only the current frame is shown
- Negative
animation-delay
(negative delay)
- In JS:
ball.style.setProperty("--delay", -input.value + "s");
- Purpose: make the animation appear as if it started from a specified time point
- Characteristic: a negative delay immediately advances the animation to the time point indicated by
delay
- Examples:
delay: 0s
→ shows the animation's initial statedelay: -0.5s
→ shows the animation halfway throughdelay: -1s
→ shows the animation's final state
Use cases
- Animation progress controller
- Interactive timeline display
- Scroll-based animation control
- Rotation control for a 3D model viewer
HTML
HyperText Markup Language (HTML) is a markup language used to structure web pages and their content. Web content can be a set of paragraphs, a list of key information, or it can contain images and data tables. As the title suggests, this article will give you a basic introduction to HTML and its features.
CSS Houdini
Achieve complex animations with CSS Houdini