(function ($) { //exclusive var item = $(imgThumb), exclusivetl = new TimelineMax; exclusivetl .to(item,0.5,{}) //preloader var select = function(s) { return document.querySelector(s); }, selectAll = function(s) { return document.querySelectorAll(s); }; var loadImg = select('#loadImg'); var imgThumb = select('#loadImg img'); var loaderSix = select('.six .loader'); var topDotSix = select('.six .dot:first-child'); var dotsSix = selectAll('.six .dot:not(:first-child)'); var dotsSixThree = selectAll('.six .dot:nth-child(3)'); var dotsSixFour = select('.six .dot:nth-child(4)'); var tlSix = new TimelineMax({ repeat: -1 }); tlSix .set( loadImg,{x:(window.innerWidth/2)-150, y:(window.innerHeight/2)-250}) .set(imgThumb, {width:300}) .to(topDotSix, 0.25, {x: '+=15', y: -10, ease: Power0.easeOut}) .to(topDotSix, 0.25, {x: '+=15', y: 2, ease: Power0.easeIn}) .to(topDotSix, 0.25, {x: '+=15', y: -10, ease: Power0.easeOut}) .to(topDotSix, 0.25, {x: '+=15', y: 2, ease: Power0.easeIn}) .to(topDotSix, 0.25, {x: '+=15', y: -10, ease: Power0.easeOut}) .to(topDotSix, 0.25, {x: '+=15', y: 2, ease: Power0.easeIn}) .to(topDotSix, 0.25, {x: '-=15', y: -10, ease: Power0.easeOut}) .to(topDotSix, 0.25, {x: '-=15', y: 2, ease: Power0.easeIn}) .to(topDotSix, 0.25, {x: '-=15', y: -10, ease: Power0.easeOut}) .to(topDotSix, 0.25, {x: '-=15', y: 2, ease: Power0.easeIn}) .to(topDotSix, 0.25, {x: '-=15', y: -10, ease: Power0.easeOut}) .to(topDotSix, 0.25, {x: '-=15', y: 2, ease: Power0.easeIn}) .staggerTo(dotsSix, 0.1, { scaleX: 1.15, scaleY: .85, transformOrigin: "bottom", ease: Sine.easeOut, yoyo: true, background: '#2b4d66', repeat: 1 }, 0.5, 0) .staggerTo([dotsSixThree, dotsSixFour], 0.1, { scaleX: 1.15, scaleY: .85, transformOrigin: "bottom", background: '#2b4d66', ease: Sine.easeOut, yoyo: true, repeat: 1 }, -0.5, 2); })(jQuery);