Merge pull request 'bugfixes/fix-cursor-on-production' (#7) from bugfixes/fix-cursor-on-production into main
All checks were successful
Tests / Laravel tests (push) Successful in 12m0s

Reviewed-on: #7
This commit was merged in pull request #7.
This commit is contained in:
2026-06-03 23:54:43 +02:00
2 changed files with 16 additions and 8 deletions

View File

@@ -15,14 +15,21 @@ document.addEventListener('DOMContentLoaded', () => {
});
});
const cursor = document.getElementById('custom-cursor');
window.addEventListener('load', () => {
const cursor = document.getElementById('custom-cursor');
const gsapInstance = window.gsap;
document.addEventListener('mousemove', (e) => {
gsap.to(cursor, {
if (!cursor || !gsapInstance) {
return;
}
document.addEventListener('mousemove', (e) => {
gsapInstance.to(cursor, {
duration: 0.2,
x: e.clientX + 20,
y: e.clientY - 15,
ease: 'power2.out'
});
});
});

View File

@@ -179,7 +179,8 @@
}
const visitorKey = 'cv_visitor_id';
const createVisitorId = () => window.crypto?.randomUUID?.() ?? `${Date.now()}-${Math.random().toString(36).slice(2)}`;
const createVisitorId = () => window.crypto?.randomUUID?.() ??
`${Date.now()}-${Math.random().toString(36).slice(2)}`;
let visitorId = createVisitorId();
try {