├── .gitignore ├── README.md ├── app.js ├── index.html └── style.css /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeSTACKr/gsap-typing-animation/f3f055bfd3e1c39972c39cf94512f39504e61efb/.gitignore -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## GSAP Typing Animation Tutorial 2 | 3 | This repo goes along with my GSAP typing animation tutorial on YouTube. 4 | Video: [GSAP Typing Animation Tutorial](https://youtu.be/ZT66N5hBiCE) -------------------------------------------------------------------------------- /app.js: -------------------------------------------------------------------------------- 1 | const words = ["Jesse.", "A Father.", "A Husband.", "A Developer."] 2 | 3 | let cursor = gsap.to('.cursor', {opacity:0, ease: "power2.inOut", repeat:-1}) 4 | let masterTl = gsap.timeline({repeat: -1}).pause() 5 | let boxTl = gsap.timeline() 6 | 7 | boxTl.to('.box', {duration:1, width:"17vw", delay: 0.5, ease: "power4.inOut"}) 8 | .from('.hi', {duration:1, y:"7vw", ease: "power3.out"}) 9 | .to('.box', {duration:1, height:"7vw", ease: "elastic.out", onComplete: () => masterTl.play() }) 10 | .to('.box', {duration:2, autoAlpha:0.7, yoyo: true, repeat: -1, ease:"rough({ template: none.out, strength: 1, points: 20, taper: 'none', randomize: true, clamp: false})"}) 11 | words.forEach(word => { 12 | let tl = gsap.timeline({repeat: 1, yoyo: true, repeatDelay:1}) 13 | tl.to('.text', {duration: 1, text: word}) 14 | masterTl.add(tl) 15 | }) -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 |