fix(client): eliminate ssr: false in Client Component and add safe WebGL exception handling to prevent client-side exception

This commit is contained in:
2026-11-03 13:46:51 +05:30
parent 8590608713
commit ea722c09be
3 changed files with 243 additions and 219 deletions
+8 -5
View File
@@ -8,11 +8,14 @@ export function CursorAura() {
const auraRef = useRef<HTMLDivElement>(null);
useEffect(() => {
// Only enable on pointer-fine (mouse/trackpad) and when not reduced-motion
if (window.matchMedia('(pointer: coarse)').matches) return;
if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) return;
setMounted(true);
try {
if (typeof window === 'undefined') return;
if (window.matchMedia && window.matchMedia('(pointer: coarse)').matches) return;
if (window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches) return;
setMounted(true);
} catch {
return;
}
const onMouseMove = (e: MouseEvent) => {
posRef.current.targetX = e.clientX;