fixed error
All checks were successful
publish.yml / publish (push) Successful in 1m17s

This commit is contained in:
2026-04-15 23:17:39 +02:00
parent 22e20a04db
commit 0b2ea1f3bc

View File

@@ -277,7 +277,7 @@ class ParticleEngine {
export class InteractiveBackground implements AfterViewInit, OnDestroy { export class InteractiveBackground implements AfterViewInit, OnDestroy {
@ViewChild('canvas', { static: true }) private readonly canvasRef!: ElementRef<HTMLCanvasElement>; @ViewChild('canvas', { static: true }) private readonly canvasRef!: ElementRef<HTMLCanvasElement>;
isCursorVisible = false; isCursorVisible = InteractiveBackground.detectFinePointer();
isPointerDown = false; isPointerDown = false;
cursorTransform = 'translate3d(-9999px, -9999px, 0)'; cursorTransform = 'translate3d(-9999px, -9999px, 0)';
@@ -311,8 +311,6 @@ export class InteractiveBackground implements AfterViewInit, OnDestroy {
} }
} }
this.isCursorVisible = this.getMediaQuery('(pointer: fine)').matches;
const onResize = () => this.resizeCanvas(); const onResize = () => this.resizeCanvas();
const supportsPointerEvents = 'PointerEvent' in window; const supportsPointerEvents = 'PointerEvent' in window;
const onPointerMove = (event: PointerEvent) => this.handlePointerMove(event); const onPointerMove = (event: PointerEvent) => this.handlePointerMove(event);
@@ -581,6 +579,14 @@ export class InteractiveBackground implements AfterViewInit, OnDestroy {
dispatchEvent: () => false, dispatchEvent: () => false,
}; };
} }
private static detectFinePointer(): boolean {
if (typeof window === 'undefined' || typeof window.matchMedia !== 'function') {
return false;
}
return window.matchMedia('(pointer: fine)').matches;
}
} }