Baktiyar Ablaikhan

Vortex

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

Loading…

Glowing particles follow a noise field in a swirling band behind hero text.

Code

"use client";
import { Vortex } from "@/lab/aceternity/ui/vortex";

export default function VortexDemo() {
  return (
    <div className="relative h-full w-full overflow-hidden [container-type:size]">
      <Vortex
        backgroundColor="black"
        className="flex h-full w-full flex-col items-center justify-center px-[4cqw] py-4"
      >
        <h2 className="text-center text-[clamp(1.25rem,7cqw,3.75rem)] font-bold text-white">
          The hell is this?
        </h2>
        <p className="mt-[3cqh] max-w-xl text-center text-[clamp(0.7rem,2.6cqw,1.5rem)] text-white">
          This is chemical burn. It&apos;ll hurt more than you&apos;ve ever been burned and
          you&apos;ll have a scar.
        </p>
        <div className="mt-[4cqh] flex flex-row items-center gap-4 text-[clamp(0.7rem,1.8cqw,1rem)]">
          <button className="rounded-lg bg-blue-600 px-4 py-2 text-white shadow-[0px_2px_0px_0px_#FFFFFF40_inset] transition duration-200 hover:bg-blue-700">
            Order now
          </button>
          <button className="px-4 py-2 text-white">Watch trailer</button>
        </div>
      </Vortex>
    </div>
  );
}
Prompt

Build "Vortex", a background animation. What it does: Glowing particles follow a noise field in a swirling band behind hero text. Write it as a single self-contained React component in TypeScript that fills its parent (w-full h-full), styled with Tailwind CSS, using motion, simplex-noise. Technique: an HTML canvas, a requestAnimationFrame loop, the Motion library. 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/vortex (Aceternity UI, Aceternity UI licence (free component)).