From 03b8924267caac9dac54536b2b579199792aaa3a Mon Sep 17 00:00:00 2001 From: vshnosngh Date: Thu, 5 Nov 2026 12:28:32 +0530 Subject: [PATCH] fix(mobile): completely remove 3D geometric shape from mobile home screen background --- src/components/3d/HeroCrystalCanvas.tsx | 9 +++++++++ src/components/sections/HeroSection.tsx | 6 +++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/components/3d/HeroCrystalCanvas.tsx b/src/components/3d/HeroCrystalCanvas.tsx index d42af21..2941c3b 100644 --- a/src/components/3d/HeroCrystalCanvas.tsx +++ b/src/components/3d/HeroCrystalCanvas.tsx @@ -17,6 +17,15 @@ export function HeroCrystalCanvas({ className }: HeroCrystalCanvasProps) { const containerRef = useRef(null); useEffect(() => { + // Completely disable on phones, tablets, and mobile screens (< 1024px) + if (typeof window !== 'undefined') { + const isPhoneOrTablet = + window.innerWidth < 1024 || + /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || + (window.matchMedia && window.matchMedia('(pointer: coarse)').matches && !window.matchMedia('(pointer: fine)').matches); + if (isPhoneOrTablet) return; + } + const container = containerRef.current; if (!container) return; diff --git a/src/components/sections/HeroSection.tsx b/src/components/sections/HeroSection.tsx index 53f6611..4e9d20a 100644 --- a/src/components/sections/HeroSection.tsx +++ b/src/components/sections/HeroSection.tsx @@ -275,9 +275,9 @@ export function HeroSection({ size={0.7} /> - {/* 2. Interactive 3D WebGL Crystal Prism Canvas Rotating Behind the Text */} -
-
+ {/* 2. Interactive 3D WebGL Crystal Prism Canvas (Desktop Only - Completely Removed on Phones & Mobile Devices) */} +
+