Skip to content

Commit 700adb3

Browse files
committed
improve onboarding intro hero section
1 parent 53aa37a commit 700adb3

6 files changed

Lines changed: 112 additions & 42 deletions

File tree

‎apps/codebility/app/auth/onboarding/_components/HeroWithAboutEffect/BubbleBackground.tsx‎

Lines changed: 53 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export function BubbleBackground() {
6363
size: A.r * 2,
6464
topPct: toPct(A.y - A.r, vh),
6565
leftPct: toPct(A.x - A.r, vw),
66-
hue: hues[0],
66+
hue: hues[0] ?? 285,
6767
depth: 0.75,
6868
floatDur: 12 + Math.random() * 5,
6969
delay: Math.random() * 1.2,
@@ -73,7 +73,7 @@ export function BubbleBackground() {
7373
size: B.r * 2,
7474
topPct: toPct(B.y - B.r, vh),
7575
leftPct: toPct(B.x - B.r, vw),
76-
hue: hues[2],
76+
hue: hues[2] ?? 200,
7777
depth: 1.0,
7878
floatDur: 12 + Math.random() * 5,
7979
delay: Math.random() * 1.2,
@@ -100,7 +100,7 @@ export function BubbleBackground() {
100100
size: d,
101101
topPct: toPct(cy - r, vh),
102102
leftPct: toPct(cx - r, vw),
103-
hue: hues[(3 + smallSpheres.length) % hues.length],
103+
hue: hues[(3 + smallSpheres.length) % hues.length] ?? 255,
104104
depth: 0.9,
105105
floatDur: 7 + Math.random() * 4,
106106
delay: Math.random() * 3,
@@ -229,17 +229,63 @@ export function BubbleBackground() {
229229
<style jsx global>{`
230230
@keyframes bb-float-y {
231231
0% {
232-
transform: translate3d(0, 0, 0);
232+
transform: translate3d(0, 0, 0) scale(1);
233+
}
234+
25% {
235+
transform: translate3d(2px, -8px, 0) scale(1.02);
233236
}
234237
50% {
235-
transform: translate3d(0, -10px, 0);
238+
transform: translate3d(0, -16px, 0) scale(1);
239+
}
240+
75% {
241+
transform: translate3d(-2px, -8px, 0) scale(0.98);
242+
}
243+
100% {
244+
transform: translate3d(0, 0, 0) scale(1);
245+
}
246+
}
247+
248+
@keyframes bb-float-x {
249+
0% {
250+
transform: translateX(0);
251+
}
252+
33% {
253+
transform: translateX(4px);
254+
}
255+
66% {
256+
transform: translateX(-4px);
257+
}
258+
100% {
259+
transform: translateX(0);
260+
}
261+
}
262+
263+
@keyframes bb-pulse {
264+
0% {
265+
opacity: 0.7;
266+
}
267+
50% {
268+
opacity: 1;
269+
}
270+
100% {
271+
opacity: 0.7;
272+
}
273+
}
274+
275+
@keyframes bb-rotate {
276+
0% {
277+
transform: rotate(0deg);
236278
}
237279
100% {
238-
transform: translate3d(0, 0, 0);
280+
transform: rotate(360deg);
239281
}
240282
}
283+
241284
.bb-float {
242-
animation: bb-float-y 9s ease-in-out infinite;
285+
animation: bb-float-y 9s ease-in-out infinite,
286+
bb-float-x 7s ease-in-out infinite,
287+
bb-pulse 6s ease-in-out infinite,
288+
bb-rotate 20s linear infinite;
243289
}
244290
`}</style>
245291
</div>

‎apps/codebility/app/auth/onboarding/_components/HeroWithAboutEffect/FloatingCodeTags.tsx‎

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,32 +35,51 @@ export function FloatingCodeTags() {
3535
}, [mouseX, mouseY]);
3636

3737
return (
38-
<div className="pointer-events-none absolute inset-0 z-10 overflow-hidden">
38+
<div className="pointer-events-none absolute inset-0 z-[1] overflow-hidden">
3939
{codeTags.map((tag, i) => {
40-
const x = useTransform(mouseX, [0, windowSize.width], [-10, 10]);
41-
const y = useTransform(mouseY, [0, windowSize.height], [-10, 10]);
42-
const top = Math.random() * 90 + 5;
43-
const left = Math.random() * 90 + 5;
40+
const x = useTransform(mouseX, [0, windowSize.width], [-8, 8]);
41+
const y = useTransform(mouseY, [0, windowSize.height], [-8, 8]);
42+
43+
// Avoid placing tags in the center area where logo/text is
44+
let top = Math.random() * 90 + 5;
45+
let left = Math.random() * 90 + 5;
46+
47+
// Keep tags away from center area (30%-70% both horizontally and vertically)
48+
if (top > 30 && top < 70 && left > 30 && left < 70) {
49+
// Randomly place in corners instead
50+
const corners = [
51+
{ top: Math.random() * 25 + 5, left: Math.random() * 25 + 5 }, // top-left
52+
{ top: Math.random() * 25 + 5, left: Math.random() * 25 + 75 }, // top-right
53+
{ top: Math.random() * 25 + 75, left: Math.random() * 25 + 5 }, // bottom-left
54+
{ top: Math.random() * 25 + 75, left: Math.random() * 25 + 75 }, // bottom-right
55+
];
56+
const corner = corners[Math.floor(Math.random() * corners.length)];
57+
if (corner) {
58+
top = corner.top;
59+
left = corner.left;
60+
}
61+
}
62+
4463
const delay = Math.random() * 2;
4564

4665
return (
4766
<motion.span
4867
key={tag + i}
49-
className="absolute select-none font-mono text-sm text-white opacity-20 blur-[0.5px]"
68+
className="absolute select-none font-mono text-xs text-white opacity-15 blur-[0.3px] lg:text-sm"
5069
style={{
5170
top: `${top}%`,
5271
left: `${left}%`,
5372
x,
5473
y,
5574
}}
56-
initial={{ opacity: 0, scale: 0.8 }}
75+
initial={{ opacity: 0, scale: 0.6 }}
5776
animate={{
58-
opacity: 0.2,
59-
scale: 1,
60-
y: ["0%", "-5%", "0%"],
77+
opacity: [0.1, 0.2, 0.1],
78+
scale: [0.8, 1, 0.8],
79+
y: ["0%", "-8%", "0%"],
6180
}}
6281
transition={{
63-
duration: 6 + Math.random() * 3,
82+
duration: 8 + Math.random() * 4,
6483
repeat: Infinity,
6584
delay,
6685
ease: "easeInOut",

‎apps/codebility/app/auth/onboarding/_components/HeroWithAboutEffect/HeroSection.tsx‎

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ export default function HeroSection({ h1Ref }: HeroSectionProps) {
1212
<>
1313
<p
1414
id="welcome-text"
15-
className="relative text-[25px] text-[#02e6dd] drop-shadow-[0_0_12px_#02e6dd] lg:-mr-[140px]"
15+
className="relative text-[32px] text-[#02e6dd] drop-shadow-[0_0_16px_#02e6dd] lg:-mr-[140px] lg:text-[40px]"
1616
>
1717
Welcome to
1818
</p>
1919

2020
<h1
2121
id="codebility-h1"
2222
ref={h1Ref}
23-
className="relative z-[999999] -mr-[140px] mt-16 hidden text-[91px] lg:flex"
23+
className="relative z-[999999] -mr-[140px] mt-16 hidden text-[120px] lg:flex 2xl:text-[140px]"
2424
>
2525
<span id="co" className="flex">
2626
{"Co".split("").map((c, i) => (
@@ -47,28 +47,30 @@ export default function HeroSection({ h1Ref }: HeroSectionProps) {
4747
</h1>
4848

4949
<div className="z-[999] mt-10 flex items-center justify-center lg:hidden">
50-
<span className=" -mr-4 text-[clamp(32px,10vw,48px)] text-white">
50+
<span className="text-[clamp(40px,12vw,60px)] text-white leading-none">
5151
Co
5252
</span>
53-
<Image
54-
src="/assets/images/onboarding/code_logo.svg"
55-
alt="d"
56-
width={66}
57-
height={66}
58-
className="object-contain"
59-
/>
60-
<span className="-ml-4 text-[clamp(32px,10vw,48px)] text-white">
53+
<div className="mx-1 flex items-center justify-center">
54+
<Image
55+
src="/assets/images/onboarding/code_logo.svg"
56+
alt="d"
57+
width={66}
58+
height={66}
59+
className="object-contain translate-y-[-2px]"
60+
/>
61+
</div>
62+
<span className="text-[clamp(40px,12vw,60px)] text-white leading-none">
6163
ebility
6264
</span>
6365
</div>
6466

6567
{/* Grouped h2 and button centered between h1 and bottom */}
66-
<div className="pointer-events-none inset-0 mt-10 flex flex-col items-center justify-between lg:absolute lg:mt-0">
67-
<div className="hidden pt-[260px] lg:block" />
68-
<div className="pointer-events-auto z-[999] flex flex-col items-center space-y-10 lg:-mr-[140px]">
68+
<div className="pointer-events-none inset-0 mt-12 flex flex-col items-center justify-between lg:absolute lg:mt-0">
69+
<div className="hidden pt-[300px] lg:block" />
70+
<div className="pointer-events-auto z-[999] flex flex-col items-center space-y-12 lg:-mr-[140px]">
6971
<h2
7072
id="codebility-h2"
71-
className="z-10 text-center text-[clamp(32px,5vw,64px)] text-white drop-shadow-[0_0_1px_#fff] 2xl:text-[64px]"
73+
className="z-10 text-center text-[clamp(36px,6vw,80px)] font-medium text-white drop-shadow-[0_0_2px_#fff] 2xl:text-[80px]"
7274
>
7375
Everyone has the ability to code
7476
</h2>
@@ -83,7 +85,7 @@ export default function HeroSection({ h1Ref }: HeroSectionProps) {
8385
className="
8486
group relative inline-flex items-center justify-center overflow-hidden
8587
rounded-full bg-gradient-to-r from-cyan-500 to-fuchsia-500
86-
px-8 py-3 text-base font-semibold text-white
88+
px-10 py-4 text-lg font-semibold text-white
8789
shadow-[0_12px_40px_-12px_rgba(168,85,247,0.45)]
8890
transition-all duration-300
8991
hover:brightness-[1.05]

‎apps/codebility/app/auth/onboarding/_components/HeroWithAboutEffect/StickyLogo.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default function StickyLogo({ logoRef, isVisible }: StickyLogoProps) {
1212
return (
1313
<div
1414
ref={logoRef}
15-
className={`fixed left-1/2 top-[195px] z-[9999] hidden aspect-square w-[120px] -translate-x-1/2 rounded-full shadow-xl transition-opacity duration-300 will-change-transform lg:block ${
15+
className={`fixed left-[calc(50%-30px)] top-[260px] z-[9999] hidden aspect-square w-[120px] -translate-x-1/2 rounded-full shadow-xl transition-opacity duration-300 will-change-transform lg:block ${
1616
isVisible || !isDesktop ? "" : "pointer-events-none opacity-0"
1717
}`}
1818
style={{

‎apps/codebility/app/auth/onboarding/_components/HeroWithAboutEffect/index.tsx‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// HeroWithAboutEffect/index.tsx (patched)
1+
// HeroWithAboutEffect/index.tsx
22

33
"use client";
44

@@ -40,14 +40,16 @@ export default function HeroWithAboutEffect() {
4040
ref={heroRef}
4141
className="primary-gradient relative flex items-center justify-center px-10 py-10 text-white lg:h-screen lg:min-h-screen"
4242
>
43-
<div className="relative mx-auto flex w-full flex-col items-center justify-start overflow-hidden rounded-3xl bg-gray-950 p-10 lg:h-[calc(100vh-80px)]">
43+
<div className="relative mx-auto flex w-full flex-col items-center justify-start overflow-hidden rounded-3xl bg-gradient-to-br from-gray-900 via-gray-950 to-black p-10 shadow-2xl lg:h-[calc(100vh-80px)]">
4444
<BubbleBackground />
4545
<LottieBackground />
46+
<FloatingCodeTags />
4647
{/* soft decor glows for dark motif */}
4748
<div className="pointer-events-none absolute inset-0">
48-
<div className="absolute -left-24 -top-24 h-80 w-80 rounded-full bg-cyan-400/10 blur-3xl" />
49-
<div className="absolute -bottom-24 -right-24 h-96 w-96 rounded-full bg-fuchsia-500/10 blur-3xl" />
50-
<div className="absolute inset-0 bg-[radial-gradient(1200px_600px_at_85%_10%,rgba(99,102,241,0.10),transparent_60%),radial-gradient(1100px_560px_at_15%_90%,rgba(124,58,237,0.10),transparent_60%)]" />
49+
<div className="absolute -left-32 -top-32 h-96 w-96 rounded-full bg-cyan-400/15 blur-3xl" />
50+
<div className="absolute -bottom-32 -right-32 h-[28rem] w-[28rem] rounded-full bg-fuchsia-500/15 blur-3xl" />
51+
<div className="absolute left-1/2 top-1/4 h-64 w-64 -translate-x-1/2 rounded-full bg-violet-500/10 blur-3xl" />
52+
<div className="absolute inset-0 bg-[radial-gradient(1400px_700px_at_85%_10%,rgba(99,102,241,0.12),transparent_60%),radial-gradient(1200px_600px_at_15%_90%,rgba(124,58,237,0.12),transparent_60%)]" />
5153
</div>
5254
<HeroSection h1Ref={h1Ref} />
5355
</div>

‎apps/codebility/app/globals.css‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,9 @@
173173
.primary-gradient {
174174
background: linear-gradient(
175175
129deg,
176-
var(--violet-color) 0%,
177-
var(--teal-color) 100%
176+
#0a0b1e 0%,
177+
#1a0b2e 35%,
178+
#2d1b3d 100%
178179
);
179180
}
180181

0 commit comments

Comments
 (0)