animation

CSS animation property classes. Supports individual property classes and animation shorthand using the an prefix.

Animation Shorthand

Combines an + name + duration + timing + delay + iteration count + fill-mode for the animation shorthand. Timing also accepts compact forms — easein becomes ease-in.

an{name}-{duration}-{timing}-{delay}-{iteration}-{fillMode}
PartRoleExample
ananimation prefix (required)an
{name}keyframe name (required)fadeIn, slideUp, pulse
{duration}duration (required)1s, 500ms, 1-5s
{timing}timing function (optional) — compact form allowed: easein → ease-inease, linear, ease-in-out, easein
{delay}delay (optional)1s, 500ms
{iteration}iteration count (optional)infinite, 3
{fillMode}fill-mode (optional)forwards, backwards, both

anfadeIn-1s-ease = an(animation) + fadeIn(name) + 1s(duration) + ease(timing)

Usage Examples

ClassCSS
anfadeIn-1s-easeanimation: fadeIn 1s ease
anfadeIn-500ms-linearanimation: fadeIn 500ms linear
anslideUp-1s-ease-in-outanimation: slideUp 1s ease-in-out
anslideDown-300msanimation: slideDown 300ms
anfadeIn-1s-ease-infiniteanimation: fadeIn 1s ease infinite
anpulse-2s-ease-in-out-infiniteanimation: pulse 2s ease-in-out infinite
anbounce-1s-ease-3animation: bounce 1s ease 3
anslideUp-1s-easeinanimation: slideUp 1s ease-in
anfadeIn-2s-ease-1sanimation: fadeIn 2s ease 1s
anspinCW-2s-linear-infiniteanimation: spinCW 2s linear infinite
anfadeIn-1s-ease-in-out-infinite-forwardsanimation: fadeIn 1s ease-in-out infinite forwards

Preset Keyframes

Using names below auto-inserts @keyframes rules into CSS. Custom names require manually writing @keyframes.

NameEffectUsage Examples
fadeInTransparent → opaqueanfadeIn-1s-ease
fadeOutOpaque → transparentanfadeOut-500ms-ease
slideUpSlide up from bottomanslideUp-1s-ease-in-out
slideDownSlide down from topanslideDown-300ms
slideLeftSlide left from rightanslideLeft-500ms-ease
slideRightSlide right from leftanslideRight-500ms-ease
zoomInScale up and appearanzoomIn-500ms-ease
zoomOutScale down and disappearanzoomOut-500ms-ease
spinCWClockwise rotationanspinCW-2s-linear-infinite
spinCCWCounter-clockwise rotationanspinCCW-2s-linear-infinite
bounceBounce effectanbounce-1s-ease
pulsePulse scale up/downanpulse-2s-ease-in-out-infinite
shakeHorizontal shakeanshake-500ms-ease
flipY-axis rotation (card flip)anflip-1s-ease
swingShake and settleanswing-1s-ease
rubberBandRubber band stretch and returnanrubberBand-1s-ease
blinkBlinkanblink-1s-ease-infinite

Code Examples

<!-- Fade in -->
<div class="anfadeIn-1s-ease">Appearing element</div>

<!-- Infinite rotation loading -->
<div class="anspinCW-2s-linear-infinite w4rem h4rem">
  <svg>...</svg>
</div>

<!-- Bounce notification badge -->
<span class="anbounce-1s-ease bg6366F1 cFFFFFF br50p w2-4rem h2-4rem df jcc aic">3</span>

<!-- Shake on hover -->
<button class="hover-anshake-500ms-ease bg18181B cFFFFFF py12px px2-4rem br8px">
  Hover me
</button>

<!-- Card entrance (slide up + fill forwards) -->
<div class="anslideUp-500ms-ease-in-out-infinite-forwards bg0F0F17 p2rem br8px">
  Card Content
</div>

Custom Keyframe Usage

Non-preset names can be used freely. E.g.: anmyCustom-1s-ease. The @keyframes rule must be written in a separate CSS file.

Play State

ClassCSS
apsranimation-play-state: running
apspanimation-play-state: paused

Fill Mode

ClassCSS
afmnanimation-fill-mode: none
afmfanimation-fill-mode: forwards
afmbanimation-fill-mode: backwards
afmbfanimation-fill-mode: both

Direction

ClassCSS
adinanimation-direction: normal
adiranimation-direction: reverse
adialanimation-direction: alternate
adialranimation-direction: alternate-reverse

Iteration Count

ClassCSS
aicinfanimation-iteration-count: infinite

Tips & Notes

Shorthand vs Individual Properties

Specify all at once with anfadeIn-1s-ease, or combine individual properties like afmf aicinf.

Preset = automatic &#64;keyframes

Preset names (fadeIn, slideUp, etc.) auto-insert &#64;keyframes into CSS. Same keyframe across multiple classes generates only once.

hover + animation

Can combine with pseudo-classes like hover-anfadeIn-500ms-ease. Media queries also supported.