02Geek HTML5 and JavaScript, TypeScript, React, Flash, ActionScript online School
Previous VideoNext Video

Choosing how to import GSAP

Welcome back! In this lesson we will continue looking into our source files. The GSAP animation library contains many source files. In this lecture we will make sense out of them. By the end of this lesson you will be familiar with the file structure of the GSAP animation Library. To save us time we will not repeat this process again. If you ever forget how to set your source files come back to this lecture.

Video Transcript

00:00Welcome back. In this lecture we're going to continue looking into our source files.
00:04Now we're going to talk about how do you import the right JavaScript library elements for our Greensoc gsap library.
00:12We're going to start off with the tweenlight, but what we're going to do now for tweenlight is relevant for every single other element of the library package.
00:20By the end of this lesson, we're going to have our source files configured and set.
00:24We're not going to talk about source files anymore throughout all the remainder chapters of this course.
00:30So let's jump right in there, see that process, and get started before we continue.
00:34So in the last lesson we paused because I moved the file, the JavaScript into an external file, the ch01.js.
00:42And that's exactly the format that you're going to have.
00:44So you'll want to create your own file and then follow along.
00:48But your starter element will probably always be this basic construct we saw in the last lesson.
00:55Now we saw also how to integrate jQuery, so we're not going to talk about that any further.
00:59What I want to talk about next is how do you integrate the tweenmax or any of that gsap tween library elements.
01:10We're going to be starting throughout the next few lessons with the tweenlight.
01:14And I want to show you the options that you have by going onto the website.
01:18Going on to the gsap website and you'll see that if you go directly onto the home page itself and you click on the products,
01:25you'll see the HTML JavaScript and you'll have here your gsap.
01:30And if you click onto it, you'll have a download area right here,
01:34which you could directly download the file and work with it locally.
01:38I had for a second and click on that download area.
01:41And what will happen is you're going to have like this nice big window.
01:46It enables you or to download the zip file or to go to GitHub if you're familiar with it and want to work with it,
01:52or you could actually go ahead and create a custom download for yourself.
01:58Now, I'm going to click on that customize because throughout our course,
02:00we want to get familiar with the different properties and the different elements that are available in jQuery.
02:07I'm going to go ahead and in the beginning, I'm deselect everything and I'm only going to select tweenlight.
02:12And notice how we have your first of all, we have our source file.
02:15We see that the version currently that I'm downloading is fourteen dot two,
02:19but I could if I want to and I do is to set it to be the latest.
02:23That way I'll get the latest version because I'm not concerned too much about it breaking in general,
02:29probably in a real live application that's going live.
02:33It's a good idea to use actually a certain version because you never know if there'll be some sort of a modification
02:40that might break your application.
02:42So latest is a bit too high end.
02:44And in reality, we'd probably want to go to a specific version, use that specific version, the latest version.
02:51And each time we run a new project, just use the latest one.
02:54Just go back on to green talk and test it.
02:56And if you're back on the same project, then go back and upgrade to make sure that everything is still working appropriately.
03:02Now, obviously, it's kind of a give and take because it could be that some sort of browser update
03:07that makes some sort of an issue that the latest one will actually fix.
03:11So it's really just a question of how active are you with managing your source,
03:15but we're going to work with the latest always because for us all the stuff that we're going to be doing should be relatively stable.
03:22We're not really approaching any experimental features.
03:27We're really going for what's the formal stuff of how to work with with the library.
03:31And we're assuming that the library is not going to change at least its formal API.
03:35It hasn't for a very long time.
03:38It usually just adds features or tweaks things or make them better, makes them better.
03:43So I'm going to go ahead and I'm just going to copy this source file.
03:46And in the future, in every single episode, if I'm going to say that download the CSS plugin
03:50or you see it suddenly in the source files, know that the way I've done it is I came over to the plugins
03:55or I came over to the specific element, highlighted it and got those source files.
04:01So once I got my source files and I copied them, I could go right back into my editor.
04:05And this time around, I'm just going to paste right in there into the top here with our other scripts.
04:10I'm just going to paste inside our tween light script.
04:13And this is going to be the first library element that we're going to be working on.
04:17Now, before I wrap this lecture up, I wanted just to say one more thing.
04:22So when you are back into the source file, that's actually two things.
04:26If I just close this element, I want you to go into the documentation and in the documentation,
04:31I would just keep that documentation in general open, generally open.
04:36Because in many ways, we're not going to cover every single function of tween light.
04:41We're not going to cover every single function of anything here.
04:44But we're going to give you a big birds view that will enable you to do things on your own.
04:49And in general, I recommend that if we're working on tween light, have the tween light library open.
04:55You'll have that way, all the public properties and public methods that you could then look around
04:59and see how to work with them even further into things that we won't actually cover in this series of lectures.
05:06Alright, so with that said, let's jump right in because in the next lesson, we're going to actually start animating.

Ready to Level Up Your Skills?

Join thousands of learners on 02GEEK and start your journey to becoming a coding expert today!

Enroll Now for Free!