Hero Templates

Kusanagi

A long sword planted in a foggy field of tall grass, with a wide, heavy title under it and a thin editorial frame on top. Wind rolls through thousands of blades of grass drawn on the GPU, and the fog gets thicker toward the horizon. On load the fog lifts and the camera glides in to the sword. Click or tap to send a cut out from the sword. The grass in its path is cut short, then grows back. The button draws the sword out of the ground and cuts the whole field in a ring. Drag to turn the camera around the sword.

Install

bun add ogl

Then copy 2 files into your project:

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

Props

PropTypeDefaultDescription
distancenumber5.4How far the camera stands from the sword. Lower is closer.
density"16000" | "32000" | "64000""32000"How many blades of grass, in fixed steps. Each step rebuilds the blade buffer.
grassColorstring (hex)"#263a2c"Color of the grass near the ground.
tipColorstring (hex)"#93a37f"Color of the grass tips and seed heads.
fogColorstring (hex)"#5d6b73"Color of the fog. The sky is worked out from it.
steelColorstring (hex)"#cfd6dc"Tint of the sword's steel.
windnumber1How hard the wind blows. 0 leaves the field almost still.
fognumber0.6How thick the fog is.
grassHeightnumber1.15Grass height multiplier.
grainnumber0.35Film grain and dark corners over the scene. 0 turns both off.
framebooleantrueShow the thin rules, the ruler and the crosshairs over the scene.
cutbooleantrueA click or tap sends a cut out from the sword. The grass grows back.
autoRotatebooleantrueThe camera turns slowly while nothing is held.
parallaxbooleantrueThe camera leans toward the pointer, easing back on leave.
introbooleantruePlay the opening on load: the fog lifts and the camera glides in. Turn it off and on to play it again.

What It Demonstrates

Loop
An animation that repeats, a set number of times or infinitely.
Idle animation
Subtle motion that plays while an element is just sitting there, waiting to be interacted with.
Drag
Moving an element by grabbing it, often with momentum when released.
Momentum
Motion that carries velocity, especially after a drag or interruption.
Hardware acceleration
Animating transform and opacity lets the GPU keep motion smooth.

Related Components

Appears In