/*
spectral by html5 up
html5up.net | @ajlkn
free for personal and commercial use under the cca 3.0 license (html5up.net/license)
*/
(function ($) {
history.pushstate(null, null, location.href);
console.log(123);
window.onpopstate = function (event) {
history.go(1);
};
var $window = $(window),
$body = $('body'),
$wrapper = $('#page-wrapper'),
$banner = $('#banner'),
$header = $('#header');
// breakpoints.
breakpoints({
xlarge: ['1281px', '1680px'],
large: ['981px', '1280px'],
medium: ['737px', '980px'],
small: ['481px', '736px'],
xsmall: [null, '480px']
});
// play initial animations on page load.
$window.on('load', function () {
window.settimeout(function () {
$body.removeclass('is-preload');
}, 100);
});
// mobile?
if (browser.mobile)
$body.addclass('is-mobile');
else {
breakpoints.on('>medium', function () {
$body.removeclass('is-mobile');
});
breakpoints.on('<=medium', function () {
$body.addclass('is-mobile');
});
}
// scrolly.
$('.scrolly')
.scrolly({
speed: 500,
// offset: $header.outerheight()
});
// menu.
$('#menu')
.append('')
.appendto($body)
.panel({
delay: 500,
hideonclick: true,
hideonswipe: true,
resetscroll: true,
resetforms: true,
side: 'right',
target: $body,
visibleclass: 'is-menu-visible'
});
if ($banner.length > 0
&& $header.hasclass('alt')) {
$window.on('resize', function () { $window.trigger('scroll'); });
$banner.scrollex({
bottom: $header.outerheight() + 1,
terminate: function () { $header.removeclass('alt'); },
enter: function () { $header.addclass('alt'); },
leave: function () { $header.removeclass('alt'); }
});
}
})(jquery);