bugfixes/fix-cursor-on-production #7

Merged
roberto merged 2 commits from bugfixes/fix-cursor-on-production into main 2026-06-03 23:54:44 +02:00
Showing only changes of commit f85b596a66 - Show all commits

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'
});
});
});