Baktiyar Ablaikhan

Aurora Background

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

Loading…

Soft bands of blue light drift slowly behind the headline.

Code

"use client";

import { motion } from "motion/react";
import React from "react";
import { AuroraBackground } from "@/lab/aceternity/ui/aurora-background";

export default function AuroraBackgroundDemo() {
  return (
    <div className="relative h-full w-full overflow-hidden [container-type:inline-size]">
      <AuroraBackground>
        <motion.div
          initial={{ opacity: 0.0, y: 40 }}
          whileInView={{ opacity: 1, y: 0 }}
          transition={{ delay: 0.3, duration: 0.8, ease: "easeInOut" }}
          className="relative flex flex-col gap-[2cqw] items-center justify-center px-4"
        >
          <div className="text-[clamp(1.1rem,6cqw,4.5rem)] leading-tight font-bold dark:text-white text-center">
            Background lights are cool you know.
          </div>
          <div className="font-extralight text-[clamp(0.8rem,3.2cqw,2.25rem)] dark:text-neutral-200 py-[1cqw]">
            And this, is chemical burn.
          </div>
          <button className="bg-black dark:bg-white rounded-full w-fit text-white dark:text-black px-4 py-2 text-[clamp(0.7rem,1.6cqw,1rem)]">
            Debug now
          </button>
        </motion.div>
      </AuroraBackground>
    </div>
  );
}
Prompt

Build "Aurora Background", a background animation. What it does: Soft bands of blue light drift slowly behind the 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 motion. Technique: the Motion library. It sits on a light 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/aurora-background (Aceternity UI, Aceternity UI licence (free component)).