Gradient Animation
- Source
- Aceternity UI ↗
- Author
- Aceternity UI
- Licence
- Aceternity UI licence (free component)
Loading…
Blended colour blobs orbit behind the text, and one follows the pointer.
Code
"use client";
import React from "react";
import { BackgroundGradientAnimation } from "@/lab/aceternity/ui/background-gradient-animation";
export default function BackgroundGradientAnimationDemo() {
return (
<div className="h-full w-full [container-type:inline-size]">
<BackgroundGradientAnimation>
<div className="absolute z-50 inset-0 flex items-center justify-center text-white font-bold px-4 pointer-events-none text-[clamp(1.5rem,7cqw,4.5rem)] text-center">
<p className="bg-clip-text text-transparent drop-shadow-2xl bg-gradient-to-b from-white/80 to-white/20">
Gradients X Animations
</p>
</div>
</BackgroundGradientAnimation>
</div>
);
}
Prompt
Build "Gradient Animation", a background animation. What it does: Blended colour blobs orbit behind the text, and one follows the pointer. Write it as a single self-contained React component in TypeScript that fills its parent (w-full h-full), styled with Tailwind CSS. Technique: inline SVG, pointer tracking. 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/background-gradient-animation (Aceternity UI, Aceternity UI licence (free component)).