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
rotatevalue: rotates an element from 0 to 360 degreesscalevalue: allows you to change the size of an elementtranslatevalue: pushing and pulling of an element in different directionstranslateXvalue: changes position on the horizontal axistranslateYvalue: changes position on the vertical axisskewvalue: distorts elementsskewXvalue: distorts element on the horizontal axisskewYvalue: 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