Backgrounds

Anima

A still picture that looks alive. It is not a video and not 3D. One image runs through a shader. The marked parts sway and the glowing parts pulse. A band of light crosses the metal, the light of the whole scene rises and falls, and small glowing motes drift over it. Move the pointer and the near parts slide more than the far ones. A second, small image tells the shader what can bend, what glows and what is near.

Install

bun add ogl

Then copy 2 files into your project:

  • components/registry/anima/anima.tsx
  • hooks/use-animation-loop.ts

Props

PropTypeDefaultDescription
swaynumber1How far the marked parts bend. 0 holds the picture still.
speednumber1How fast everything moves.
motesnumber36How many glowing motes drift over the picture.
moteSizenumber32The width of the biggest motes.
glintnumber1How bright the band of light is when it crosses the metal parts.
glownumber1How strong the pulse is on the glowing parts.
breathnumber1How much the light of the whole scene rises and falls.
parallaxnumber1How far the pointer slides the near parts against the far ones.
focusnumber0.41The depth that stays still when the pointer moves. Nearer parts slide one way and farther parts slide the other way.
moteColorstring (hex)"#ffe9b8"The color of the motes.
lightColorstring (hex)"#ffd27a"The color of the light band and the glow.

What It Demonstrates

Idle animation
Subtle motion that plays while an element is just sitting there, waiting to be interacted with.
Float
A gentle, continuous up-and-down drift that makes a static element feel alive and weightless.
Pulse
A gentle repeating scale or opacity change to draw attention.
Loop
An animation that repeats, a set number of times or infinitely.

Related Components

Appears In