fix(mobile): completely remove 3D geometric shape from mobile home screen background

This commit is contained in:
2026-11-05 12:28:32 +05:30
parent 001628e233
commit 03b8924267
2 changed files with 12 additions and 3 deletions
+9
View File
@@ -17,6 +17,15 @@ export function HeroCrystalCanvas({ className }: HeroCrystalCanvasProps) {
const containerRef = useRef<HTMLDivElement>(null); const containerRef = useRef<HTMLDivElement>(null);
useEffect(() => { 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; const container = containerRef.current;
if (!container) return; if (!container) return;
+3 -3
View File
@@ -275,9 +275,9 @@ export function HeroSection({
size={0.7} 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) */}
<div className="absolute inset-0 -z-10 flex items-center justify-center pointer-events-none select-none overflow-hidden"> <div className="hidden lg:flex absolute inset-0 -z-10 items-center justify-center pointer-events-none select-none overflow-hidden">
<div className="w-[700px] h-[700px] sm:w-[1000px] sm:h-[1000px] lg:w-[1300px] lg:h-[1300px] opacity-85 transform-gpu transition-opacity duration-1000"> <div className="w-[1000px] h-[1000px] lg:w-[1300px] lg:h-[1300px] opacity-85 transform-gpu transition-opacity duration-1000">
<Hero3DCanvas className="w-full h-full" /> <Hero3DCanvas className="w-full h-full" />
</div> </div>
</div> </div>