CSS Transforms, Transitions, and Animations
Notes from Transforms
The transform
property comes in two different settings, two-dimensional and three-dimensional. Each of these come with their own individual properties and values.
2D Transforms
2D transforms work on the x
and y
axes, known as horizontal and vertical axes
rotate
value: rotates an element from 0 to 360 degreesscale
value: allows you to change the size of an elementtranslate
value: pushing and pulling of an element in different directionstranslateX
value: changes position on the horizontal axistranslateY
value: changes position on the vertical axisskew
value: distorts elementsskewX
value: distorts element on the horizontal axisskewY
value: distorts element on the vertical axis
3D Transforms
3D transforms work on the x
, y
, and z
axes
Notes from Transitions & Animations
Transitions
For a transition to take place, an element must have a change in state, and different styles must be identified for each state. There are 4 transition related properties
transition-property
: determines exactly what properties will be altered in conjunction with the other transitional propertiestransition-duration
: set using general timing values like seconds and millisecondstransition-timing-function
: used to set the speed in which a transition will movetransition-delay
: sets a time value that determines how long a transition should be stalled before executing
Notes from 8 Simple CSS Transitions That Will Wow Your Users by Sara Vieira
- Fade in
- Change Color
- Grow & Shrink
- Rotate elements
- Square to circle
- 3D Shadow
- Swing (this annimation moves the element left and right)
- Insert border