Skip to content

Instantly share code, notes, and snippets.

@jesperlandberg
Last active February 4, 2020 09:33
Show Gist options
  • Select an option

  • Save jesperlandberg/ddf97f598f59faff4f541b136432f097 to your computer and use it in GitHub Desktop.

Select an option

Save jesperlandberg/ddf97f598f59faff4f541b136432f097 to your computer and use it in GitHub Desktop.
// Create 2 splits, one used to wrap the inner lines with overflow: hidden lines
const outerSplit = new SplitText(title, { type: 'lines' })
const innerSplit = new SplitText(outerSplit.lines, { type: 'lines' })
new gsap.timeline({
onComplete: () => {
// Remove wrappings when complete
innerSplit.revert()
outerSplit.revert()
}
})
.set(outerSplit.lines, {
overflow: 'hidden'
})
.from(innerSplit.lines, {
yPercent: 100,
duration: 1,
stagger: 0.1,
ease: 'expo'
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment