52 lines
1.1 KiB
JavaScript
52 lines
1.1 KiB
JavaScript
(function($) {
|
|
|
|
var $window = $(window),
|
|
$body = $('body'),
|
|
$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);
|
|
});
|
|
|
|
// Scrolly.
|
|
$('.scrolly').scrolly({
|
|
offset: function() { return $header.outerHeight() }
|
|
});
|
|
|
|
// Menu.
|
|
$('#menu')
|
|
.append('<a href="#menu" class="close"></a>')
|
|
.appendTo($body)
|
|
.panel({
|
|
delay: 500,
|
|
hideOnClick: true,
|
|
hideOnSwipe: true,
|
|
resetScroll: true,
|
|
resetForms: true,
|
|
side: 'right'
|
|
});
|
|
|
|
// Header.
|
|
$window.on('resize', function() { $window.trigger('scroll'); });
|
|
|
|
$body.scrollex({
|
|
top: '25vh',
|
|
mode: 'top',
|
|
enter: function() { $header.addClass('alt'); },
|
|
leave: function() { $header.removeClass('alt'); }
|
|
});
|
|
|
|
})(jQuery);
|