From 7d320ac4a341c716645428c44af2845f80c449fb Mon Sep 17 00:00:00 2001 From: sazzadulalambd Date: Mon, 22 Jun 2026 17:02:11 +0600 Subject: [PATCH] feat: replace Crystal component with detailed Battery model in HeroBackground3D --- src/components/ui/3d/HeroBackground3D.tsx | 65 +++++++++++++++++------ 1 file changed, 50 insertions(+), 15 deletions(-) diff --git a/src/components/ui/3d/HeroBackground3D.tsx b/src/components/ui/3d/HeroBackground3D.tsx index ce6ec87..594b8fd 100644 --- a/src/components/ui/3d/HeroBackground3D.tsx +++ b/src/components/ui/3d/HeroBackground3D.tsx @@ -102,20 +102,56 @@ function AeroxModel() { ); } -function Crystal({ position, color, scale = 1 }: { position: [number, number, number]; color: string; scale?: number }) { - const ref = useRef(null); +function Battery({ position, scale = 1, rotation = [0, 0, 0] }: { position: [number, number, number]; scale?: number; rotation?: [number, number, number] }) { + const group = useRef(null); + const logoTexture = useLoader(THREE.TextureLoader, '/jaiben.png'); + useFrame((state, delta) => { - if (ref.current) { - ref.current.rotation.y += delta * 0.5; - ref.current.position.y = position[1] + Math.sin(state.clock.elapsedTime + position[0]) * 0.3; + if (group.current) { + group.current.rotation.y += delta * 0.4; + group.current.position.y = position[1] + Math.sin(state.clock.elapsedTime + position[0]) * 0.2; } }); + return ( - - - - - + + + {/* Main Battery Body */} + + + + + + {/* Top Cap */} + + + + + + {/* Handle */} + + + + + + {/* Glowing Indicator Light */} + + + + + + {/* Logo Decal Plane */} + + + + + + {/* Back Logo Decal Plane */} + + + + + ); } @@ -140,13 +176,12 @@ function Scene() { }> + + + + - - - - -