Skip to content

Commit de0b81b

Browse files
lhcapscursoragent
andcommitted
perf: remove R3F from hero, rebuild with CSS/SVG-only orbital composition
Performance reset — no more WebGL in the hero. - Deleted CoreHaloCanvas.tsx and CoreHalo.tsx (all Three.js/R3F removed from hero) - Deleted src/components/three/ and src/components/sections/Hero3DSection.tsx (dead code) - Removed 3 large npm packages: @react-three/fiber, @react-three/drei, three (partial) - Bundle dropped from 1274 KB to 390 KB (gzip: 357 KB to 121 KB) BackgroundCanvas — heavy reduction: - Removed all 20 animated star elements (framer-motion infinite loops) - Removed 3 large blur orbs (500px, 400px, 350px with blur(80/70/60px)) - Kept only static technical grid with slow parallax + 1 static ambient radial glow - Removed dead orb-float-1/2/3 CSS keyframes from index.css CoreHeroSection — rebuilt without R3F: - Removed CoreHaloCanvas entirely; hero is now pure DOM + CSS + SVG - HaloDecoration component: CSS/SVG orbital rings (3 ellipses + 2 orbiting dots) via CSS keyframes — no useFrame, no Canvas, no WebGL - Le Huy is now the unambiguous visual core SatelliteSystem — compact orbital layout: - Simplified to absolute inset-0 inside core stage - SVG connector lines from center to each satellite - Each satellite: module shell (glassmorphism box with boxShadow + backdropFilter), mini orb dot, label, sublabel — all CSS, no SVG filter - prefers-reduced-motion: satellites appear instantly in final positions MiniSystemVisual (ProjectsSection) — redesigned without SVG filter: - Dropped archNodes + auto-tier layout - New data model: nodes: { id, label, x, y, kind? }[] + connections: [id, id][] - Each project has hand-crafted layout and explicit connections - Removed SVG feGaussianBlur filter — replaced with CSS boxShadow glow per node - Connection lines: simple SVG stroke, no heavy filter chain Code hygiene: - No 'use client' directives remaining in any Vite file - TypeScript compiles clean (tsc --noEmit) - Playwright verified: 0 R3F canvases, 0 SVG filters, 0 blur orbs, 0 star elements, 0 JS errors across all 4 viewports (1280x720, 768x1024, 375x667, 1440x900) Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent e5237fc commit de0b81b

9 files changed

Lines changed: 297 additions & 526 deletions

File tree

Lines changed: 20 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -1,106 +1,42 @@
1-
import { useMemo } from "react"
2-
import { motion, useScroll, useTransform } from "framer-motion"
1+
import { useRef } from 'react'
2+
import { motion, useScroll, useTransform } from 'framer-motion'
33

44
export function BackgroundCanvas() {
55
const { scrollYProgress } = useScroll()
66

7-
const dotsY = useTransform(scrollYProgress, [0, 1], ["0%", "-8%"])
8-
9-
const stars = useMemo(() => {
10-
return Array.from({ length: 20 }, (_, i) => ({
11-
id: i,
12-
x: `${5 + (i * 97) % 90}%`,
13-
y: `${5 + (i * 71) % 80}%`,
14-
size: 1 + (i % 3) * 0.8,
15-
delay: (i * 0.7) % 5,
16-
duration: 3 + (i % 4),
17-
}))
18-
}, [])
7+
const gridY = useTransform(scrollYProgress, [0, 1], ['0%', '-6%'])
198

209
return (
2110
<div className="fixed inset-0 -z-10 overflow-hidden pointer-events-none" aria-hidden="true">
22-
{/* Base */}
23-
<div className="absolute inset-0" style={{ background: "hsl(var(--bg))" }} />
11+
{/* Base background */}
12+
<div className="absolute inset-0" style={{ background: 'hsl(var(--bg))' }} />
2413

25-
{/* Technical grid */}
14+
{/* Technical grid — subtle, slow parallax */}
2615
<motion.div
27-
className="absolute inset-0 opacity-[0.06]"
16+
className="absolute inset-0 opacity-[0.04]"
2817
style={{
2918
backgroundImage: `
30-
linear-gradient(rgba(103, 232, 249, 0.5) 1px, transparent 1px),
31-
linear-gradient(90deg, rgba(103, 232, 249, 0.5) 1px, transparent 1px)
19+
linear-gradient(rgba(103, 232, 249, 0.6) 1px, transparent 1px),
20+
linear-gradient(90deg, rgba(103, 232, 249, 0.6) 1px, transparent 1px)
3221
`,
33-
backgroundSize: "60px 60px",
34-
y: dotsY,
35-
}}
36-
/>
37-
38-
{/* Orb 1 - top left, cyan */}
39-
<div
40-
className="absolute w-[500px] h-[500px] rounded-full"
41-
style={{
42-
background: "radial-gradient(circle, rgba(103, 232, 249, 0.08) 0%, transparent 65%)",
43-
filter: "blur(80px)",
44-
left: "-10%",
45-
top: "-5%",
46-
animation: "orb-float-1 30s ease-in-out infinite",
47-
willChange: "transform",
22+
backgroundSize: '60px 60px',
23+
y: gridY,
4824
}}
4925
/>
5026

51-
{/* Orb 2 - bottom right, violet */}
27+
{/* Single soft ambient glow — static, no animation, no blur */}
5228
<div
53-
className="absolute w-[400px] h-[400px] rounded-full"
29+
className="absolute"
5430
style={{
55-
background: "radial-gradient(circle, rgba(139, 92, 246, 0.06) 0%, transparent 65%)",
56-
filter: "blur(70px)",
57-
right: "-8%",
58-
bottom: "10%",
59-
animation: "orb-float-2 25s ease-in-out infinite",
60-
willChange: "transform",
31+
width: '600px',
32+
height: '600px',
33+
left: '50%',
34+
top: '40%',
35+
transform: 'translate(-50%, -50%)',
36+
borderRadius: '50%',
37+
background: 'radial-gradient(circle, rgba(103,232,249,0.05) 0%, transparent 65%)',
6138
}}
6239
/>
63-
64-
{/* Orb 3 - center-top, deep */}
65-
<div
66-
className="absolute w-[350px] h-[350px] rounded-full"
67-
style={{
68-
background: "radial-gradient(circle, rgba(14, 165, 233, 0.05) 0%, transparent 65%)",
69-
filter: "blur(60px)",
70-
left: "35%",
71-
top: "20%",
72-
animation: "orb-float-3 20s ease-in-out infinite",
73-
willChange: "transform",
74-
}}
75-
/>
76-
77-
{/* Star field - reduced from 40 to 20 */}
78-
{stars.map((star) => (
79-
<motion.div
80-
key={star.id}
81-
className="absolute rounded-full"
82-
style={{
83-
left: star.x,
84-
top: star.y,
85-
width: star.size,
86-
height: star.size,
87-
background:
88-
star.id % 3 === 0
89-
? "rgba(103, 232, 249, 0.6)"
90-
: "rgba(103, 232, 249, 0.4)",
91-
}}
92-
animate={{
93-
opacity: [0.1, 0.6, 0.1],
94-
scale: [0.8, 1.2, 0.8],
95-
}}
96-
transition={{
97-
duration: star.duration,
98-
repeat: Infinity,
99-
delay: star.delay,
100-
ease: "easeInOut",
101-
}}
102-
/>
103-
))}
10440
</div>
10541
)
10642
}

src/components/hero/CoreHalo.tsx

Lines changed: 0 additions & 137 deletions
This file was deleted.

src/components/hero/CoreHaloCanvas.tsx

Lines changed: 0 additions & 58 deletions
This file was deleted.

0 commit comments

Comments
 (0)