/* Massively by HTML5 UP html5up.net | @ajlkn Free for personal and commercial use under the CCA 3.0 license (html5up.net/license) */ (function($) { //skel.breakpoints({ //xlarge: '(max-width: 1680px)', //large: '(max-width: 1280px)', //medium: '(max-width: 980px)', //small: '(max-width: 736px)', //xsmall: '(max-width: 480px)', //xxsmall: '(max-width: 360px)' //}); skel.breakpoints({ xlarge: '(max-width: 1680px)', large: '(max-width: 1280px)', medium: '(max-width: 980px)', small: '(max-width: 736px)', xsmall: '(max-width: 480px)', xxsmall: '(max-width: 360px)' }); /** * Applies parallax scrolling to an element's background image. * @return {jQuery} jQuery object. */ $.fn._parallax = function(intensity) { var $window = $(window), $this = $(this); if (this.length == 0 || intensity === 0) return $this; if (this.length > 1) { for (var i=0; i < this.length; i++) $(this[i])._parallax(intensity); return $this; } if (!intensity) intensity = 0.25; $this.each(function() { var $t = $(this), $bg = $('
').appendTo($t), on, off; on = function() { $bg .removeClass('fixed') .css('transform', 'matrix(1,0,0,1,0,0)'); $window .on('scroll._parallax', function() { var pos = parseInt($window.scrollTop()) - parseInt($t.position().top); $bg.css('transform', 'matrix(1,0,0,1,0,' + (pos * intensity) + ')'); }); }; off = function() { $bg .addClass('fixed') .css('transform', 'none'); $window .off('scroll._parallax'); }; // Disable parallax on .. if (skel.vars.browser == 'ie' // IE || skel.vars.browser == 'edge' // Edge || window.devicePixelRatio > 1 // Retina/HiDPI (= poor performance) || skel.vars.mobile) // Mobile devices off(); // Enable everywhere else. else { skel.on('!large -large', on); skel.on('+large', off); } }); $window .off('load._parallax resize._parallax') .on('load._parallax resize._parallax', function() { $window.trigger('scroll'); }); return $(this); }; $(function() { var $window = $(window), $body = $('body'), $wrapper = $('#wrapper'), $header = $('#header'), $nav = $('#nav'), $main = $('#middleArea'), $navPanelToggle, $navPanel, $navPanelInner; // Disable animations/transitions until the page has loaded. $window.on('load', function() { window.setTimeout(function() { $body.removeClass('is-loading'); }, 100); }); // Prioritize "important" elements on medium. skel.on('+medium -medium', function() { $.prioritize( '.important\\28 medium\\29', skel.breakpoint('medium').active ); }); // Scrolly. $('.scrolly').scrolly(); // Background. $wrapper._parallax(0.925); // Nav Panel. // Toggle. $navPanelToggle = $( 'Menu' ) .appendTo($wrapper); // Change toggle styling once we've scrolled past the header. $header.scrollex({ bottom: '5vh', enter: function() { $navPanelToggle.removeClass('alt'); }, leave: function() { $navPanelToggle.addClass('alt'); } }); // Panel. $navPanel = $( '' ) .appendTo($body) .panel({ delay: 500, hideOnClick: true, hideOnSwipe: true, resetScroll: true, resetForms: true, side: 'right', target: $body, visibleClass: 'is-navPanel-visible' }); // Get inner. $navPanelInner = $navPanel.children('nav'); // Move nav content on breakpoint change. var $navContent = $nav.children(); skel.on('!medium -medium', function() { // NavPanel -> Nav. $navContent.appendTo($nav); // Flip icon classes. $nav.find('.icons, .icon') .removeClass('alt'); }); skel.on('+medium', function() { // Nav -> NavPanel. $navContent.appendTo($navPanelInner); // Flip icon classes. $navPanelInner.find('.icons, .icon') .addClass('alt'); }); // Hack: Disable transitions on WP. if (skel.vars.os == 'wp' && skel.vars.osVersion < 10) $navPanel .css('transition', 'none'); // Intro. var $intro = $('#intro'); if ($intro.length > 0) { // Hack: Fix flex min-height on IE. if (skel.vars.browser == 'ie') { $window.on('resize.ie-intro-fix', function() { var h = $intro.height(); if (h > $window.height()) $intro.css('height', 'auto'); else $intro.css('height', h); }).trigger('resize.ie-intro-fix'); } // Hide intro on scroll (> small). skel.on('!small -small', function() { $main.unscrollex(); $main.scrollex({ mode: 'bottom', top: '25vh', bottom: '-50vh', enter: function() { $intro.addClass('hidden'); }, leave: function() { $intro.removeClass('hidden'); } }); }); // Hide intro on scroll (<= small). skel.on('+small', function() { $main.unscrollex(); $main.scrollex({ mode: 'middle', top: '15vh', bottom: '-15vh', enter: function() { $intro.addClass('hidden'); }, leave: function() { $intro.removeClass('hidden'); } }); }); } }); //})(jQuery); //(function($) { var $window = $(window), $body = $('body'), $header = $('#header'), $all = $body.add($header); // Breakpoints. //skel.breakpoints({ //xxlarge: [ '1681px', '1920px' ], //xlarge: [ '1281px', '1680px' ], //large: [ '1001px', '1280px' ], //medium: [ '737px', '1000px' ], //small: [ '481px', '736px' ], //xsmall: [ null, '480px' ] //}); // Play initial animations on page load. //$window.on('load', function() { //setTimeout(function() { //$body.removeClass('is-preload'); //}, 100); //}); // Touch mode. if (browser.mobile) $body.addClass('is-touch'); else { skel.on('<=small', function() { $body.addClass('is-touch'); }); skel.on('>small', function() { $body.removeClass('is-touch'); }); } // Fix: IE flexbox fix. if (browser.name == 'ie') { var $main = $('.main.fullscreen'), IEResizeTimeout; $window .on('resize.ie-flexbox-fix', function() { clearTimeout(IEResizeTimeout); IEResizeTimeout = setTimeout(function() { var wh = $window.height(); $main.each(function() { var $this = $(this); $this.css('height', ''); if ($this.height() <= wh) $this.css('height', (wh - 50) + 'px'); }); }); }) .triggerHandler('resize.ie-flexbox-fix'); } // Gallery. $window.on('load', function() { var $gallery = $('.gallery'); $gallery.poptrox({ baseZIndex: 10001, useBodyOverflow: false, usePopupEasyClose: false, overlayColor: '#000', overlayOpacity: 0.9, usePopupDefaultStyling: false, //usePopupCaption: true, usePopupCaption: false, popupLoaderText: '', windowMargin: 50, usePopupNav: true }); // Hack: Adjust margins when 'small' activates. skel.on('>small', function() { $gallery.each(function() { $(this)[0]._poptrox.windowMargin = 50; }); }); skel.on('<=small', function() { $gallery.each(function() { $(this)[0]._poptrox.windowMargin = 5; }); }); }); // Section transitions. if (browser.canUse('transition')) { var on = function() { // Galleries. $('.gallery') .scrollex({ top: '30vh', bottom: '30vh', delay: 50, initialize: function() { $(this).addClass('inactive'); }, terminate: function() { $(this).removeClass('inactive'); }, enter: function() { $(this).removeClass('inactive'); }, leave: function() { $(this).addClass('inactive'); } }); // Generic sections. //$('.main.style1') //.scrollex({ //mode: 'middle', //delay: 100, //initialize: function() { $(this).addClass('inactive'); }, //terminate: function() { $(this).removeClass('inactive'); }, //enter: function() { $(this).removeClass('inactive'); }, //leave: function() { $(this).addClass('inactive'); } //}); //$('.main.style2') //.scrollex({ //mode: 'middle', //delay: 100, //initialize: function() { $(this).addClass('inactive'); }, //terminate: function() { $(this).removeClass('inactive'); }, //enter: function() { $(this).removeClass('inactive'); }, //leave: function() { $(this).addClass('inactive'); } //}); // Contact. //$('#contact') //.scrollex({ //top: '50%', //delay: 50, //initialize: function() { $(this).addClass('inactive'); }, //terminate: function() { $(this).removeClass('inactive'); }, //enter: function() { $(this).removeClass('inactive'); }, //leave: function() { $(this).addClass('inactive'); } //}); }; var off = function() { // Galleries. $('.gallery') .unscrollex(); // Generic sections. //$('.main.style1') //.unscrollex(); //$('.main.style2') //.unscrollex(); // Contact. //$('#contact') //.unscrollex(); }; //skel.on('<=small', off); //skel.on('>small', on); } // Events. //var resizeTimeout, resizeScrollTimeout; //$window //.on('resize', function() { // Disable animations/transitions. //$body.addClass('is-resizing'); //clearTimeout(resizeTimeout); //resizeTimeout = setTimeout(function() { // Update scrolly links. //$('a[href^="#"]').scrolly({ //speed: 1500, //offset: $header.outerHeight() - 1 //}); // Re-enable animations/transitions. //setTimeout(function() { //$body.removeClass('is-resizing'); //$window.trigger('scroll'); //}, 0); //}, 100); //}) //.on('load', function() { //$window.trigger('resize'); //}); })(jQuery);