Baktiyar Ablaikhan

Wavy Background

Source
Aceternity UI ↗
Author
Aceternity UI
Licence
Aceternity UI licence (free component)

Loading…

Blurred noise-driven waves in five colours ripple across a canvas behind a headline.

Code

"use client";
import { WavyBackground } from "@/lab/aceternity/ui/wavy-background";

export default function WavyBackgroundDemo() {
  return (
    <div className="relative h-full w-full [container-type:size]">
      <WavyBackground className="mx-auto max-w-4xl px-4 pb-[18cqh]">
        <p className="text-center text-[clamp(1.25rem,7.5cqw,4.5rem)] font-bold text-white">
          Hero waves are cool
        </p>
        <p className="mt-[2cqh] text-center text-[clamp(0.7rem,2.2cqw,1.125rem)] font-normal text-white">
          Leverage the power of canvas to create a beautiful hero section
        </p>
      </WavyBackground>
    </div>
  );
}
Prompt

Build "Wavy Background", a background animation. What it does: Blurred noise-driven waves in five colours ripple across a canvas behind a headline. Write it as a single self-contained React component in TypeScript that fills its parent (w-full h-full), styled with Tailwind CSS, using simplex-noise. Technique: an HTML canvas, a requestAnimationFrame loop. It sits on a dark background, in a 16:10 frame. Respect prefers-reduced-motion with a still state, pause work when the element is off screen, and keep it accessible. Original: https://ui.aceternity.com/components/wavy-background (Aceternity UI, Aceternity UI licence (free component)).