Skip to content

Commit 02c08cb

Browse files
committed
Restore homepage hero contrast
1 parent f50c69b commit 02c08cb

2 files changed

Lines changed: 80 additions & 26 deletions

File tree

components/landing/hero-section.tsx

Lines changed: 49 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import Link from "next/link";
55
import { Button } from "@/components/ui/button";
66
import { ArrowRight } from "lucide-react";
77
import { TubesBackground } from "./tubes-background";
8+
import { AnimatedSphere } from "./animated-sphere";
89
import { useReducedMotion } from "@/hooks/use-reduced-motion";
910

1011
const words = ["learn", "build", "practice", "ship"];
@@ -24,29 +25,57 @@ export function HeroSection() {
2425
}, [prefersReducedMotion]);
2526

2627
return (
27-
<section className="relative min-h-screen overflow-hidden bg-[#050608]">
28-
<TubesBackground className="min-h-screen rounded-b-[2rem] md:rounded-b-[3rem]">
29-
<div className="mx-auto flex min-h-screen max-w-[1400px] flex-col justify-center px-6 py-32 lg:px-12 lg:py-40">
28+
<section className="relative flex min-h-screen flex-col justify-center overflow-hidden bg-background text-foreground">
29+
<div className="absolute right-[-12%] top-1/2 hidden h-[620px] w-[620px] -translate-y-1/2 pointer-events-none md:block lg:h-[820px] lg:w-[820px]">
30+
<TubesBackground
31+
tone="light"
32+
enableClickInteraction={false}
33+
className="h-full min-h-full rounded-full border border-cyan-500/10 shadow-[0_30px_120px_rgba(6,182,212,0.16)]"
34+
/>
35+
</div>
36+
37+
<div className="absolute right-0 top-1/2 hidden h-[600px] w-[600px] -translate-y-1/2 opacity-25 pointer-events-none md:block lg:h-[800px] lg:w-[800px]">
38+
<AnimatedSphere />
39+
</div>
40+
41+
<div className="absolute inset-0 overflow-hidden pointer-events-none opacity-30">
42+
{[...Array(8)].map((_, i) => (
3043
<div
31-
className={`mb-8 transition-all duration-700 ${
32-
isVisible ? "opacity-100 translate-y-0" : "opacity-0 translate-y-4"
33-
}`}
34-
>
35-
<span className="inline-flex items-center gap-3 text-sm font-mono text-white/70">
36-
<span className="h-px w-8 bg-cyan-300/60 shadow-[0_0_18px_rgba(34,211,238,0.9)]" />
37-
The platform to master AI
38-
</span>
39-
</div>
44+
key={`h-${i}`}
45+
className="absolute h-px bg-foreground/10"
46+
style={{ top: `${12.5 * (i + 1)}%`, left: 0, right: 0 }}
47+
/>
48+
))}
49+
{[...Array(12)].map((_, i) => (
50+
<div
51+
key={`v-${i}`}
52+
className="absolute w-px bg-foreground/10"
53+
style={{ left: `${8.33 * (i + 1)}%`, top: 0, bottom: 0 }}
54+
/>
55+
))}
56+
</div>
57+
58+
<div className="relative z-10 mx-auto max-w-[1400px] px-6 py-32 lg:px-12 lg:py-40">
59+
<div
60+
className={`mb-8 transition-all duration-700 ${
61+
isVisible ? "opacity-100 translate-y-0" : "opacity-0 translate-y-4"
62+
}`}
63+
>
64+
<span className="inline-flex items-center gap-3 text-sm font-mono text-muted-foreground">
65+
<span className="h-px w-8 bg-foreground/30" />
66+
The platform to master AI
67+
</span>
68+
</div>
4069

4170
<div className="mb-12">
4271
<h1
43-
className={`max-w-6xl text-[clamp(3rem,12vw,10rem)] font-display leading-[0.9] tracking-tight text-white drop-shadow-[0_0_38px_rgba(6,182,212,0.3)] transition-all duration-1000 ${
72+
className={`text-[clamp(3rem,12vw,10rem)] font-display leading-[0.9] tracking-tight transition-all duration-1000 ${
4473
isVisible ? "opacity-100 translate-y-0" : "opacity-0 translate-y-8"
4574
}`}
4675
>
47-
<span className="block text-white/78">AIByDM</span>
76+
<span className="block">The place to</span>
4877
<span className="block">
49-
<span className="relative inline-block brand-hero-wordmark">
78+
<span className="relative inline-block brand-wordmark-text">
5079
<span key={wordIndex} className="inline-flex">
5180
{words[wordIndex].split("").map((char, i) => (
5281
<span
@@ -58,7 +87,7 @@ export function HeroSection() {
5887
</span>
5988
))}
6089
</span>
61-
<span className="absolute -bottom-2 left-0 right-0 h-3 bg-cyan-300/20 shadow-[0_0_30px_rgba(34,211,238,0.55)]" />
90+
<span className="absolute -bottom-2 left-0 right-0 h-3 bg-cyan-400/15 shadow-[0_0_28px_rgba(6,182,212,0.22)]" />
6291
</span>{" "}
6392
AI
6493
</span>
@@ -67,7 +96,7 @@ export function HeroSection() {
6796

6897
<div className="grid lg:grid-cols-2 gap-12 lg:gap-24 items-end">
6998
<p
70-
className={`max-w-xl text-xl leading-relaxed text-white/72 transition-all delay-200 duration-700 lg:text-2xl ${
99+
className={`max-w-xl text-xl leading-relaxed text-muted-foreground transition-all delay-200 duration-700 lg:text-2xl ${
71100
isVisible ? "opacity-100 translate-y-0" : "opacity-0 translate-y-4"
72101
}`}
73102
>
@@ -83,7 +112,7 @@ export function HeroSection() {
83112
<Button
84113
asChild
85114
size="lg"
86-
className="h-14 rounded-full bg-white px-8 text-base text-[#050608] shadow-[0_0_34px_rgba(34,211,238,0.32)] hover:bg-cyan-50 group"
115+
className="group h-14 rounded-full bg-foreground px-8 text-base text-background hover:bg-foreground/90"
87116
>
88117
<Link href="/learn">
89118
Start learning free
@@ -94,14 +123,13 @@ export function HeroSection() {
94123
asChild
95124
size="lg"
96125
variant="outline"
97-
className="h-14 rounded-full border-white/30 bg-white/5 px-8 text-base text-white backdrop-blur-md hover:bg-white/12"
126+
className="h-14 rounded-full border-foreground/20 px-8 text-base hover:bg-foreground/5"
98127
>
99128
<Link href="/tools">Explore tools</Link>
100129
</Button>
101130
</div>
102131
</div>
103-
</div>
104-
</TubesBackground>
132+
</div>
105133
</section>
106134
);
107135
}

components/landing/tubes-background.tsx

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ type TubesBackgroundProps = {
88
children?: ReactNode;
99
className?: string;
1010
enableClickInteraction?: boolean;
11+
tone?: "light" | "dark";
1112
};
1213

1314
type TubesApp = {
@@ -32,6 +33,7 @@ export function TubesBackground({
3233
children,
3334
className,
3435
enableClickInteraction = true,
36+
tone = "light",
3537
}: TubesBackgroundProps) {
3638
const canvasRef = useRef<HTMLCanvasElement>(null);
3739
const appRef = useRef<TubesApp | null>(null);
@@ -93,25 +95,49 @@ export function TubesBackground({
9395
return (
9496
<div
9597
className={cn(
96-
"relative min-h-[620px] overflow-hidden bg-[#050608] text-white",
98+
tone === "dark"
99+
? "relative min-h-[620px] overflow-hidden bg-[#050608] text-white"
100+
: "relative min-h-[620px] overflow-hidden bg-transparent text-foreground",
97101
className,
98102
)}
99103
onClick={handleClick}
100104
>
101-
<div className="absolute inset-0 bg-[radial-gradient(circle_at_25%_20%,rgba(6,182,212,0.28),transparent_32%),radial-gradient(circle_at_76%_12%,rgba(249,115,22,0.2),transparent_28%),linear-gradient(135deg,#050608_0%,#0b1517_54%,#11100a_100%)]" />
102-
<div className="absolute inset-0 opacity-45 [background-image:linear-gradient(rgba(255,255,255,0.08)_1px,transparent_1px),linear-gradient(90deg,rgba(255,255,255,0.08)_1px,transparent_1px)] [background-size:72px_72px]" />
105+
<div
106+
className={cn(
107+
"absolute inset-0",
108+
tone === "dark"
109+
? "bg-[radial-gradient(circle_at_25%_20%,rgba(6,182,212,0.28),transparent_32%),radial-gradient(circle_at_76%_12%,rgba(249,115,22,0.2),transparent_28%),linear-gradient(135deg,#050608_0%,#0b1517_54%,#11100a_100%)]"
110+
: "bg-[radial-gradient(circle_at_28%_24%,rgba(6,182,212,0.22),transparent_34%),radial-gradient(circle_at_76%_18%,rgba(249,115,22,0.16),transparent_30%),linear-gradient(135deg,rgba(255,255,255,0.86),rgba(236,254,255,0.48),rgba(255,247,237,0.36))]",
111+
)}
112+
/>
113+
<div
114+
className={cn(
115+
"absolute inset-0 [background-size:72px_72px]",
116+
tone === "dark"
117+
? "opacity-45 [background-image:linear-gradient(rgba(255,255,255,0.08)_1px,transparent_1px),linear-gradient(90deg,rgba(255,255,255,0.08)_1px,transparent_1px)]"
118+
: "opacity-55 [background-image:linear-gradient(rgba(15,23,42,0.06)_1px,transparent_1px),linear-gradient(90deg,rgba(15,23,42,0.06)_1px,transparent_1px)]",
119+
)}
120+
/>
103121
{!prefersReducedMotion ? (
104122
<canvas
105123
ref={canvasRef}
106124
aria-hidden="true"
107125
className={cn(
108126
"absolute inset-0 block h-full w-full transition-opacity duration-700",
109-
isLoaded ? "opacity-90" : "opacity-0",
127+
tone === "light" ? "mix-blend-multiply saturate-125" : "",
128+
isLoaded ? (tone === "dark" ? "opacity-90" : "opacity-45") : "opacity-0",
110129
)}
111130
style={{ touchAction: "none" }}
112131
/>
113132
) : null}
114-
<div className="absolute inset-0 bg-[radial-gradient(circle_at_center,transparent_0%,rgba(5,6,8,0.18)_42%,rgba(5,6,8,0.74)_100%)]" />
133+
<div
134+
className={cn(
135+
"absolute inset-0",
136+
tone === "dark"
137+
? "bg-[radial-gradient(circle_at_center,transparent_0%,rgba(5,6,8,0.18)_42%,rgba(5,6,8,0.74)_100%)]"
138+
: "bg-[radial-gradient(circle_at_center,transparent_0%,rgba(250,250,246,0.12)_44%,rgba(250,250,246,0.82)_100%)]",
139+
)}
140+
/>
115141
<div className="relative z-10 h-full pointer-events-none">{children}</div>
116142
</div>
117143
);

0 commit comments

Comments
 (0)