/* 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 */ (function () { /* On Document Loaded ================== Called by Jquery event handler when the document is ready (When content has been loaded) */ $( document ).ready( function() { // Set the left position of the footer for that scroll effect TweenMax.set( $(".footer"), { bottom : "0px", opacity : 0 } ); // Make sure the page content is visible TweenMax.set( $("#page-content-wrapper"), { opacity : "1" } ); // Set timeout for effect (Stops it looking silly with animation booting up without a delay) setTimeout(function() { // If we have the slideshoe element if( $(".slideshow-container").length ) { // Set inital style for slide opacity $(".slide-inital").css( { opacity : 0, width : 0, display : "block" } ); // Fade the inital slide in TweenMax.to ( $(".slide-inital"), 2, { width: "100%", left : "0%", ease: "power3.inOut" } ); // Fade the inital slide in, use on seperate tween to make fade in faster TweenMax.to ( $(".slide-inital"), 1.5, { opacity : 1, ease: "power3.inOut" } ); } // If menu items exist if( $(".menu-items").length ) { // Fade the menu items in TweenMax.to ( $(".menu-items"), 3.5, { opacity : 1, ease: "circ. in" } ); } // Fade the inital slide in, no need to check if it exists as it always will TweenMax.to ( $(".hamburger-menu"), 3.5, { opacity : 1, ease: "power3.inOut" } ); // Add a timeout for effect setTimeout(function() { // Store the element that will have effect var oLogo = ""; // If we have the logo image element if( $(".logo-image").length ) { // Store the logo oLogo = $(".logo-image"); } // If we have no image, we must have text instead else { // Store the logo oLogo = $(".logo-text"); } // Set the left position of the logo for that scroll effect TweenMax.set( oLogo, { left : "100%" } ); // Move the logo to the correct position TweenMax.to ( oLogo, 1.4, { left: "0%", opacity : 1, ease: "slow(0.7, 0.7, false)" } ); }, 550); // Add a timeout for effect setTimeout(function() { // Move the footer in from the bottom TweenMax.to ( $(".footer"), 1.4, { bottom: "0px", opacity : 1, ease: "circ. in" } ); // Fade the navigation in TweenMax.to ( $(".navigation"), 2, { opacity: "1", ease: "circ. in" } ); }, 950); }, 200); }); }());