fix(client): eliminate ssr: false in Client Component and add safe WebGL exception handling to prevent client-side exception
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user