Trying to build something and wondering if I'm approaching it in the right way.
I've seen an effect where text will look clipped and slide up into view line by line, one after another.
This is the way I've built it, essentially looping through each text element and adding a class that moves it into view (I'm using clipping and translate). To control the delay on each loop through I'm increasing a variable each time. My CSS feels a bit messy though
Codepen here: https://codepen.io/shane-harley/pen/bGEBmGQ
Thoughts?
let transitionTime = 0
text.forEach(heading => {
window.addEventListener('load', () => {
heading.classList.add("active")
heading.style.transitionDelay = transitionTime + "s"
transitionTime = transitionTime + .2
})
})