Last active
February 4, 2020 09:33
-
-
Save jesperlandberg/ddf97f598f59faff4f541b136432f097 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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