Skip to content

Commit 885a223

Browse files
fix global loader and bug fixes
1 parent 427b7ea commit 885a223

File tree

5 files changed

+49
-41
lines changed

5 files changed

+49
-41
lines changed

src/app/animations/FlipOnScroll.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export default function FlipOnScroll({ children, delay = 0.5 }) {
1919
opacity: 1,
2020
duration: 1.5,
2121
delay,
22+
stagger: 0.1,
2223
ease: "back.out(1.7)",
2324
transformOrigin: "center center", // sikka center se ghoome
2425
scrollTrigger: {

src/components/GlobalLoader.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ export default function GlobalLoader() {
8080
const pRect = p.getBoundingClientRect();
8181
const distance = pRect.left - hRect.right; // gap between H and P
8282

83-
const moveFraction = 0.2; // move 20% toward each other
83+
const moveFraction = 0.2; // move 40% toward each other
8484

8585
tl.to(
8686
h,
8787
{
88-
x: distance * (moveFraction + 0.6), // H moves toward P
88+
x: distance * (moveFraction + 0.7), // H moves toward P
8989
duration: 0.6,
9090
ease: "power4.out",
9191
},
@@ -95,7 +95,7 @@ export default function GlobalLoader() {
9595
tl.to(
9696
p,
9797
{
98-
x: -distance * moveFraction, // P moves toward H
98+
x: -distance * 0.1, // P moves toward H
9999
duration: 0.6,
100100
ease: "power4.out",
101101
},
@@ -135,7 +135,7 @@ export default function GlobalLoader() {
135135
>
136136
<h1
137137
id="loader"
138-
className="font-whyte text-text text-center font-bold text-7xl md:text-9xl tracking-wide relative"
138+
className="font-whyte text-text text-center text-[12vw] text-nowrap font-bold tracking-wide relative"
139139
></h1>
140140
</div>
141141
);

src/components/Header.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export default function Header() {
2828
opacity: 0, // fade in
2929
duration: 1.2, // smooth duration
3030
ease: "power3.out",
31-
delay: 2, // 1s delay
31+
delay: 2.5, // 1s delay
3232
});
3333
}
3434
initMagneticHover();

src/sections/Hero.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ const Hero = () => {
2929
className="text-text-muted"
3030
/>
3131
<div className="py-10 lg:py-12 xl:py-16 text-center lg:text-start">
32-
<FadeUpText delay={0.5}>
32+
<FadeUpText delay={1}>
3333
<h1 className="leading-tight text-[clamp(1.6rem,6vw,3.5rem)] lg:text-[clamp(1.5rem,6vw,3vw)] font-extrabold box-border uppercase font-whyte text-text-heading text-nowrap">
3434
<span className="inline-flex flex-nowrap items-center">
3535
Cra
36-
<FlipOnScroll delay={2}>
36+
<FlipOnScroll delay={2.5}>
3737
<svg
3838
width="28"
3939
height="28"
@@ -75,7 +75,7 @@ const Hero = () => {
7575
</em>{" "}
7676
<span className="inline-flex flex-nowrap items-center">
7777
E
78-
<FlipOnScroll delay={2}>
78+
<FlipOnScroll delay={2.5}>
7979
<IconBrandVscode
8080
stroke={1}
8181
className="drop-shadow-lg mb-[4%] md:mb-[2%] xl:mb-[4%] text-blue-500 w-6 sm:w-10 xl:w-12 h-6 sm:h-10 md:h-10 xl:h-12"

src/sections/TechStack.jsx

Lines changed: 40 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import React, { useEffect, useRef, useState } from "react";
33
import Image from "next/image";
44
import gsap from "gsap";
55
import FadeUpTextScroll from "@/app/animations/FadeUpTextScroll";
6+
import FlipOnScroll from "@/app/animations/FlipOnScroll";
67

78
const techStack = [
89
{
@@ -129,19 +130,21 @@ const TechStack = () => {
129130
onMouseEnter={() => setActive(tech.id)}
130131
className="h-60 flex flex-1 items-center justify-center p-6 border-r border-b border-t-0 border-gray-300 transition first:border-l-0 last:border-r-0"
131132
>
132-
<Image
133-
src={tech.icon}
134-
alt={tech.id}
135-
width={60}
136-
height={60}
137-
quality={50}
138-
loading="lazy"
139-
placeholder="blur"
140-
blurDataURL="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."
141-
className={`h-18 w-auto object-contain ${
142-
active === tech.id ? "filter-invert" : "svg-invert"
143-
}`}
144-
/>
133+
<FlipOnScroll>
134+
<Image
135+
src={tech.icon}
136+
alt={tech.id}
137+
width={60}
138+
height={60}
139+
quality={50}
140+
loading="lazy"
141+
placeholder="blur"
142+
blurDataURL="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."
143+
className={`h-18 w-auto object-contain ${
144+
active === tech.id ? "filter-invert" : "svg-invert"
145+
}`}
146+
/>
147+
</FlipOnScroll>
145148
</a>
146149
))}
147150
</div>
@@ -158,17 +161,19 @@ const TechStack = () => {
158161
onMouseEnter={() => setActive(tech.id)}
159162
className="h-50 flex flex-1 items-center justify-center p-6 border-r border-gray-300 transition first:border-l-0 last:border-r-0"
160163
>
161-
<Image
162-
src={tech.icon}
163-
alt={tech.id}
164-
width={60}
165-
height={60}
166-
quality={50}
167-
loading="lazy"
168-
className={`h-12 w-auto object-contain ${
169-
active === tech.id ? "filter-invert" : "svg-invert"
170-
}`}
171-
/>
164+
<FlipOnScroll>
165+
<Image
166+
src={tech.icon}
167+
alt={tech.id}
168+
width={60}
169+
height={60}
170+
quality={50}
171+
loading="lazy"
172+
className={`h-12 w-auto object-contain ${
173+
active === tech.id ? "filter-invert" : "svg-invert"
174+
}`}
175+
/>
176+
</FlipOnScroll>
172177
</a>
173178
))}
174179
</div>
@@ -186,15 +191,17 @@ const TechStack = () => {
186191
onMouseEnter={() => setActive(tech.id)}
187192
className="h-30 flex flex-1 items-center justify-center p-4 border-r border-b border-gray-300 transition odd:border-l-0 even:border-r-0 last:border-r-0"
188193
>
189-
<Image
190-
src={tech.icon}
191-
alt={tech.id}
192-
width={50}
193-
height={50}
194-
quality={50}
195-
loading="lazy"
196-
className={`h-12 w-auto object-contain svg-invert`}
197-
/>
194+
<FlipOnScroll>
195+
<Image
196+
src={tech.icon}
197+
alt={tech.id}
198+
width={50}
199+
height={50}
200+
quality={50}
201+
loading="lazy"
202+
className={`h-12 w-auto object-contain svg-invert`}
203+
/>
204+
</FlipOnScroll>
198205
</a>
199206
))}
200207
</div>

0 commit comments

Comments
 (0)