Hi, I have this part of a slide code:
function nextSlide(pageNumber) {
const nextPage = pages[pageNumber];
const currentPage = pages[current];
const nextText = nextPage.querySelector("h1");
const tl = new TimelineMax({
onStart: function() {
slides.forEach(slide => {
slide.style.pointerEvents = "none";
});
},
onComplete: function() {
slides.forEach(slide => {
slide.style.pointerEvents = "all";
});
}
});
tl.fromTo(
currentPage,
0.3,
{ opacity: 1, pointerEvents: "all" },
{ opacity: 0, pointerEvents: "none" }
)
.fromTo(
nextPage,
0.3,
{ opacity: 0, pointerEvents: "none" },
{ opacity: 1, pointerEvents: "all" },
"-=0.6"
)
fromTo(nextText, 0.3, { opacity: 0, y: 0 }, { opacity: 1, y: 0 });
current = pageNumber;
}
And I don't know how to implement a splitText in 'h1' (nexText) like here: https://codepen.io/GreenSock/pen/aVJRBg
In particular, I don't know how to make these two parts combine:
const nextText = nextPage.querySelector ("h1");
and var mySplitText = new SplitText ("# quote", {type: "chars, words, lines"})