Skip to main content

🗓️ 12052024 1457
📎 #css

css_animation

Animation

.objectToAnimate {
animation: name duration timing-function delay iteration-count direction
fill-mode play-state;
}
.defaultAnimationProperties {
animation: none 0s ease 0s 1 normal none running;
}

Default values

Timing Functions

FunctionDescription
linearSame speed from start to end
easeStart slow, then fast, then end slow
ease-inStart slow, then fast
ease-outStart fast, end slow
ease-in-outStart slow, fast in the middle, end slow
cube-bezier(n, n, n, n)Define your own values in a cube-bezier function

Fill Modes

ModeDescription
noneDoes not apply style before / after animation
forwardsRetain styles from last keyframe
backwardsApplies styles from first keyframe during delay period
bothFollow both forwards and backwards

Play State

  • running: Default state; animation runs as normal.
  • paused: Pauses the animation.

Keyframes

@keyframes animationName {
from {
/* Start state */
}
to {
/* End state */
}
/* OR using percentages */
0% {
/* Start state */
}
50% {
/* Intermediate state */
}
100% {
/* End state */
}
}

References