Shooting Stars and Stars Background
- Source
- Aceternity UI ↗
- Author
- Aceternity UI
- Licence
- Aceternity UI licence (free component)
Loading…
Twinkling canvas stars with gradient shooting stars streaking across.
Code
"use client";
import { ShootingStars } from "@/lab/aceternity/ui/shooting-stars";
import { StarsBackground } from "@/lab/aceternity/ui/stars-background";
export default function ShootingStarsAndStarsBackgroundDemo() {
return (
<div className="@container relative flex h-full w-full flex-col items-center justify-center overflow-hidden bg-neutral-900">
<h2 className="relative z-10 mx-auto flex max-w-5xl flex-col items-center gap-2 bg-gradient-to-b from-neutral-800 via-white to-white bg-clip-text text-center text-[clamp(1.4rem,5.5cqw,3rem)] leading-tight font-medium tracking-tight text-transparent @2xl:flex-row @2xl:gap-8">
<span>Shooting Star</span>
<span className="text-lg font-thin text-white">x</span>
<span>Star Background</span>
</h2>
<ShootingStars />
<StarsBackground />
</div>
);
}
Prompt
Build "Shooting Stars and Stars Background", a background animation. What it does: Twinkling canvas stars with gradient shooting stars streaking across. Write it as a single self-contained React component in TypeScript that fills its parent (w-full h-full), styled with Tailwind CSS. Technique: an HTML canvas, a requestAnimationFrame loop, inline SVG. 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/shooting-stars-and-stars-background (Aceternity UI, Aceternity UI licence (free component)).