GreenSock JS code example
Example 1: gsap install
with npm => npm install gsap
with yarn => yarn add gsap
with CDN => https://cdnjs.cloudflare.com/ajax/libs/gsap/3.5.1/gsap.min.js
Example 2: gsap
//create a timeline instance
var tl = gsap.timeline();
//the following two lines do the SAME thing:
tl.add( gsap.to("#id", {duration: 2, x: 100}) );
tl.to("#id", {duration: 2, x: 100}); //shorter syntax!