carhop__carhop-theme__DEV/resources/js/titles.js
2026-05-13 18:01:11 +02:00

16 lines
479 B
JavaScript

// GSAP Text Animations
export default function titlesInit() {
const homeTitle = document.querySelector('body.home h1');
let split = SplitText.create(homeTitle, { type: 'words, lines' });
// now animate the characters in a staggered fashion
gsap.from(split.lines, {
duration: 2,
y: 40, // animate from 100px below
autoAlpha: 0, // fade in from opacity: 0 and visibility: hidden
stagger: 0.2, // 0.05 seconds between each
ease: 'power4.out',
});
}