- Overview
- Transcript
3.6 Finishing Touches
Now that our outlines have animated in, in this lesson you will learn how to create a callback function that will fade in your solid text once the outlines have finished animating.
Related Links
1.Introduction2 lessons, 09:53
1.1Introduction00:44
1.2GSAP Refresher09:09
2.Project 1: Animated Preloader8 lessons, 1:14:57
2.1The Starter File07:48
2.2Creating a Timeline11:48
2.3Bouncing Circles13:08
2.4Animating the Shadows04:12
2.5Loading Images10:50
2.6Preloading Multiple Images08:48
2.7Animating the Preloader Off12:55
2.8Revealing the Main Content05:28
3.Project 2: SVG Animated Logo6 lessons, 31:49
3.1Examining the Logo03:44
3.2Setting Up the Styles04:29
3.3Randomizing Position and Opacity07:29
3.4Animating the Dots06:38
3.5Animating Paths With jQuery DrawSVG06:28
3.6Finishing Touches03:01
4.Project 3: GSAP Image Slider8 lessons, 1:06:54
4.1Getting Started05:21
4.2A Note on Slide Positioning04:59
4.3Setting Up Some Variables08:56
4.4Placing the Slides05:08
4.5On Deck12:24
4.6Setting Up the Animation Array09:53
4.7Setting Up the Animations11:36
4.8Creating the Button Events08:37
5.Conclusion1 lesson, 00:46
5.1Final Thoughts00:46
3.6 Finishing Touches
Hello and welcome back. In this lesson, we're going to finish out our second project by animating in our solid block of text, after our outline text has finished animating. And we're gonna do this using a callback function inside this my SVG object that we created. So I want to pass a few properties into this drawsvg object, and the way we do that is inside the parentheses when we first create that object, we type a set of opening and closing curly brackets, just like we've seen before with green max or I'm sorry, green sock. And inside those curly brackets, were going to enter in a couple of properties. Now the first thing I want to do is I want to change the duration of this particular animation. And, we can do that using the duration property but keep in mind that this property is in milliseconds. So if we want it to last 1 second, we're going to type in 1000 because 1000 milliseconds equals 1 second. So now we'll watch the animation again. And when we see our text outlines, we'll see that it happens a little bit quicker, and I like that speed. So, after we do that, I'm gonna create another property here called callback. And this callback function that we're gonna create will be triggered whenever the current animation is finished or whenever this particular object finishes its animation. So we'll type callback; function() {}. Inside the curly brackets for that function, we can do whatever we want and what I wanna do is I want to animate in the solid text inside it, and remember we can see in our CSS that solid text has an ID of company. So, that's what we're going to point to. So, let's go back to our JavaScript and inside our callback function, we're gonna create a TweenMax animations. We'll do TweenMax.to, and we're gonna animate the item with an ID of company, so we'll put #company inside quotation marks there. Then we'll type comma space and let's say that we want this to be a slow fade in over the course of 3 seconds. And then we'll have our opening and closing curly brackets for that TweenNext.2animation and we'll put a semi-colon at the end of that line. And then inside the curly brackets for that animation, we're simply going to set the opacity equal to one. So it should fade in once our initial animations have done. So we see the dots fade in and move into place, we see our outlines animate, and then, sure enough, we see our solid text animate, and over and our animation is complete. So hopefully you've learned a lot from this particular project. It's really fun to randomize things, always like doing random animations. So this one's a lot of fun to do. And one of the cool things about it is you get a different effect every time you do it. So thank you for watching. Let's save our changes and we'll move on with the next project.