1$(document).ready(function () { 2 //== Globals 3 var $BODY = $( 'body' ); 4 5 //== Loading 6 $(".app").animsition({ 7 inClass: 'fade-in', 8 outClass: 'fade-out', 9 inDuration: 1500, 10 outDuration: 1500, 11 linkElement: 'a:not([target="_blank"]):not([href^="#"]):not([href*="mailto"])', 12 loading: true, 13 loadingParentElement: 'body', //animsition wrapper element 14 loadingClass: 'animsition-loading', 15 loadingInner: '', // e.g '<img src="loading.svg" />' 16 timeout: true, 17 timeoutCountdown: 3000, 18 onLoadEvent: true, 19 browser: [ 'animation-duration', '-webkit-animation-duration'], 20 // "browser" option allows you to disable the "animsition" in case the css property in the array is not supported by your browser. 21 // The default setting is to disable the "animsition" in a browser that does not support "animation-duration". 22 overlay : false, 23 overlayClass : 'animsition-overlay-slide', 24 overlayParentElement : 'body', 25 transition: function(url){ window.location.href = url; } 26 }); 27 28 //== Temporary 29 $( '.js-section-accordion' ).click( function(){ 30 $( this ).next().slideToggle(); 31 }); 32 33 //== Navigation 34 var navigationOpen = false; 35 36 var $navigation = $('.l-navigation'); 37 var $navigationMenu = $('.p-menu--site'); 38 var $navigationMenuItems = $navigation.find('.p-menu__item'); 39 40 var openNavigationTimeline = gsap.timeline({ paused: true }); 41 var closeNavigationTimeline = gsap.timeline({ paused: true }); 42 43 function openNavigation() { 44 $( '.navigation' ).addClass( 'is-open' ); 45 46 openNavigationTimeline.to('.site', 0.6, { x: '-' + $('.navigation').outerWidth(), ease:Expo.easeOut}) 47 .to('.l-header__navigation__button', 0.2, { autoAlpha: 0, ease:Expo.easeOut, onComplete: onOpenNavigationComplete}); 48 49 openNavigationTimeline.play(); 50 } 51 52 function closeNavigation() { 53 $( '.navigation' ).removeClass( 'is-open' ); 54 55 closeNavigationTimeline.to('.site', 0.6, { x: '0', ease:Expo.easeOut}) 56 .to('.l-header__navigation__button', 0.2, { autoAlpha: 1, ease:Expo.easeOut, onComplete: onCloseNavigationComplete}); 57 58 closeNavigationTimeline.play(); 59 } 60 61 function onOpenNavigationComplete() { 62 $BODY.addClass('has-navigation-visible'); 63 } 64 65 function onCloseNavigationComplete() { 66 $BODY.removeClass('has-navigation-visible'); 67 $( '.site' ).attr( 'style','' ); 68 } 69 70 $('.js-navigation-open').on('click', function(e){ 71 openNavigation(); 72 e.preventDefault(); 73 }); 74 75 $( '.js-navigation-close' ).on( 'click', function(e){ 76 closeNavigation(); 77 e.preventDefault(); 78 }); 79 80 $( '.p-menu--site .p-menu__item__link').click(function(e) { 81 closeNavigation(); 82 }); 83 84 //== Popup 85 window.showPopup = function() { 86 if ( $( '.l-popup' ).length ) { 87 var $popup = $( '.l-popup' ); 88 89 if ( $popup.data( 'enabled' ) == "yes" ) { 90 var name = $popup.data( 'name' ); 91 var expires = $popup.data( 'expires' ); 92 93 if ( $popup.data( 'expires' ) == 0 ) { 94 $popup.addClass( 'is-visible' ); 95 } 96
97 if ( !Cookies.get(name) ) { 98 if ( expires > 0 ) { 99 Cookies.set(name, 'true', { expires: expires }); 100 } 101 102 $popup.addClass( 'is-visible' ); 103 } 104 105 // The close button 106 $( '.js-popup-close' ).click( function() { 107 $popup.removeClass( 'is-visible' ); 108 }); 109 110 // Pressing the esc 111 $(document).keydown(function(e) { 112 if (e.keyCode == 27) { 113 $popup.removeClass( 'is-visible' ); 114 } 115 }); 116 } 117 118 } 119 } 120});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.