var controller = new ScrollMagic.Controller();

function zoomout(x,y){
    var anim_elem = x;
    var trig_elem = y;
    var zoomout1 = TweenMax.staggerFromTo(anim_elem, 1, {scale:1.9}, {scale:1}, 0.5);
    new ScrollMagic.Scene({triggerElement: trig_elem,reverse: false,triggerHook: 'onEnter'}).setTween(zoomout1).addTo(controller);
}
function zoomin(x,y){
    var anim_elem = x;
    var trig_elem = y;
    var zoomin1 = TweenMax.staggerFromTo(anim_elem, 1, {scale:0.8}, {scale:1}, 0.5);
    new ScrollMagic.Scene({triggerElement: trig_elem,reverse: false,triggerHook: 'onEnter'}).setTween(zoomin1).addTo(controller);
}

function fadein(x,y){
    var anim_elem = x;
    var trig_elem = y;
    var fadein1 = TweenMax.staggerFromTo(anim_elem, 0.4, {opacity:0}, {opacity:1}, 0.2);
    new ScrollMagic.Scene({triggerElement: trig_elem,reverse: false,triggerHook: 'onEnter'}).setTween(fadein1).addTo(controller);
}

function fadeinup(x,y){
    var anim_elem = x;
    var trig_elem = y;
    var fadeinup1 = TweenMax.staggerFromTo(anim_elem, 0.8, {y:10}, {y:0,opacity:1,force3D:true}, 0.2);
    new ScrollMagic.Scene({triggerElement: trig_elem,reverse: false,triggerHook: 'onEnter', offset: 250}).setTween(fadeinup1).addTo(controller);
}

function fadeinleft(x,y){
    var anim_elem = x;
    var trig_elem = y;
    var fadeinleft1 = TweenMax.staggerFromTo(anim_elem, 0.8, {x:-20}, {x:0,opacity:1,force3D:true}, 0.2);
    new ScrollMagic.Scene({triggerElement: trig_elem,reverse: false,triggerHook: 'onEnter', offset: 250}).setTween(fadeinleft1).addTo(controller);
}

function fadeinright(x,y){
    var anim_elem = x;
    var trig_elem = y;
    var fadeinright1 = TweenMax.staggerFromTo(anim_elem, 0.8, {x:20}, {x:0,opacity:1,force3D:true}, 0.2);
    new ScrollMagic.Scene({triggerElement: trig_elem,reverse: false,triggerHook: 'onEnter', offset: 250}).setTween(fadeinright1).addTo(controller);
}

function fadeinrightfull(x,y){
    var anim_elem = x;
    var trig_elem = y;
    var fadeinright1 = TweenMax.staggerFromTo(anim_elem, 1, {x:0}, {x:-880,opacity:1,force3D:true}, 0.2);
    new ScrollMagic.Scene({triggerElement: trig_elem,reverse: false,triggerHook: 'onEnter', offset: 250}).setTween(fadeinright1).addTo(controller);
}
function fadeintopfull(x,y){
    var anim_elem = x;
    var trig_elem = y;
    var fadeintop1 = TweenMax.staggerFromTo(anim_elem, 1, {y:0}, {y:-498,opacity:1,force3D:true}, 0.2);
    new ScrollMagic.Scene({triggerElement: trig_elem,reverse: false,triggerHook: 'onEnter', offset: 250}).setTween(fadeintop1).addTo(controller);
}
function fadeinbottomfull(x,y){
    var anim_elem = x;
    var trig_elem = y;
    var fadeintop1 = TweenMax.staggerFromTo(anim_elem, 1, {y:0}, {y:768,opacity:1,force3D:true}, 0.2);
    new ScrollMagic.Scene({triggerElement: trig_elem,reverse: false,triggerHook: 'onEnter', offset: 250}).setTween(fadeintop1).addTo(controller);
}
function fadeinbottomaktfull1(x,y){
    var anim_elem = x;
    var trig_elem = y;
    var fadeintop1 = TweenMax.staggerFromTo(anim_elem, 0.6, {y:0}, {y:768,opacity:1,force3D:true}, 0.2);
    new ScrollMagic.Scene({triggerElement: trig_elem,reverse: false,triggerHook: 'onEnter', offset: 250}).setTween(fadeintop1).addTo(controller);
}
function fadeinbottomaktfull2(x,y){
    var anim_elem = x;
    var trig_elem = y;
    var fadeintop1 = TweenMax.staggerFromTo(anim_elem, 0.8, {y:0}, {y:768,opacity:1,force3D:true}, 0.2);
    new ScrollMagic.Scene({triggerElement: trig_elem,reverse: false,triggerHook: 'onEnter', offset: 250}).setTween(fadeintop1).addTo(controller);
}
function fadeinbottomaktfull3(x,y){
    var anim_elem = x;
    var trig_elem = y;
    var fadeintop1 = TweenMax.staggerFromTo(anim_elem, 1, {y:0}, {y:768,opacity:1,force3D:true}, 0.2);
    new ScrollMagic.Scene({triggerElement: trig_elem,reverse: false,triggerHook: 'onEnter', offset: 250}).setTween(fadeintop1).addTo(controller);
}
function fadeinbottomaktfullbox1(x,y){
    var anim_elem = x;
    var trig_elem = y;
    var fadeintop1 = TweenMax.staggerFromTo(anim_elem, 1, {y:967.6}, {y:0,opacity:1,force3D:true}, 0.2);
    new ScrollMagic.Scene({triggerElement: trig_elem,reverse: false,triggerHook: 'onEnter', offset: 250}).setTween(fadeintop1).addTo(controller);
}
function fadeinleftbox(x,y){
    var anim_elem = x;
    var trig_elem = y;
    var fadeinleft1 = TweenMax.staggerFromTo(anim_elem, 0.8, {x:-806}, {x:0,opacity:1,force3D:true}, 0.2);
    new ScrollMagic.Scene({triggerElement: trig_elem,reverse: false,triggerHook: 'onEnter', offset: 250}).setTween(fadeinleft1).addTo(controller);
}
function rectangle13(x,y){
    var anim_elem = x;
    var trig_elem = y;
    var fadeintop1 = TweenMax.staggerFromTo(anim_elem, 0.8, {y:845}, {y:0,opacity:1,force3D:true}, 0.2);
    new ScrollMagic.Scene({triggerElement: trig_elem,reverse: false,triggerHook: 'onEnter', offset: 250}).setTween(fadeintop1).addTo(controller);
}

// $(document).ready(function (){
//     fadeinup('.crs-listing .crs-text p','.crs-listing .crs-text p',);
//     fadeinup('.crs-listing .cb-itm-txt p','.crs-listing .cb-itm-txt p',);
//     fadeinup('.crs-listing .cb-itm-img img','.crs-listing .cb-itm-img img',);
//     fadeinup('.crs-listing .cb-itm-btn .btn-rm','.crs-listing .cb-itm-btn .btn-rm',);
//     fadeinup('.competitions .home-imgbx .hm-image figure img','.competitions .home-imgbx .hm-image figure img',);
//     fadeinup('.competitions .home-imgbx .hm-ctn .ttl','.competitions .home-imgbx .hm-ctn .ttl',);
//     fadeinup('.competitions .home-imgbx .hm-ctn .txt p','.competitions .home-imgbx .hm-ctn .txt p',);
//     fadeinup('.learning-tips .home-imgbx .hm-ctn .ttl','.learning-tips .home-imgbx .hm-ctn .ttl',);
//     fadeinup('.learning-tips .home-imgbx .hm-ctn .txt p','.learning-tips .home-imgbx .hm-ctn .txt p',);
//     fadeinup('.learning-tips .home-imgbx .hm-image figure img','.learning-tips .home-imgbx .hm-image figure img',);
//     fadein('.readyto-start .tech-start .btn','.readyto-start .tech-start .btn',);
// });


var banner1 = new TimelineLite();
var banner01 = banner1.staggerFromTo('.go-nextlevel .glevel-ttl.ttl', 0.5, {y:30,opacity:0}, {y:0,opacity:1,delay:.5},0.2)
.staggerFromTo('.go-nextlevel .text', 0.5, {y:30,opacity:0}, {y:0,opacity:1}, 0.2)
.staggerFromTo('.go-nextlevel .btn-grp', 0.5, {y:30,opacity:0}, {y:0,opacity:1}, 0.2)
new ScrollMagic.Scene({triggerElement: '.go-nextlevel',reverse: false,triggerHook: 'onEnter',offset: 200}).setTween(banner01).addTo(controller);

var home1 = new TimelineLite();
var home01 = home1.staggerFromTo('.crs-listing .crs-text:nth-of-type(1) > p', 0.5, {y:30,opacity:0}, {y:0,opacity:1,delay:.5},0.2)
.staggerFromTo('.crs-listing .courses-bx', 0.5, {y:30,opacity:0}, {y:0,opacity:1}, 0.2)
.staggerFromTo('.crs-listing .crs-text:nth-of-type(3) > p', 0.5, {y:30,opacity:0}, {y:0,opacity:1}, 0.2)
new ScrollMagic.Scene({triggerElement: '.crs-listing',reverse: false,triggerHook: 'onEnter',offset: 150}).setTween(home01).addTo(controller);


var home2 = new TimelineLite();
var home02 = home2.staggerFromTo('.competitions .hm-image', 1, {x:-100,opacity:0}, {x:0,opacity:1,delay:0.2},0.2)
new ScrollMagic.Scene({triggerElement: '.competitions',reverse: false,triggerHook: 'onEnter',offset: 250}).setTween(home02).addTo(controller);

var home22 = new TimelineLite();
var home022 = home22.staggerFromTo('.competitions .hm-ctn', 1, {x:100,opacity:0}, {x:0,opacity:1,delay:0.2},0.2)
new ScrollMagic.Scene({triggerElement: '.competitions',reverse: false,triggerHook: 'onEnter',offset: 250}).setTween(home022).addTo(controller);

var home3 = new TimelineLite();
var home03 = home3.staggerFromTo('.learning-tips .hm-image', 1, {x:100,opacity:0}, {x:0,opacity:1,delay:.5},0.2)
new ScrollMagic.Scene({triggerElement: '.learning-tips',reverse: false,triggerHook: 'onEnter',offset: 200}).setTween(home03).addTo(controller);

var home33 = new TimelineLite();
var home033 = home33.staggerFromTo('.learning-tips .hm-ctn', 1, {x:-100,opacity:0}, {x:0,opacity:1,delay:.5},0.2)
new ScrollMagic.Scene({triggerElement: '.learning-tips',reverse: false,triggerHook: 'onEnter',offset: 200}).setTween(home033).addTo(controller);

var home4 = new TimelineLite();
var home04 = home4.staggerFromTo('.readyto-start .tech-start', 0.5, {X:-30,opacity:0}, {X:0,opacity:1,delay:.5},0.2)
new ScrollMagic.Scene({triggerElement: '.tech-start',reverse: false,triggerHook: 'onEnter',offset: 200}).setTween(home04).addTo(controller);



// inner-page//
var inrbnr1 = new TimelineLite();
var inrbnr01 = inrbnr1.staggerFromTo('.rz-banner .rz-txt-content', 0.5, {y:-30,opacity:0}, {y:0,opacity:1,delay:.5},0.2)
new ScrollMagic.Scene({triggerElement: '.rz-banner',reverse: false,triggerHook: 'onEnter',offset: 0}).setTween(inrbnr01).addTo(controller);

var inrsec1 = new TimelineLite();
var inrsec01 = inrsec1.staggerFromTo('.rz-fltr-ttl *', 0.5, {x:-30,opacity:0}, {x:0,opacity:1,delay:.5},0.2)
new ScrollMagic.Scene({triggerElement: '.rz-fltr-ttl',reverse: false,triggerHook: 'onEnter',offset: 0}).setTween(inrsec01).addTo(controller);

var inrbx1 = new TimelineLite();
var inrbx01 = inrbx1.staggerFromTo('.course-col', 0.5, {y:-30,opacity:0}, {y:0,opacity:1,delay:.5},0.2)
new ScrollMagic.Scene({triggerElement: '.inr-sec',reverse: false,triggerHook: 'onEnter',offset: 200}).setTween(inrbx01).addTo(controller);




// course-page//

var coucehd = new TimelineLite();
var coucehd1 = coucehd.staggerFromTo('.innerpage .page-title h1', 1, {y:-30,opacity:0}, {y:0,opacity:1,delay:.5},0.2)
new ScrollMagic.Scene({triggerElement: '.page-title',reverse: false,triggerHook: 'onEnter',offset: 0}).setTween(coucehd1).addTo(controller);

var coucesec = new TimelineLite();
var coucesec1 = coucesec.staggerFromTo('.course-page-nav .text-left', 1, {y:-30,opacity:0}, {y:0,opacity:1,delay:.5},0.2)
.staggerFromTo('.course-outline-nav', 1, {y:-30,opacity:0}, {y:0,opacity:1}, 0.2)
new ScrollMagic.Scene({triggerElement: '.course-page-nav',reverse: false,triggerHook: 'onEnter',offset: 0}).setTween(coucesec1).addTo(controller);


// par-reg-page//

var regsec = new TimelineLite();
var regsec1 = regsec.staggerFromTo('.section-title', 1, {y:30,opacity:0}, {y:0,opacity:1,delay:0.1},0.1)
.staggerFromTo('.innerpage .reg-det .reg-det-inr .reg-det-lft', 1, {y:30,opacity:0}, {y:0,opacity:1}, 0.1)
.staggerFromTo('.innerpage .reg-det .reg-det-inr .reg-det-rgt', 1, {y:30,opacity:0}, {y:0,opacity:1}, 0.1)
new ScrollMagic.Scene({triggerElement: '.reg-det',reverse: false,triggerHook: 'onEnter',offset: 0}).setTween(regsec1).addTo(controller);

var tabse = new TimelineLite();
var tabse1 = tabse.staggerFromTo('.par-tab-sec .tab-content', 0.5, {y:30,opacity:0}, {y:0,opacity:1,delay:.5},0.2)
new ScrollMagic.Scene({triggerElement: '.par-tab-sec',reverse: false,triggerHook: 'onEnter',offset: 0}).setTween(tabse1).addTo(controller);

var tabse = new TimelineLite();
var tabse1 = tabse.staggerFromTo('.quick-reg-select .rz-container', 0.5, {y:30,opacity:0}, {y:0,opacity:1,delay:.5},0.2)
new ScrollMagic.Scene({triggerElement: '.quick-reg-select',reverse: false,triggerHook: 'onEnter',offset: 0}).setTween(tabse1).addTo(controller);

