/* home-animation.js ================= This file is manually included by the home_inc-js.php file within this themes directory if animations are not disabled. This file is only loaded on the homepage of this theme, and doesn't apply animations across the site. If you wish to apply an animation across the whole site then please do so in global-animation.js Remember that animations are theme specific, meaning this file only effects the current theme that you are animating, and not every theme across the TemplateOTS platform. See detailed documentation here:- https://docs.google.com/document/d/1n5sWQ8SIr-zjOpTv8YnOTHJapO8WdedjDfbeo-lkqMM/edit#heading=h.lmxb59mpcpe2 */ /* Store in self invoking function so we don't clutter the global namespace. */ // Store the global animation delay var nHomeAnimationDelay = 0; (function () { /* On Document Loaded ================== Called by Jquery event handler when the document is ready (When content has been loaded) */ $( document ).ready( function() { // Try and store the header box var oH1Box = $("#h1-box"); // Try and store the right bar var oRightBar = $("#right-block-col"); // Try and store the category wrapper var oCategoryWrapper = $("#categories-wrapper"); // If the header box exists if( oH1Box.length ) { // Animate the h1 box fAnimateHeaderItem(oH1Box); } // If the right bar exists if( oRightBar.length ) { // Animate the right bar fAnimateHeaderItem(oRightBar); } // If the category wrapper exists if( oCategoryWrapper.length ) { // Animate the category wrapper fAnimteCategoryWrapper(oCategoryWrapper); } }); /* fAnimateHeaderItem() ==================== */ function fAnimateHeaderItem(oH1Box) { // Animate the header box in TweenMax.to( oH1Box, 0.75, { opacity : 1, ease : Power2.easeIn, delay : nHomeAnimationDelay } ); } /* fAnimteRightBar() ==================== */ function fAnimteRightBar(oRightBar) { // Animate the right bar box in TweenMax.to( oRightBar, 1.25, { opacity : 1, ease : Power2.easeIn, delay : nHomeAnimationDelay } ); } /* fAnimteCategoryWrapper() ======================== */ function fAnimteCategoryWrapper(oCategoryWrapper) { // Animate the category wrapper in TweenMax.to( oCategoryWrapper, 1, { opacity : 1, ease : Power2.easeIn, delay : nHomeAnimationDelay } ); } }());