portfolio/assets/angular/app.js
// Preps skillset objects and builds Timeline
Preps skillset objects and builds Timeline
Preps skillset objects and builds Timeline
function buildSkillsets() {
            if (typeof this !== 'object')
                return console.log('buildSkillsets() cannot be called directly.');
            else if (!this.objects.length)
                return console.log('.init() must be called before .build().');
            else
                var that = this;
            if (that.timeline.getChildren().length)
                that.timeline.clear();
            $.each(that.objects, function(i, object) {
                object.deltaEnd = (object.delta + tween.shift.delta).toRad();
                that.timeline.set(object.dom, {css:{
                    autoAlpha: 1,
                    boxShadow: 'transparent',
                    zIndex: 0
                }});
            });
            var w = $(that.dom.wrapper).width();
            var h = $(that.dom.wrapper).height();
            for (var step = 1; step <= tween.steps; step++) {
                $.each(that.objects, function(i, object) {
                    object.offset += tween.step.offset;
                    object.delta += tween.step.delta;
                    object.pos.x = (object.offset * Math.cos(object.delta.toRad()) - that.radius) / w * 100;
                    object.pos.y = (object.offset * Math.sin(object.delta.toRad()) + that.radius) / h * 100;
                    that.timeline.to(object.dom, tween.rate, {css:{
                        left: (50 + object.pos.x) + '%',
                        top: (50 - object.pos.y) + '%'},
                        ease: Power0.easeNone
                    }, '-=' + tween.rate * (i == 0 ? '0' : '1'));
                });
            }
            that.timeline.fromTo(that.dom.parent, tween.duration,
                {css:{boxShadow: '0 0 0 ' + that.dom.parent.css('background-color')}},
                {css:{boxShadow: '0 0 16px rgb(43, 44, 38)'},
                ease: Sine.easeIn
            }, '-=' + tween.duration);
            $.each(that.objects, function(i, object) {
                that.timeline
                    .fromTo(object.dom, tween.duration,
                        {css:{
                            scale: object.scale,
                            backgroundColor: that.dom.parent.css('background-color')}},
                        {css:{
                            scale: object.scale + tween.shift.scale,
                            backgroundColor: object.color},
                        ease: Power3.easeIn
                    }, '-=' + tween.duration)
                    .from(object.text, tween.duration, {css:{
                        autoAlpha: 0},
                        ease: Expo.easeIn
                    }, '-=' + tween.duration);
            });
        }
function buildSkillsets ( ) { if ( typeof this !== 'object' ) return console . log ( 'buildSkillsets() cannot be called directly.' ) ; else if ( ! this . objects . length ) return console . log ( '.init() must be called before .build().' ) ; else var that = this ; if ( that . timeline . getChildren ( ) . length ) that . timeline . clear ( ) ; $ . each ( that . objects , function ( i , object ) { object . deltaEnd = ( object . delta + tween . shift . delta ) . toRad ( ) ; that . timeline . set ( object . dom , { css : { autoAlpha : 1 , boxShadow : 'transparent' , zIndex : 0 } } ) ; } ) ; var w = $ ( that . dom . wrapper ) . width ( ) ; var h = $ ( that . dom . wrapper ) . height ( ) ; for ( var step = 1 ; step <= tween . steps ; step ++ ) { $ . each ( that . objects , function ( i , object ) { object . offset += tween . step . offset ; object . delta += tween . step . delta ; object . pos . x = ( object . offset * Math . cos ( object . delta . toRad ( ) ) - that . radius ) / w * 100 ; object . pos . y = ( object . offset * Math . sin ( object . delta . toRad ( ) ) + that . radius ) / h * 100 ; that . timeline . to ( object . dom , tween . rate , { css : { left : ( 50 + object . pos . x ) + '%' , top : ( 50 - object . pos . y ) + '%' } , ease : Power0 . easeNone } , '-=' + tween . rate * ( i == 0 ? '0' : '1' ) ) ; } ) ; } that . timeline . fromTo ( that . dom . parent , tween . duration , { css : { boxShadow : '0 0 0 ' + that . dom . parent . css ( 'background-color' ) } } , { css : { boxShadow : '0 0 16px rgb(43, 44, 38)' } , ease : Sine . easeIn } , '-=' + tween . duration ) ; $ . each ( that . objects , function ( i , object ) { that . timeline . fromTo ( object . dom , tween . duration , { css : { scale : object . scale , backgroundColor : that . dom . parent . css ( 'background-color' ) } } , { css : { scale : object . scale + tween . shift . scale , backgroundColor : object . color } , ease : Power3 . easeIn } , '-=' + tween . duration ) . from ( object . text , tween . duration , { css : { autoAlpha : 0 } , ease : Expo . easeIn } , '-=' + tween . duration ) ; } ) ; }
Preps skillset objects and builds Timeline
Preps skillset objects and builds Timeline
// If a Timeline already exists, wipe it out /*  Perform pre-build */ /*  Build Timeline for radial tween */ /*  Perform post-build */