Color Flood
Scroll inside the frame to play the scene, or open it on its own page ↗.
Setup
$npx shadcn@latest add https://kinetikui.singhgourav.site/r/color-flood.json
Usage
Place it between other sections of a page. It pins itself to the screen while you scroll through it, then lets the page carry on:
Example
import { ColorFlood } from "@/components/ui/color-flood"
export default function Page() {
return (
<main>
<Intro />
<ColorFlood lead="Less noise," keyLine="more signal." />
<Footer />
</main>
)
}The scene is length + 1 screens tall, and plays across the first length of them. Raise
length to slow it down.
What happens as you scroll
- Sunrise. A blurred sun rises from below the fold and grows until it covers the page. The second line fades up out of a blur in light ink.
- Flood. Once the sun fills the screen, a flat fill in the core colour hides its soft edges.
- Nightfall. Night drops in from the top with a blurred edge, and the first line blurs away.
The scene eases toward your scroll position instead of snapping to it, so a quick flick still plays out as a smooth transition. Film grain and a fine dither sit on top so the gradients don't band.
Your own colours
Example
<ColorFlood day="#eef3ff" halo="#9cc3ff" core="#2f6bff" night="#050b1f" keyInk="#f2f6ff" />With prefers-reduced-motion, the scene shows a single still frame at full flood instead of
animating.
Props
| Prop | Type | Default | Notes |
|---|---|---|---|
lead | string | "Less noise," | First line. Dark ink that sinks into the night. |
keyLine | string | "more signal." | Second line. Light ink that surfaces as the sun floods in. |
day | string | "#f6f2ec" | Page colour before the sun rises. |
halo | string | "#f7b08a" | Soft outer glow of the sun. |
core | string | "#e8500f" | Hot centre of the sun, and the colour that floods the screen. |
night | string | "#140b07" | Colour that falls from the top at the end. |
ink | string | "#1a1210" | Ink for the first line. |
keyInk | string | "#fff8f2" | Ink for the second line. |
length | number | 3.5 | How many screens of scroll the scene plays across. |
grain | number | 0.12 | Film grain strength. 0 turns it off. |
dither | number | 0.35 | Fine noise dither over the scene. 0 turns it off. |
className | string | — | Classes for the outer section. |
Accessibility
- The section is labelled with both lines, so screen readers read the full message once
- The text is real text, not an image, so it can be selected and translated
- With reduced motion, nothing animates: you see one still frame with the second line showing