bugfixes/fix-cursor-on-production #7
@@ -15,14 +15,21 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
window.addEventListener('load', () => {
|
||||||
const cursor = document.getElementById('custom-cursor');
|
const cursor = document.getElementById('custom-cursor');
|
||||||
|
const gsapInstance = window.gsap;
|
||||||
|
|
||||||
|
if (!cursor || !gsapInstance) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
document.addEventListener('mousemove', (e) => {
|
document.addEventListener('mousemove', (e) => {
|
||||||
gsap.to(cursor, {
|
gsapInstance.to(cursor, {
|
||||||
duration: 0.2,
|
duration: 0.2,
|
||||||
x: e.clientX + 20,
|
x: e.clientX + 20,
|
||||||
y: e.clientY - 15,
|
y: e.clientY - 15,
|
||||||
ease: 'power2.out'
|
ease: 'power2.out'
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user