0e03888deca70a7722bb0ffa560c4999707bced0
4 Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
9 var $window
= $(window
),
11 $wrapper
= $('#wrapper'),
12 $header
= $('#header'),
13 $btt
= $('#backtotop'),
14 $banner
= $('#banner');
18 xlarge
: ['1281px', '1680px' ],
19 large
: ['981px', '1280px' ],
20 medium
: ['737px', '980px' ],
21 small
: ['481px', '736px' ],
22 xsmall
: ['361px', '480px' ],
23 xxsmall
: [null, '360px' ]
27 * Applies parallax scrolling to an element's background image.
28 * @return {jQuery} jQuery object.
30 $.fn
._parallax
= (browser
.name
== 'ie' || browser
.name
== 'edge' || browser
.mobile
) ? function() { return $(this) } : function(intensity
) {
32 var $window
= $(window
),
35 if (this.length
== 0 || intensity
=== 0)
38 if (this.length
> 1) {
40 for (var i
=0; i
< this.length
; i
++)
41 $(this[i
])._parallax(intensity
);
50 $this.each(function() {
57 $t
.css('background-position', 'center 100%, center 100%, center 0px');
60 .on('scroll._parallax', function() {
62 var pos
= parseInt($window
.scrollTop()) - parseInt($t
.position().top
);
64 $t
.css('background-position', 'center ' + (pos
* (-1 * intensity
)) + 'px');
73 .css('background-position', '');
76 .off('scroll._parallax');
80 breakpoints
.on('<=medium', off
);
81 breakpoints
.on('>medium', on
);
86 .off('load._parallax resize._parallax')
87 .on('load._parallax resize._parallax', function() {
88 $window
.trigger('scroll');
95 // Play initial animations on page load.
96 $window
.on('load', function() {
97 window
.setTimeout(function() {
98 $body
.removeClass('is-preload');
102 // Clear transitioning state on unload/hide.
103 $window
.on('unload pagehide', function() {
104 window
.setTimeout(function() {
105 $('.is-transitioning').removeClass('is-transitioning');
109 // Fix: Enable IE-only tweaks.
110 if (browser
.name
== 'ie' || browser
.name
== 'edge')
111 $body
.addClass('is-ie');
114 $('.scrolly').scrolly({
116 return $header
.height() - 2;
121 var $tiles
= $('.tiles > article');
123 $tiles
.each(function() {
126 $image
= $this.find('.image'), $img
= $image
.find('img'),
127 $link
= $this.find('.link'),
133 $this.css('background-image', 'url(' + $img
.attr('src') + ')');
136 if (x
= $img
.data('position'))
137 $image
.css('background-position', x
);
143 if ($link
.length
> 0) {
150 $link
= $link
.add($x
);
152 $link
.on('click', function(event
) {
154 var href
= $link
.attr('href');
157 event
.stopPropagation();
158 event
.preventDefault();
161 if ($link
.attr('target') == '_blank') {
171 // Start transitioning.
172 $this.addClass('is-transitioning');
173 $wrapper
.addClass('is-transitioning');
176 window
.setTimeout(function() {
177 location
.href
= href
;
189 if ($banner
.length
> 0
190 && $header
.hasClass('alt')) {
192 $window
.on('resize', function() {
193 $window
.trigger('scroll');
196 $window
.on('load', function() {
199 bottom
: $header
.height() + 10,
200 terminate: function() { $header
.removeClass('alt'); },
201 enter: function() { $header
.addClass('alt'); },
202 leave: function() { $header
.removeClass('alt'); $header
.addClass('reveal'); }
205 window
.setTimeout(function() {
206 $window
.triggerHandler('scroll');
214 $banner
.each(function() {
217 $image
= $this.find('.image'), $img
= $image
.find('img');
220 $this._parallax(0.275);
223 if ($image
.length
> 0) {
226 $this.css('background-image', 'url(' + $img
.attr('src') + ')');
236 var $menu
= $('#menu'),
239 $menu
.wrapInner('<div class="inner"></div>');
240 $menuInner
= $menu
.children('.inner');
241 $menu
._locked
= false;
243 $menu
._lock = function() {
248 $menu
._locked
= true;
250 window
.setTimeout(function() {
251 $menu
._locked
= false;
258 $menu
._show = function() {
261 $body
.addClass('is-menu-visible');
265 $menu
._hide = function() {
268 $body
.removeClass('is-menu-visible');
272 $menu
._toggle = function() {
275 $body
.toggleClass('is-menu-visible');
280 .on('click', function(event
) {
281 event
.stopPropagation();
283 .on('click', 'a', function(event
) {
285 var href
= $(this).attr('href');
287 event
.preventDefault();
288 event
.stopPropagation();
294 window
.setTimeout(function() {
295 window
.location
.href
= href
;
302 .on('click', function(event
) {
304 event
.stopPropagation();
305 event
.preventDefault();
307 $body
.removeClass('is-menu-visible');
310 .append('<a class="close" href="#menu">Close</a>');
313 .on('click', 'a[href="#menu"]', function(event
) {
315 event
.stopPropagation();
316 event
.preventDefault();
322 .on('click', function(event
) {
328 .on('keydown', function(event
) {
331 if (event
.keyCode
== 27)
337 $(window
).scroll( function(){
338 if( $(window
).scrollTop() > 150 ){
339 $btt
.removeClass("hidden");
341 $btt
.addClass("hidden");