Skip to content

Commit 745069c

Browse files
lwinmoepaingclaude
andcommitted
⚡ perf: reduce heavy animations for smoother mobile Safari performance
Trim floating orbs 3→2, particles 8→4, icons 5→3. Remove rotateY 3D transforms and per-character staggers (use per-word). Convert animated blur filters to static CSS. Remove cursor-tracking spotlights from PlatformSection cards (12 motion values). Remove 36+ infinite animation loops while preserving visual character. Fix Safari iOS overflow-x-hidden on html element. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b91a8ae commit 745069c

5 files changed

Lines changed: 56 additions & 192 deletions

File tree

src/app/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export default function RootLayout({
4040
"font-body min-h-screen text-zinc-200 scroll-smooth overflow-x-hidden"
4141
);
4242
return (
43-
<html lang="en" data-theme="obsidian">
43+
<html lang="en" data-theme="obsidian" className="overflow-x-hidden">
4444
<head>
4545
<Favicons />
4646
</head>

src/components/MSE/HomeSection.tsx

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,16 @@ const FloatingOrb = ({
5151
duration: number;
5252
}) => (
5353
<motion.div
54-
className="absolute rounded-full pointer-events-none"
54+
className="absolute rounded-full pointer-events-none blur-[40px]"
5555
style={{
5656
width: size,
5757
height: size,
5858
left: x,
5959
top: y,
6060
background: `radial-gradient(circle, ${color} 0%, transparent 70%)`,
61-
filter: "blur(40px)",
6261
}}
6362
animate={{
6463
y: [0, -20, 10, -15, 0],
65-
x: [0, 10, -8, 12, 0],
66-
scale: [1, 1.15, 0.95, 1.1, 1],
6764
opacity: [0.3, 0.5, 0.25, 0.45, 0.3],
6865
}}
6966
transition={{
@@ -196,11 +193,11 @@ const HeroWord = ({
196193
"bg-gradient-to-r bg-clip-text text-transparent leading-[1.1]",
197194
gradient
198195
)}
199-
initial={{ y: 80, opacity: 0, filter: "blur(8px)" }}
196+
initial={{ y: 80, opacity: 0, filter: "blur(4px)" }}
200197
animate={
201198
isInView
202199
? { y: 0, opacity: 1, filter: "blur(0px)" }
203-
: { y: 80, opacity: 0, filter: "blur(8px)" }
200+
: { y: 80, opacity: 0, filter: "blur(4px)" }
204201
}
205202
transition={{
206203
duration: 0.8,
@@ -445,23 +442,13 @@ const HomeSection = () => {
445442
delay={1}
446443
duration={10}
447444
/>
448-
<FloatingOrb
449-
size={180}
450-
color="#fb7185"
451-
x="85%"
452-
y="5%"
453-
delay={2}
454-
duration={7}
455-
/>
456445

457446
<PrismLine direction="horizontal" delay={0.5} />
458447
<PrismLine direction="vertical" delay={0.7} />
459448

460449
<FloatingIcon delay={1} x="12%" y="18%" index={0} />
461450
<FloatingIcon delay={2.5} x="82%" y="32%" index={1} />
462451
<FloatingIcon delay={4} x="48%" y="78%" index={2} />
463-
<FloatingIcon delay={1.8} x="68%" y="12%" index={3} />
464-
<FloatingIcon delay={3.2} x="22%" y="62%" index={4} />
465452

466453
{/* Main content */}
467454
<div className="relative z-10 flex flex-col gap-12 lg:gap-16">

src/components/MSE/LanguageIconSection.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ const IconNode = ({
2424

2525
return (
2626
<motion.div
27-
initial={{ opacity: 0, y: 24, scale: 0.85, filter: "blur(6px)" }}
27+
initial={{ opacity: 0, y: 24, scale: 0.85 }}
2828
animate={
2929
isInView
30-
? { opacity: 1, y: 0, scale: 1, filter: "blur(0px)" }
30+
? { opacity: 1, y: 0, scale: 1 }
3131
: {}
3232
}
3333
transition={{
@@ -91,15 +91,13 @@ const IconNode = ({
9191
/>
9292
</div>
9393

94-
{/* Top-right accent spark */}
95-
<motion.div
94+
{/* Top-right accent spark (CSS-only, no infinite JS animation) */}
95+
<div
9696
className="absolute -top-1 -right-1 w-1.5 h-1.5 rounded-full opacity-0 group-hover:opacity-100 transition-opacity duration-300"
9797
style={{
9898
background: color,
9999
boxShadow: `0 0 6px ${color}`,
100100
}}
101-
animate={{ scale: [1, 1.5, 1] }}
102-
transition={{ duration: 1.5, repeat: Infinity, ease: "easeInOut" }}
103101
/>
104102
</div>
105103

src/components/MSE/MmsweTypoSection.tsx

Lines changed: 22 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,9 @@ const letterConfig = [
1919

2020
const particleData = [
2121
{ color: "#22d3ee", size: 3, x: "8%", y: "15%", delay: 0 },
22-
{ color: "#a78bfa", size: 2.5, x: "22%", y: "82%", delay: 0.8 },
23-
{ color: "#fb7185", size: 3.5, x: "52%", y: "8%", delay: 1.6 },
24-
{ color: "#fbbf24", size: 2, x: "78%", y: "72%", delay: 0.4 },
25-
{ color: "#22d3ee", size: 3, x: "92%", y: "25%", delay: 1.2 },
26-
{ color: "#a78bfa", size: 2, x: "38%", y: "88%", delay: 2.0 },
27-
{ color: "#fb7185", size: 2.5, x: "68%", y: "12%", delay: 0.6 },
28-
{ color: "#fbbf24", size: 2, x: "15%", y: "55%", delay: 1.4 },
22+
{ color: "#a78bfa", size: 2.5, x: "52%", y: "8%", delay: 1.6 },
23+
{ color: "#fb7185", size: 2, x: "78%", y: "72%", delay: 0.4 },
24+
{ color: "#fbbf24", size: 2, x: "38%", y: "88%", delay: 2.0 },
2925
];
3026

3127
const FloatingParticle = ({
@@ -85,16 +81,14 @@ const PrismLetter = ({
8581
opacity: 0,
8682
y: 80,
8783
scale: 0.3,
88-
rotateY: 90,
89-
filter: "blur(16px)",
84+
filter: "blur(6px)",
9085
}}
9186
animate={
9287
isInView
9388
? {
9489
opacity: 1,
9590
y: 0,
9691
scale: 1,
97-
rotateY: 0,
9892
filter: "blur(0px)",
9993
}
10094
: {}
@@ -159,21 +153,6 @@ const PrismLetter = ({
159153
}}
160154
/>
161155

162-
{/* Bottom-left accent spark */}
163-
<motion.div
164-
className="absolute -bottom-1 left-1 w-1.5 h-1.5 rounded-full opacity-0 group-hover:opacity-100 transition-opacity duration-300"
165-
style={{
166-
background: color,
167-
boxShadow: `0 0 6px ${color}`,
168-
}}
169-
animate={{ scale: [1, 1.3, 1] }}
170-
transition={{
171-
duration: 1.8,
172-
repeat: Infinity,
173-
ease: "easeInOut",
174-
}}
175-
/>
176-
177156
{/* Hover edge glow */}
178157
<div
179158
className="absolute bottom-1 left-1/4 right-1/4 h-[2px] opacity-0 group-hover:opacity-100 transition-opacity duration-300 rounded-full"
@@ -221,28 +200,26 @@ const subtitleText = "Myanmar Software Engineers";
221200

222201
const SubtitleReveal = ({ isInView }: { isInView: boolean }) => (
223202
<motion.div
224-
className="flex justify-center mt-5 overflow-hidden"
203+
className="flex justify-center mt-5 overflow-hidden gap-2"
225204
initial={{ opacity: 0 }}
226205
animate={isInView ? { opacity: 1 } : {}}
227206
transition={{ delay: 1.2 }}
228207
>
229-
<div className="flex">
230-
{subtitleText.split("").map((char, i) => (
231-
<motion.span
232-
key={i}
233-
className="font-mono text-[10px] md:text-xs tracking-[0.3em] uppercase text-zinc-600 inline-block"
234-
initial={{ opacity: 0, y: 12 }}
235-
animate={isInView ? { opacity: 0.5, y: 0 } : {}}
236-
transition={{
237-
duration: 0.4,
238-
delay: 1.3 + i * 0.025,
239-
ease: "easeOut",
240-
}}
241-
>
242-
{char === " " ? "\u00A0" : char}
243-
</motion.span>
244-
))}
245-
</div>
208+
{subtitleText.split(" ").map((word, i) => (
209+
<motion.span
210+
key={i}
211+
className="font-mono text-[10px] md:text-xs tracking-[0.3em] uppercase text-zinc-600 inline-block"
212+
initial={{ opacity: 0, y: 12 }}
213+
animate={isInView ? { opacity: 0.5, y: 0 } : {}}
214+
transition={{
215+
duration: 0.4,
216+
delay: 1.3 + i * 0.1,
217+
ease: "easeOut",
218+
}}
219+
>
220+
{word}
221+
</motion.span>
222+
))}
246223
</motion.div>
247224
);
248225

@@ -261,11 +238,8 @@ const MmsweTypoSection = () => {
261238
<FloatingParticle key={i} {...p} />
262239
))}
263240

264-
{/* Letter row with 3D perspective */}
265-
<div
266-
className="flex items-baseline justify-center gap-1 md:gap-3"
267-
style={{ perspective: "1200px" }}
268-
>
241+
{/* Letter row */}
242+
<div className="flex items-baseline justify-center gap-1 md:gap-3">
269243
{letterConfig.map(({ char, color }, index) => (
270244
<PrismLetter
271245
key={index}

0 commit comments

Comments
 (0)