A lamp component from Aceternity UI.
From Aceternity UI
1"use client";
2import React from "react";
3import { motion } from "motion/react";
4import { cn } from "@/lib/utils";
5
6export default function LampDemo() {
7 return (
8 <LampContainer>
9 <motion.h1
10 initial={{ opacity: 0.5, y: 100 }}
11 whileInView={{ opacity: 1, y: 0 }}
12 transition={{
13 delay: 0.3,
14 duration: 0.8,
15 ease: "easeInOut",
16 }}
17 className="mt-8 bg-gradient-to-br from-slate-300 to-slate-500 py-4 bg-clip-text text-center text-4xl font-medium tracking-tight text-transparent md:text-7xl"
18 >
19 Build lamps <br /> the right way
20 </motion.h1>
21 </LampContainer>
22 );
23}
24
25export const LampContainer = ({
26 children,
27 className,
28}: {
29 children: React.ReactNode;
30 className?: string;
31}) => {
32 return (
33 <div
34 className={cn(
35 "relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-slate-950 w-full rounded-md z-0",
36 className
37 )}
38 >
39 <div className="relative flex w-full flex-1 scale-y-125 items-center justify-center isolate z-0 ">
40 <motion.div
41 initial={{ opacity: 0.5, width: "15rem" }}
42 whileInView={{ opacity: 1, width: "30rem" }}
43 transition={{
44 delay: 0.3,
45 duration: 0.8,
46 ease: "easeInOut",
47 }}
48 style={{
49 backgroundImage: `conic-gradient(var(--conic-position), var(--tw-gradient-stops))`,
50 }}
51 className="absolute inset-auto right-1/2 h-56 overflow-visible w-[30rem] bg-gradient-conic from-cyan-500 via-transparent to-transparent text-white [--conic-position:from_70deg_at_center_top]"
52 >
53 <div className="absolute w-[100%] left-0 bg-slate-950 h-40 bottom-0 z-20 [mask-image:linear-gradient(to_top,white,transparent)]" />
54 <div className="absolute w-40 h-[100%] left-0 bg-slate-950 bottom-0 z-20 [mask-image:linear-gradient(to_right,white,transparent)]" />
55 </motion.div>
56 <motion.div
57 initial={{ opacity: 0.5, width: "15rem" }}
58 whileInView={{ opacity: 1, width: "30rem" }}
59 transition={{
60 delay: 0.3,
61 duration: 0.8,
62 ease: "easeInOut",
63 }}
64 style={{
65 backgroundImage: `conic-gradient(var(--conic-position), var(--tw-gradient-stops))`,
66 }}
67 className="absolute inset-auto left-1/2 h-56 w-[30rem] bg-gradient-conic from-transparent via-transparent to-cyan-500 text-white [--conic-position:from_290deg_at_center_top]"
68 >
69 <div className="absolute w-40 h-[100%] right-0 bg-slate-950 bottom-0 z-20 [mask-image:linear-gradient(to_left,white,transparent)]" />
70 <div className="absolute w-[100%] right-0 bg-slate-950 h-40 bottom-0 z-20 [mask-image:linear-gradient(to_top,white,transparent)]" />
71 </motion.div>
72 <div className="absolute top-1/2 h-48 w-full translate-y-12 scale-x-150 bg-slate-950 blur-2xl"></div>
73 <div className="absolute top-1/2 z-50 h-48 w-full bg-transparent opacity-10 backdrop-blur-md"></div>
74 <div className="absolute inset-auto z-50 h-36 w-[28rem] -translate-y-1/2 rounded-full bg-cyan-500 opacity-50 blur-3xl"></div>
75 <motion.div
76 initial={{ width: "8rem" }}
77 whileInView={{ width: "16rem" }}
78 transition={{
79 delay: 0.3,
80 duration: 0.8,
81 ease: "easeInOut",
82 }}
83 className="absolute inset-auto z-30 h-36 w-64 -translate-y-[6rem] rounded-full bg-cyan-400 blur-2xl"
84 ></motion.div>
85 <motion.div
86 initial={{ width: "15rem" }}
87 whileInView={{ width: "30rem" }}
88 transition={{
89 delay: 0.3,
90 duration: 0.8,
91 ease: "easeInOut",
92 }}
93 className="absolute inset-auto z-50 h-0.5 w-[30rem] -translate-y-[7rem] bg-cyan-400 "
94 ></motion.div>
95
96 <div className="absolute inset-auto z-40 h-44 w-full -translate-y-[12.5rem] bg-slate-950 "></div>
97 </div>
98
99 <div className="relative z-50 flex -translate-y-80 flex-col items-center px-5">
100 {children}
101 </div>
102 </div>
103 );
104};
105