transitionResponds to state changes:
:hover, :focus, :checked, :invalidtransitiontransition: opacity .2s .3s ease-out;
transition-propertytransition-durationtransition-delaytransition-timing-functiontransition-propertyA valid CSS property name
transition-durationTotal time it takes the transition to run
default: 0s
transition-delayTime before the transition begins
Can be negative: starts transition partway through
default: 0s
transition-timing-functionKeyword or cubic-bezier function
default: ease
transition.box {
opacity: 1;
transition: opacity .25s ease-in-out;
}
.box[aria-hidden="true"] {
opacity: 0;
}
transition.field {
border-bottom: 2px solid #eee;
transition: border-color .1s linear;
}
.field:invalid {
border-bottom-color: #B71C1C;
}
transition.link {
transition: transform .15s
cubic-bezier(.75,.25,.75,1.5);
}
.link:hover {
transform: scale(1.15);
}
animationanimation: spinner .2s .3s ease-out infinite altenate paused;
animationanimation-nameanimation-durationanimation-delayanimation-timing-functionanimation-iteration-countanimation-directionanimation-fill-modeanimation-play-stateanimation-timing-functionanimation-nameCorresponds to a keyframes animation in the stylesheet
animation-durationTotal time it takes the animation for one complete cycle
default: 0s
animation-delayTime before the animation begins
Can be negative: starts animation partway through
default: 0s
animation-timing-functionKeyword or cubic-bezier function
default: ease
animation-iteration-countHow many times the animation should run before stopping
default: 1
animation-directionShould an animation play forwards, backwards, or alternating
normal, reverse, alternate, alternate-reverse
default: normal
animation-fill-modeHow an animation should apply styles to its target before and after running
none, forwards, backwards, both
default: none
animation-play-stateSpecifies if an animation is running or paused
running, paused
default: running
keyframesA CSS at-rule block, containing styles corresponding to frames in an animation sequence
keyframes@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
keyframes@keyframes wiggle {
0%, 20%, 40%, 60%, 80%, 100% {
transform: rotate(0deg);
}
30%, 70% {
transform: rotate(-5deg);
}
50%, 90% {
transform: rotate(5deg);
}
}
keyframes@keyframes zoom-in {
0% {
opacity: 0;
transform: translate(-50vw, 200%) scale(0);
}
100% {
opacity: 1;
transform: none;
}
}
jdsteinbach