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

  1. 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.
  2. Flood. Once the sun fills the screen, a flat fill in the core colour hides its soft edges.
  3. 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

PropTypeDefaultNotes
leadstring"Less noise,"First line. Dark ink that sinks into the night.
keyLinestring"more signal."Second line. Light ink that surfaces as the sun floods in.
daystring"#f6f2ec"Page colour before the sun rises.
halostring"#f7b08a"Soft outer glow of the sun.
corestring"#e8500f"Hot centre of the sun, and the colour that floods the screen.
nightstring"#140b07"Colour that falls from the top at the end.
inkstring"#1a1210"Ink for the first line.
keyInkstring"#fff8f2"Ink for the second line.
lengthnumber3.5How many screens of scroll the scene plays across.
grainnumber0.12Film grain strength. 0 turns it off.
dithernumber0.35Fine noise dither over the scene. 0 turns it off.
classNamestring—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