File size: 16,292 Bytes
86fbe37
 
02ebe36
86fbe37
 
 
 
 
 
 
 
 
a5cb824
a574801
d9e7e99
 
 
 
7788f73
86fbe37
6ec47a7
86fbe37
02ebe36
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
86fbe37
 
6ec47a7
 
 
 
86fbe37
 
 
 
 
a5cb824
 
 
 
86fbe37
a5cb824
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7788f73
 
 
 
 
 
 
 
 
 
 
 
 
 
02ebe36
 
 
 
 
 
 
 
 
7788f73
a5cb824
d9e7e99
 
 
 
 
7788f73
a574801
a5cb824
 
a574801
 
 
 
a5cb824
a574801
 
 
 
7788f73
 
 
8325f82
6ec47a7
8325f82
7788f73
 
8325f82
86fbe37
7788f73
 
d9e7e99
 
 
 
 
7788f73
86fbe37
 
 
 
 
251578d
 
 
86fbe37
 
 
 
 
8325f82
86fbe37
a5cb824
4a0ff1a
a5cb824
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d9e7e99
 
86fbe37
02ebe36
 
 
 
6ec47a7
 
02ebe36
 
 
 
 
 
251578d
02ebe36
 
 
 
251578d
 
 
02ebe36
 
a5cb824
02ebe36
 
 
 
 
251578d
 
 
02ebe36
 
 
 
 
251578d
 
 
02ebe36
 
a5cb824
d9e7e99
a5cb824
02ebe36
 
 
 
 
 
 
 
 
 
251578d
02ebe36
 
 
 
251578d
 
 
02ebe36
 
 
 
 
 
 
 
 
251578d
 
02ebe36
 
 
 
 
251578d
 
02ebe36
 
 
 
a5cb824
86fbe37
 
7788f73
a5cb824
6ec47a7
a5cb824
 
 
 
 
 
 
 
 
4b3af84
7788f73
a5cb824
 
 
 
02ebe36
a5cb824
 
 
 
4b3af84
7788f73
 
 
86fbe37
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
"use client";

import { useRef, useLayoutEffect, useEffect, useState, useCallback } from "react";
import gsap from "gsap";
import { ScrollTrigger } from "gsap/ScrollTrigger";

if (typeof window !== "undefined") {
    gsap.registerPlugin(ScrollTrigger);
}

export default function AboutSection() {
    const sectionRef = useRef<HTMLElement>(null);
    const clippedContentRef = useRef<HTMLDivElement>(null);
    const headerWrapperRef = useRef<HTMLDivElement>(null);
    const heroLine1Ref = useRef<HTMLDivElement>(null);
    const heroLine2Ref = useRef<HTMLDivElement>(null);
    const storyBlock1Ref = useRef<HTMLDivElement>(null);
    const storyBlock2Ref = useRef<HTMLDivElement>(null);
    const stripsWrapperRef = useRef<HTMLDivElement>(null);
    const [mounted, setMounted] = useState(false);
    const [isMobile, setIsMobile] = useState(false);

    // --- Hover reveal circle ---
    const revealAreaRef = useRef<HTMLDivElement>(null);
    const revealRef = useRef<HTMLDivElement>(null);
    const circlePos = useRef({ x: -300, y: -300 });
    const currentPos = useRef({ x: -300, y: -300 });
    const isHovering = useRef(false);
    const circleSize = 300;

    const handleMouseMove = useCallback((e: React.MouseEvent<HTMLDivElement>) => {
        const rect = revealAreaRef.current?.getBoundingClientRect();
        if (!rect) return;
        circlePos.current = {
            x: e.clientX - rect.left,
            y: e.clientY - rect.top,
        };
        isHovering.current = true;
    }, []);

    const handleMouseLeave = useCallback(() => {
        isHovering.current = false;
    }, []);

    // Smooth animation loop for the reveal circle
    useEffect(() => {
        let animId: number;
        const animate = () => {
            const reveal = revealRef.current;
            if (!reveal) { animId = requestAnimationFrame(animate); return; }

            currentPos.current.x += (circlePos.current.x - currentPos.current.x) * 0.12;
            currentPos.current.y += (circlePos.current.y - currentPos.current.y) * 0.12;

            const x = currentPos.current.x;
            const y = currentPos.current.y;
            const r = isHovering.current ? circleSize / 2 : 0;

            reveal.style.clipPath = `circle(${r}px at ${x}px ${y}px)`;
            animId = requestAnimationFrame(animate);
        };
        animId = requestAnimationFrame(animate);
        return () => cancelAnimationFrame(animId);
    }, []);

    useEffect(() => {
        setMounted(true);
        const checkMobile = () => setIsMobile(window.innerWidth < 768);
        checkMobile();
        window.addEventListener('resize', checkMobile);
        return () => window.removeEventListener('resize', checkMobile);
    }, []);

    useLayoutEffect(() => {
        if (!mounted) return;

        const isMobile = window.innerWidth < 768;
        const insetX = isMobile ? "6%" : "14%";
        const radius = isMobile ? "16px" : "28px";

        const ctx = gsap.context(() => {
            gsap.fromTo(
                clippedContentRef.current,
                {
                    clipPath: `inset(0 ${insetX} 0 ${insetX} round ${radius})`,
                },
                {
                    clipPath: "inset(0 0% 0 0% round 0px)",
                    ease: "power2.inOut",
                    scrollTrigger: {
                        trigger: sectionRef.current,
                        start: "top 85%",
                        end: "top 5%",
                        scrub: 0.6,
                    },
                }
            );

            gsap.to(".about-header-marquee", {
                xPercent: -50,
                repeat: -1,
                duration: 20,
                ease: "linear",
            });

            gsap.to(".about-strip-1-marquee", {
                xPercent: -50,
                repeat: -1,
                duration: 25,
                ease: "linear",
            });

            gsap.fromTo(".about-strip-2-marquee",
                { xPercent: -50 },
                {
                    xPercent: 0,
                    repeat: -1,
                    duration: 25,
                    ease: "linear",
                }
            );

            gsap.set(headerWrapperRef.current, { opacity: 0, y: 30 });
            gsap.set(heroLine1Ref.current, { opacity: 0, y: 100, filter: "blur(10px)" });
            gsap.set(heroLine2Ref.current, { opacity: 0, y: 100, filter: "blur(10px)" });
            gsap.set(storyBlock1Ref.current, { opacity: 0, x: -100, filter: "blur(8px)" });
            gsap.set(storyBlock2Ref.current, { opacity: 0, x: 100, filter: "blur(8px)" });
            gsap.set(stripsWrapperRef.current, { opacity: 0, y: 60 });

            gsap.to(headerWrapperRef.current, {
                opacity: 1,
                y: 0,
                ease: "power2.out",
                scrollTrigger: {
                    trigger: sectionRef.current,
                    start: "top 90%",
                    end: "top 50%",
                    scrub: 0.3,
                },
            });

            const tl = gsap.timeline({
                scrollTrigger: {
                    trigger: sectionRef.current,
                    start: "top top",
                    end: isMobile ? "+=900" : "+=1500",
                    scrub: 1,
                    pin: true,
                    anticipatePin: 1,
                    pinSpacing: true,
                },
            });

            tl.to(heroLine1Ref.current, { opacity: 1, y: 0, filter: "blur(0px)", duration: 0.25, ease: "power3.out" }, 0);
            tl.to(heroLine2Ref.current, { opacity: 1, y: 0, filter: "blur(0px)", duration: 0.25, ease: "power3.out" }, 0.15);
            tl.to(storyBlock1Ref.current, { opacity: 1, x: 0, filter: "blur(0px)", duration: 0.25, ease: "power3.out" }, 0.35);
            tl.to(storyBlock2Ref.current, { opacity: 1, x: 0, filter: "blur(0px)", duration: 0.25, ease: "power3.out" }, 0.50);
            tl.to(stripsWrapperRef.current, { opacity: 1, y: 0, duration: 0.25, ease: "power3.out" }, 0.70);

        }, sectionRef);

        return () => ctx.revert();
    }, [mounted]);

    const marqueeText = "DATA SCIENTIST ✦ PYTHON BACKEND DEVELOPER ✦ AI ENTHUSIAST ✦ PROBLEM SOLVER ✦ ";
    const strip1Text = "β˜… Driven by Curiosity, Powered by Data β˜… Machine Learning Solutions β˜… Predictive Analytics β˜… AI-Driven Insights β˜… ";
    const strip2Text = "β˜… Data Quality β˜… Model Accuracy β˜… Scalable Pipelines β˜… Statistical Analysis β˜… Deep Learning β˜… Python Engineering β˜… ";

    return (
        <section
            id="about"
            ref={sectionRef}
            className="relative bg-[#050505] overflow-visible"
        >
            {/* Clipped content β€” clip-path creates the expanding box effect */}
            <div
                ref={clippedContentRef}
                className="relative"
                style={{
                    background: "linear-gradient(180deg, #0c0c0c 0%, #0a0a0a 50%, #080808 100%)",
                }}
            >
                {/* Subtle top edge glow inside the clipped box */}
                <div
                    className="absolute top-0 left-[10%] right-[10%] h-px pointer-events-none z-20"
                    style={{
                        background: "linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.12) 50%, transparent 100%)",
                    }}
                />

                {/* Content */}
                <div className="relative z-10 min-h-screen pt-16">
                    {/* Large Header Marquee Banner */}
                    <div ref={headerWrapperRef} className="py-3 md:py-4 overflow-hidden border-b border-white/5">
                        <div className="about-header-marquee flex whitespace-nowrap" style={{ width: "200%" }}>
                            <span className="text-2xl md:text-4xl lg:text-6xl font-black tracking-tight text-white/90 uppercase">
                                {marqueeText.repeat(6)}
                            </span>
                        </div>
                    </div>

                    {/* Hero + Story area β€” this is where the reveal mask lives */}
                    <div
                        ref={revealAreaRef}
                        className="relative"
                        onMouseMove={isMobile ? undefined : handleMouseMove}
                        onMouseLeave={isMobile ? undefined : handleMouseLeave}
                    >
                        {/* Normal layer (white text on dark bg) */}
                        <div className="px-6 md:px-12 lg:px-20 xl:px-32 py-8 md:py-12">
                            <div className="mb-16 md:mb-24">
                                <div ref={heroLine1Ref}>
                                    <h2 className="text-4xl sm:text-5xl md:text-6xl lg:text-7xl xl:text-8xl font-extralight text-white tracking-tighter leading-[0.95]">
                                        I extract insights that
                                    </h2>
                                </div>
                                <div ref={heroLine2Ref}>
                                    <h2 className="text-4xl sm:text-5xl md:text-6xl lg:text-7xl xl:text-8xl tracking-tighter leading-[0.95]">
                                        <span className="font-black text-white">drive</span>
                                        <span className="font-extralight text-white/50"> real </span>
                                        <span className="font-black text-transparent bg-clip-text bg-gradient-to-r from-white via-neutral-300 to-white/70">decisions</span>
                                    </h2>
                                </div>
                            </div>

                            <div className="grid md:grid-cols-2 gap-8 md:gap-16 mb-16 md:mb-24">
                                <div ref={storyBlock1Ref} className="space-y-4">
                                    <p className="text-white/30 text-xs uppercase tracking-[0.3em] font-medium">My Journey</p>
                                    <p className="text-lg md:text-xl lg:text-2xl text-white/80 font-light leading-relaxed">
                                        Started as a <span className="text-white font-medium">curious teenager</span> exploring datasets,
                                        I&apos;ve evolved into a data scientist who obsesses over every feature
                                        and every decimal of model accuracy.
                                    </p>
                                </div>
                                <div ref={storyBlock2Ref} className="space-y-4">
                                    <p className="text-white/30 text-xs uppercase tracking-[0.3em] font-medium">My Approach</p>
                                    <p className="text-lg md:text-xl lg:text-2xl text-white/80 font-light leading-relaxed">
                                        I believe the best data solutions are the ones that
                                        <span className="text-white font-medium"> speak for themselves</span>β€”clear insights,
                                        actionable results, and decisions backed by evidence.
                                    </p>
                                </div>
                            </div>
                        </div>

                        {/* Reveal layer (black text on white bg) β€” different alternate text */}
                        <div
                            ref={revealRef}
                            className="absolute inset-0 z-30 bg-white pointer-events-none"
                            style={{ clipPath: "circle(0px at -300px -300px)" }}
                        >
                            <div className="px-6 md:px-12 lg:px-20 xl:px-32 py-8 md:py-12">
                                <div className="mb-16 md:mb-24">
                                    <div>
                                        <h2 className="text-4xl sm:text-5xl md:text-6xl lg:text-7xl xl:text-8xl font-extralight text-black tracking-tighter leading-[0.95]">
                                            I build models that
                                        </h2>
                                    </div>
                                    <div>
                                        <h2 className="text-4xl sm:text-5xl md:text-6xl lg:text-7xl xl:text-8xl tracking-tighter leading-[0.95]">
                                            <span className="font-black text-black">transform</span>
                                            <span className="font-extralight text-black/50"> raw </span>
                                            <span className="font-black text-transparent bg-clip-text bg-gradient-to-r from-black via-neutral-600 to-black/70">data</span>
                                        </h2>
                                    </div>
                                </div>

                                <div className="grid md:grid-cols-2 gap-8 md:gap-16 mb-16 md:mb-24">
                                    <div className="space-y-4">
                                        <p className="text-black/30 text-xs uppercase tracking-[0.3em] font-medium">The Spark</p>
                                        <p className="text-lg md:text-xl lg:text-2xl text-black/80 font-light leading-relaxed">
                                            What started as <span className="text-black font-medium">late-night experiments</span> turned into a lifelong
                                            obsession with uncovering patterns, building models, and
                                            letting data tell its story.
                                        </p>
                                    </div>
                                    <div className="space-y-4">
                                        <p className="text-black/30 text-xs uppercase tracking-[0.3em] font-medium">The Philosophy</p>
                                        <p className="text-lg md:text-xl lg:text-2xl text-black/80 font-light leading-relaxed">
                                            Great analysis is <span className="text-black font-medium">invisible</span>β€”it removes noise,
                                            reveals clarity, and makes complex data feel
                                            wonderfully simple.
                                        </p>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                    {/* Diagonal Crossing Strips */}
                    <div ref={stripsWrapperRef} className="relative h-20 md:h-32">
                        <div
                            className="absolute w-[300vw] left-[-100vw] bg-white py-5 md:py-6 shadow-2xl z-10"
                            style={{ transform: "rotate(-4deg)", top: "5%" }}
                        >
                            <div className="about-strip-1-marquee whitespace-nowrap" style={{ display: "inline-block", width: "200%" }}>
                                <span className="text-xl md:text-2xl lg:text-3xl font-black text-[#050505] tracking-wide inline-block uppercase">
                                    {strip1Text.repeat(15)}
                                </span>
                            </div>
                        </div>

                        <div
                            className="absolute w-[300vw] left-[-100vw] bg-[#151515] py-5 md:py-6 shadow-2xl border-y border-white/5 z-20"
                            style={{ transform: "rotate(4deg)", top: "50%" }}
                        >
                            <div className="about-strip-2-marquee whitespace-nowrap" style={{ display: "inline-block", width: "200%" }}>
                                <span className="text-xl md:text-2xl lg:text-3xl font-black text-white/90 tracking-wide inline-block uppercase">
                                    {strip2Text.repeat(15)}
                                </span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
    );
}