Files
cv-roberto/resources/js/app.js

36 lines
783 B
JavaScript

import './bootstrap';
import Alpine from 'alpinejs';
window.Alpine = Alpine;
Alpine.start();
import stickybits from 'stickybits';
document.addEventListener('DOMContentLoaded', () => {
stickybits('#right-content', {
stickyBitStickyOffset: 40,
parent: '.grid' // dit moet de container zijn waarin sticky moet blijven
});
});
window.addEventListener('load', () => {
const cursor = document.getElementById('custom-cursor');
const gsapInstance = window.gsap;
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'
});
});
});