|
1 | | -"use client"; |
2 | | - |
3 | | -import { motion } from "framer-motion"; |
4 | | - |
5 | | -/** |
6 | | - * Full-page animated background with floating gradient orbs, |
7 | | - * a subtle dot grid, and moving aurora streaks — all on deep black. |
8 | | - */ |
9 | 1 | export function DynamicBackground() { |
10 | 2 | return ( |
11 | 3 | <div className="pointer-events-none fixed inset-0 z-0 overflow-hidden"> |
12 | | - {/* ── Dot grid ─────────────────────────────────────── */} |
13 | | - <div |
14 | | - className="absolute inset-0 opacity-[0.04]" |
15 | | - style={{ |
16 | | - backgroundImage: "radial-gradient(circle, rgba(255,255,255,0.5) 1px, transparent 1px)", |
17 | | - backgroundSize: "32px 32px", |
18 | | - }} |
19 | | - /> |
| 4 | + <div className="absolute inset-0 bg-background" /> |
20 | 5 |
|
21 | | - {/* ── Gradient orbs ────────────────────────────────── */} |
22 | | - {/* Top-left — cool purple */} |
23 | | - <motion.div |
24 | | - className="absolute -left-[15%] -top-[10%] h-[700px] w-[700px] rounded-full blur-[120px]" |
25 | | - style={{ |
26 | | - background: "radial-gradient(circle, oklch(0.45 0.18 280 / 0.18), transparent 70%)", |
27 | | - }} |
28 | | - animate={{ |
29 | | - x: [0, 60, -30, 0], |
30 | | - y: [0, 40, -20, 0], |
31 | | - scale: [1, 1.08, 0.95, 1], |
32 | | - }} |
33 | | - transition={{ |
34 | | - duration: 20, |
35 | | - repeat: Infinity, |
36 | | - ease: "easeInOut", |
37 | | - }} |
38 | | - /> |
39 | | - |
40 | | - {/* Center-right — deep blue */} |
41 | | - <motion.div |
42 | | - className="absolute right-[-10%] top-[25%] h-[600px] w-[600px] rounded-full blur-[120px]" |
| 6 | + {/* Structural top light */} |
| 7 | + <div |
| 8 | + className="absolute left-1/2 top-0 h-[34rem] w-[min(90rem,100vw)] -translate-x-1/2" |
43 | 9 | style={{ |
44 | | - background: "radial-gradient(circle, oklch(0.40 0.16 260 / 0.14), transparent 70%)", |
45 | | - }} |
46 | | - animate={{ |
47 | | - x: [0, -50, 30, 0], |
48 | | - y: [0, -30, 50, 0], |
49 | | - scale: [1, 0.92, 1.06, 1], |
50 | | - }} |
51 | | - transition={{ |
52 | | - duration: 25, |
53 | | - repeat: Infinity, |
54 | | - ease: "easeInOut", |
| 10 | + background: |
| 11 | + "radial-gradient(ellipse at top, oklch(0.58 0.11 255 / 0.12) 0%, oklch(0.46 0.06 250 / 0.05) 38%, transparent 72%)", |
55 | 12 | }} |
56 | 13 | /> |
57 | 14 |
|
58 | | - {/* Bottom-center — subtle warm accent */} |
59 | | - <motion.div |
60 | | - className="absolute bottom-[-5%] left-[30%] h-[500px] w-[500px] rounded-full blur-[140px]" |
| 15 | + {/* Subtle section framing */} |
| 16 | + <div |
| 17 | + className="absolute inset-x-0 top-[7rem] h-px" |
61 | 18 | style={{ |
62 | | - background: "radial-gradient(circle, oklch(0.38 0.12 300 / 0.10), transparent 70%)", |
63 | | - }} |
64 | | - animate={{ |
65 | | - x: [0, 40, -60, 0], |
66 | | - y: [0, -40, 20, 0], |
67 | | - scale: [1, 1.1, 0.94, 1], |
68 | | - }} |
69 | | - transition={{ |
70 | | - duration: 30, |
71 | | - repeat: Infinity, |
72 | | - ease: "easeInOut", |
| 19 | + background: "linear-gradient(90deg, transparent, rgba(255,255,255,0.14), transparent)", |
73 | 20 | }} |
74 | 21 | /> |
75 | 22 |
|
76 | | - {/* Mid-left — faint teal whisper */} |
77 | | - <motion.div |
78 | | - className="absolute left-[10%] top-[55%] h-[400px] w-[400px] rounded-full blur-[100px]" |
| 23 | + {/* Crisp grid instead of atmospheric fog */} |
| 24 | + <div |
| 25 | + className="absolute inset-0 opacity-[0.045]" |
79 | 26 | style={{ |
80 | | - background: "radial-gradient(circle, oklch(0.42 0.10 200 / 0.08), transparent 70%)", |
81 | | - }} |
82 | | - animate={{ |
83 | | - x: [0, -30, 50, 0], |
84 | | - y: [0, 60, -30, 0], |
85 | | - }} |
86 | | - transition={{ |
87 | | - duration: 22, |
88 | | - repeat: Infinity, |
89 | | - ease: "easeInOut", |
| 27 | + backgroundImage: |
| 28 | + "linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px)", |
| 29 | + backgroundPosition: "center top", |
| 30 | + backgroundSize: "72px 72px", |
90 | 31 | }} |
91 | 32 | /> |
92 | 33 |
|
93 | | - {/* ── Aurora streaks ───────────────────────────────── */} |
94 | | - <motion.div |
95 | | - className="absolute left-[20%] top-[10%] h-[2px] w-[40vw] origin-left rotate-[15deg] opacity-[0.07]" |
| 34 | + <div |
| 35 | + className="absolute inset-0 opacity-[0.025]" |
96 | 36 | style={{ |
97 | | - background: |
98 | | - "linear-gradient(90deg, transparent, oklch(0.55 0.20 270), oklch(0.50 0.15 240), transparent)", |
99 | | - }} |
100 | | - animate={{ |
101 | | - opacity: [0.04, 0.09, 0.04], |
102 | | - scaleX: [0.8, 1.2, 0.8], |
103 | | - }} |
104 | | - transition={{ |
105 | | - duration: 8, |
106 | | - repeat: Infinity, |
107 | | - ease: "easeInOut", |
| 37 | + backgroundImage: |
| 38 | + "linear-gradient(180deg, rgba(255,255,255,0.06) 0, transparent 22rem), linear-gradient(90deg, transparent 0, rgba(255,255,255,0.06) 50%, transparent 100%)", |
108 | 39 | }} |
109 | 40 | /> |
110 | 41 |
|
111 | | - <motion.div |
112 | | - className="absolute right-[15%] top-[40%] h-[1.5px] w-[35vw] origin-right -rotate-[12deg] opacity-[0.05]" |
| 42 | + <div |
| 43 | + className="absolute inset-x-0 bottom-0 h-[22rem]" |
113 | 44 | style={{ |
114 | | - background: |
115 | | - "linear-gradient(90deg, transparent, oklch(0.50 0.18 290), oklch(0.45 0.12 260), transparent)", |
116 | | - }} |
117 | | - animate={{ |
118 | | - opacity: [0.03, 0.07, 0.03], |
119 | | - scaleX: [1, 0.7, 1], |
120 | | - }} |
121 | | - transition={{ |
122 | | - duration: 10, |
123 | | - repeat: Infinity, |
124 | | - ease: "easeInOut", |
| 45 | + background: "linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.82) 100%)", |
125 | 46 | }} |
126 | 47 | /> |
127 | 48 |
|
128 | | - {/* ── Vignette — darkens edges toward pure black ──── */} |
| 49 | + {/* Edge control */} |
129 | 50 | <div |
130 | 51 | className="absolute inset-0" |
131 | 52 | style={{ |
132 | 53 | background: |
133 | | - "radial-gradient(ellipse 80% 70% at 50% 40%, transparent 30%, rgba(0,0,0,0.7) 100%)", |
| 54 | + "radial-gradient(ellipse 85% 72% at 50% 30%, transparent 42%, rgba(0,0,0,0.76) 100%)", |
134 | 55 | }} |
135 | 56 | /> |
136 | 57 | </div> |
|
0 commit comments