CSS Animation Notes
- Staff Curator
- Web
- 15 Feb, 2020
- 20 Feb, 2020
- 3 min read
CSS Animation rules and principles.
Shothands
- Transition - It follows the following syntax:
You can add multiple transitions separated by commas here. Or you can use all to perform all transition as:transition: property duration timing-function delay; /* e.g. */ transition: background-color 2s ease-in-out .2s;transition: all 0.2s ease-in-out .2s; - Animation - Animation has the following syntax:
animation: name duration timing-function delay iteration-count direction fill-mode play-state; /* e.g. */ .ani { animation: colors 5s linear infinite alternate; }
Animation Shorthand initial values
- animation-name: none
- animation-duration: 0s
- animation-timing-function: ease
- animation-delay: 0s
- animation-iteration-count: 1
- animation-direction: normal
- animation-fill-mode: none
- animation-play-state: running
Animation Properties - Animation, Transform and Transition
| Property | Description |
|---|---|
| animation | A shorthand property that combines animation properties |
| animation-name | Specifies a name for the animation sequence |
| animation-duration | The amount of time the animation lasts |
| animation-timing-function | Describes the acceleration of the animation |
| animation-iteration-count | The number of times the animation repeats |
| animation-direction | Whether the animation plays forward, in reverse, or alternates back and forth |
| animation-play-state | Whether the animation is running or paused |
| animation-delay | The amount of time before the animation starts running |
| animation-fill-mode | Overrides limits to when animation properties can be applied |
| backface-visibility | Determines whether the reverse side of an element may be visible in 3-D transforms |
| perspective | Establishes an element as a 3-D space and specifies the perceived depth |
| perspective-origin | Specifies the position of your viewpoint in a 3-D space |
| transform | Specifies that the rendering of an element should be altered using one of the 2-D or 3-D transform functions |
| transform-origin | The point around which an element is transformed |
| transform-style | Used to preserve a 3-D context when transformed elements are nested |
| transition | A shorthand property that combines transition properties |
| transition-property | Defines which CSS property will be transitioned |
| transition-duration | The amount of time the transition animation lasts |
| transition-timing-function | Describes the manner in which the transition happens (changes in acceleration rates) |
| transition-delay | The amount of time before the transition starts |
CSS Animation Tutorial: css-animation.io