Add frontend assets and plugin bundles
Add the legacy frontend themes, scripts, and plugin assets required by the main SPOTA interfaces.
This commit is contained in:
7
asetlanding/js/bootstrap.min.js
vendored
Normal file
7
asetlanding/js/bootstrap.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
4
asetlanding/js/jquery-min.js
vendored
Normal file
4
asetlanding/js/jquery-min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
8
asetlanding/js/jquery.counterup.min.js
vendored
Normal file
8
asetlanding/js/jquery.counterup.min.js
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
/*!
|
||||
* jquery.counterup.js 1.0
|
||||
*
|
||||
* Copyright 2013, Benjamin Intal http://gambit.ph @bfintal
|
||||
* Released under the GPL v2 License
|
||||
*
|
||||
* Date: Nov 26, 2013
|
||||
*/(function(e){"use strict";e.fn.counterUp=function(t){var n=e.extend({time:400,delay:10},t);return this.each(function(){var t=e(this),r=n,i=function(){var e=[],n=r.time/r.delay,i=t.text(),s=/[0-9]+,[0-9]+/.test(i);i=i.replace(/,/g,"");var o=/^[0-9]+$/.test(i),u=/^[0-9]+\.[0-9]+$/.test(i),a=u?(i.split(".")[1]||[]).length:0;for(var f=n;f>=1;f--){var l=parseInt(i/n*f);u&&(l=parseFloat(i/n*f).toFixed(a));if(s)while(/(\d+)(\d{3})/.test(l.toString()))l=l.toString().replace(/(\d+)(\d{3})/,"$1,$2");e.unshift(l)}t.data("counterup-nums",e);t.text("0");var c=function(){t.text(t.data("counterup-nums").shift());if(t.data("counterup-nums").length)setTimeout(t.data("counterup-func"),r.delay);else{delete t.data("counterup-nums");t.data("counterup-nums",null);t.data("counterup-func",null)}};t.data("counterup-func",c);setTimeout(t.data("counterup-func"),r.delay)};t.waypoint(i,{offset:"100%",triggerOnce:!0})})}})(jQuery);
|
||||
205
asetlanding/js/jquery.easing.min.js
vendored
Normal file
205
asetlanding/js/jquery.easing.min.js
vendored
Normal file
@@ -0,0 +1,205 @@
|
||||
/*
|
||||
* jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
|
||||
*
|
||||
* Uses the built in easing capabilities added In jQuery 1.1
|
||||
* to offer multiple easing options
|
||||
*
|
||||
* TERMS OF USE - jQuery Easing
|
||||
*
|
||||
* Open source under the BSD License.
|
||||
*
|
||||
* Copyright © 2008 George McGinley Smith
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* Neither the name of the author nor the names of contributors may be used to endorse
|
||||
* or promote products derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
// t: current time, b: begInnIng value, c: change In value, d: duration
|
||||
jQuery.easing['jswing'] = jQuery.easing['swing'];
|
||||
|
||||
jQuery.extend( jQuery.easing,
|
||||
{
|
||||
def: 'easeOutQuad',
|
||||
swing: function (x, t, b, c, d) {
|
||||
//alert(jQuery.easing.default);
|
||||
return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
|
||||
},
|
||||
easeInQuad: function (x, t, b, c, d) {
|
||||
return c*(t/=d)*t + b;
|
||||
},
|
||||
easeOutQuad: function (x, t, b, c, d) {
|
||||
return -c *(t/=d)*(t-2) + b;
|
||||
},
|
||||
easeInOutQuad: function (x, t, b, c, d) {
|
||||
if ((t/=d/2) < 1) return c/2*t*t + b;
|
||||
return -c/2 * ((--t)*(t-2) - 1) + b;
|
||||
},
|
||||
easeInCubic: function (x, t, b, c, d) {
|
||||
return c*(t/=d)*t*t + b;
|
||||
},
|
||||
easeOutCubic: function (x, t, b, c, d) {
|
||||
return c*((t=t/d-1)*t*t + 1) + b;
|
||||
},
|
||||
easeInOutCubic: function (x, t, b, c, d) {
|
||||
if ((t/=d/2) < 1) return c/2*t*t*t + b;
|
||||
return c/2*((t-=2)*t*t + 2) + b;
|
||||
},
|
||||
easeInQuart: function (x, t, b, c, d) {
|
||||
return c*(t/=d)*t*t*t + b;
|
||||
},
|
||||
easeOutQuart: function (x, t, b, c, d) {
|
||||
return -c * ((t=t/d-1)*t*t*t - 1) + b;
|
||||
},
|
||||
easeInOutQuart: function (x, t, b, c, d) {
|
||||
if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
|
||||
return -c/2 * ((t-=2)*t*t*t - 2) + b;
|
||||
},
|
||||
easeInQuint: function (x, t, b, c, d) {
|
||||
return c*(t/=d)*t*t*t*t + b;
|
||||
},
|
||||
easeOutQuint: function (x, t, b, c, d) {
|
||||
return c*((t=t/d-1)*t*t*t*t + 1) + b;
|
||||
},
|
||||
easeInOutQuint: function (x, t, b, c, d) {
|
||||
if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
|
||||
return c/2*((t-=2)*t*t*t*t + 2) + b;
|
||||
},
|
||||
easeInSine: function (x, t, b, c, d) {
|
||||
return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
|
||||
},
|
||||
easeOutSine: function (x, t, b, c, d) {
|
||||
return c * Math.sin(t/d * (Math.PI/2)) + b;
|
||||
},
|
||||
easeInOutSine: function (x, t, b, c, d) {
|
||||
return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
|
||||
},
|
||||
easeInExpo: function (x, t, b, c, d) {
|
||||
return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
|
||||
},
|
||||
easeOutExpo: function (x, t, b, c, d) {
|
||||
return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
|
||||
},
|
||||
easeInOutExpo: function (x, t, b, c, d) {
|
||||
if (t==0) return b;
|
||||
if (t==d) return b+c;
|
||||
if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
|
||||
return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
|
||||
},
|
||||
easeInCirc: function (x, t, b, c, d) {
|
||||
return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
|
||||
},
|
||||
easeOutCirc: function (x, t, b, c, d) {
|
||||
return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
|
||||
},
|
||||
easeInOutCirc: function (x, t, b, c, d) {
|
||||
if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
|
||||
return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
|
||||
},
|
||||
easeInElastic: function (x, t, b, c, d) {
|
||||
var s=1.70158;var p=0;var a=c;
|
||||
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
|
||||
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
||||
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
||||
return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
|
||||
},
|
||||
easeOutElastic: function (x, t, b, c, d) {
|
||||
var s=1.70158;var p=0;var a=c;
|
||||
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
|
||||
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
||||
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
||||
return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
|
||||
},
|
||||
easeInOutElastic: function (x, t, b, c, d) {
|
||||
var s=1.70158;var p=0;var a=c;
|
||||
if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
|
||||
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
||||
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
||||
if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
|
||||
return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
|
||||
},
|
||||
easeInBack: function (x, t, b, c, d, s) {
|
||||
if (s == undefined) s = 1.70158;
|
||||
return c*(t/=d)*t*((s+1)*t - s) + b;
|
||||
},
|
||||
easeOutBack: function (x, t, b, c, d, s) {
|
||||
if (s == undefined) s = 1.70158;
|
||||
return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
|
||||
},
|
||||
easeInOutBack: function (x, t, b, c, d, s) {
|
||||
if (s == undefined) s = 1.70158;
|
||||
if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
|
||||
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
|
||||
},
|
||||
easeInBounce: function (x, t, b, c, d) {
|
||||
return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
|
||||
},
|
||||
easeOutBounce: function (x, t, b, c, d) {
|
||||
if ((t/=d) < (1/2.75)) {
|
||||
return c*(7.5625*t*t) + b;
|
||||
} else if (t < (2/2.75)) {
|
||||
return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
|
||||
} else if (t < (2.5/2.75)) {
|
||||
return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
|
||||
} else {
|
||||
return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
|
||||
}
|
||||
},
|
||||
easeInOutBounce: function (x, t, b, c, d) {
|
||||
if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
|
||||
return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
|
||||
}
|
||||
});
|
||||
|
||||
/*
|
||||
*
|
||||
* TERMS OF USE - EASING EQUATIONS
|
||||
*
|
||||
* Open source under the BSD License.
|
||||
*
|
||||
* Copyright © 2001 Robert Penner
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* Neither the name of the author nor the names of contributors may be used to endorse
|
||||
* or promote products derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
223
asetlanding/js/jquery.nav.js
Normal file
223
asetlanding/js/jquery.nav.js
Normal file
@@ -0,0 +1,223 @@
|
||||
/*
|
||||
* jQuery One Page Nav Plugin
|
||||
* http://github.com/davist11/jQuery-One-Page-Nav
|
||||
*
|
||||
* Copyright (c) 2010 Trevor Davis (http://trevordavis.net)
|
||||
* Dual licensed under the MIT and GPL licenses.
|
||||
* Uses the same license as jQuery, see:
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* @version 3.0.0
|
||||
*
|
||||
* Example usage:
|
||||
* $('#nav').onePageNav({
|
||||
* currentClass: 'current',
|
||||
* changeHash: false,
|
||||
* scrollSpeed: 750
|
||||
* });
|
||||
*/
|
||||
|
||||
;(function($, window, document, undefined){
|
||||
|
||||
// our plugin constructor
|
||||
var OnePageNav = function(elem, options){
|
||||
this.elem = elem;
|
||||
this.$elem = $(elem);
|
||||
this.options = options;
|
||||
this.metadata = this.$elem.data('plugin-options');
|
||||
this.$win = $(window);
|
||||
this.sections = {};
|
||||
this.didScroll = false;
|
||||
this.$doc = $(document);
|
||||
this.docHeight = this.$doc.height();
|
||||
};
|
||||
|
||||
// the plugin prototype
|
||||
OnePageNav.prototype = {
|
||||
defaults: {
|
||||
navItems: 'a',
|
||||
currentClass: 'current',
|
||||
changeHash: false,
|
||||
easing: 'swing',
|
||||
filter: '',
|
||||
scrollSpeed: 750,
|
||||
scrollThreshold: 0.5,
|
||||
begin: false,
|
||||
end: false,
|
||||
scrollChange: false
|
||||
},
|
||||
|
||||
init: function() {
|
||||
// Introduce defaults that can be extended either
|
||||
// globally or using an object literal.
|
||||
this.config = $.extend({}, this.defaults, this.options, this.metadata);
|
||||
|
||||
this.$nav = this.$elem.find(this.config.navItems);
|
||||
|
||||
//Filter any links out of the nav
|
||||
if(this.config.filter !== '') {
|
||||
this.$nav = this.$nav.filter(this.config.filter);
|
||||
}
|
||||
|
||||
//Handle clicks on the nav
|
||||
this.$nav.on('click.onePageNav', $.proxy(this.handleClick, this));
|
||||
|
||||
//Get the section positions
|
||||
this.getPositions();
|
||||
|
||||
//Handle scroll changes
|
||||
this.bindInterval();
|
||||
|
||||
//Update the positions on resize too
|
||||
this.$win.on('resize.onePageNav', $.proxy(this.getPositions, this));
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
adjustNav: function(self, $parent) {
|
||||
self.$elem.find('.' + self.config.currentClass).removeClass(self.config.currentClass);
|
||||
$parent.addClass(self.config.currentClass);
|
||||
},
|
||||
|
||||
bindInterval: function() {
|
||||
var self = this;
|
||||
var docHeight;
|
||||
|
||||
self.$win.on('scroll.onePageNav', function() {
|
||||
self.didScroll = true;
|
||||
});
|
||||
|
||||
self.t = setInterval(function() {
|
||||
docHeight = self.$doc.height();
|
||||
|
||||
//If it was scrolled
|
||||
if(self.didScroll) {
|
||||
self.didScroll = false;
|
||||
self.scrollChange();
|
||||
}
|
||||
|
||||
//If the document height changes
|
||||
if(docHeight !== self.docHeight) {
|
||||
self.docHeight = docHeight;
|
||||
self.getPositions();
|
||||
}
|
||||
}, 250);
|
||||
},
|
||||
|
||||
getHash: function($link) {
|
||||
return $link.attr('href').split('#')[1];
|
||||
},
|
||||
|
||||
getPositions: function() {
|
||||
var self = this;
|
||||
var linkHref;
|
||||
var topPos;
|
||||
var $target;
|
||||
|
||||
self.$nav.each(function() {
|
||||
linkHref = self.getHash($(this));
|
||||
$target = $('#' + linkHref);
|
||||
|
||||
if($target.length) {
|
||||
topPos = $target.offset().top;
|
||||
self.sections[linkHref] = Math.round(topPos);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
getSection: function(windowPos) {
|
||||
var returnValue = null;
|
||||
var windowHeight = Math.round(this.$win.height() * this.config.scrollThreshold);
|
||||
|
||||
for(var section in this.sections) {
|
||||
if((this.sections[section] - windowHeight) < windowPos) {
|
||||
returnValue = section;
|
||||
}
|
||||
}
|
||||
|
||||
return returnValue;
|
||||
},
|
||||
|
||||
handleClick: function(e) {
|
||||
var self = this;
|
||||
var $link = $(e.currentTarget);
|
||||
var $parent = $link.parent();
|
||||
var newLoc = '#' + self.getHash($link);
|
||||
|
||||
if(!$parent.hasClass(self.config.currentClass)) {
|
||||
//Start callback
|
||||
if(self.config.begin) {
|
||||
self.config.begin();
|
||||
}
|
||||
|
||||
//Change the highlighted nav item
|
||||
self.adjustNav(self, $parent);
|
||||
|
||||
//Removing the auto-adjust on scroll
|
||||
self.unbindInterval();
|
||||
|
||||
//Scroll to the correct position
|
||||
self.scrollTo(newLoc, function() {
|
||||
//Do we need to change the hash?
|
||||
if(self.config.changeHash) {
|
||||
window.location.hash = newLoc;
|
||||
}
|
||||
|
||||
//Add the auto-adjust on scroll back in
|
||||
self.bindInterval();
|
||||
|
||||
//End callback
|
||||
if(self.config.end) {
|
||||
self.config.end();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
e.preventDefault();
|
||||
},
|
||||
|
||||
scrollChange: function() {
|
||||
var windowTop = this.$win.scrollTop();
|
||||
var position = this.getSection(windowTop);
|
||||
var $parent;
|
||||
|
||||
//If the position is set
|
||||
if(position !== null) {
|
||||
$parent = this.$elem.find('a[href$="#' + position + '"]').parent();
|
||||
|
||||
//If it's not already the current section
|
||||
if(!$parent.hasClass(this.config.currentClass)) {
|
||||
//Change the highlighted nav item
|
||||
this.adjustNav(this, $parent);
|
||||
|
||||
//If there is a scrollChange callback
|
||||
if(this.config.scrollChange) {
|
||||
this.config.scrollChange($parent);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
scrollTo: function(target, callback) {
|
||||
var offset = $(target).offset().top;
|
||||
|
||||
$('html, body').animate({
|
||||
scrollTop: offset
|
||||
}, this.config.scrollSpeed, this.config.easing, callback);
|
||||
},
|
||||
|
||||
unbindInterval: function() {
|
||||
clearInterval(this.t);
|
||||
this.$win.unbind('scroll.onePageNav');
|
||||
}
|
||||
};
|
||||
|
||||
OnePageNav.defaults = OnePageNav.prototype.defaults;
|
||||
|
||||
$.fn.onePageNav = function(options) {
|
||||
return this.each(function() {
|
||||
new OnePageNav(this, options).init();
|
||||
});
|
||||
};
|
||||
|
||||
})( jQuery, window , document );
|
||||
471
asetlanding/js/jquery.slicknav.js
Normal file
471
asetlanding/js/jquery.slicknav.js
Normal file
@@ -0,0 +1,471 @@
|
||||
/*!
|
||||
* SlickNav Responsive Mobile Menu v1.0.4
|
||||
* (c) 2015 Josh Cope
|
||||
* licensed under MIT
|
||||
*/
|
||||
;(function ($, document, window) {
|
||||
var
|
||||
// default settings object.
|
||||
defaults = {
|
||||
label: 'MENU',
|
||||
duplicate: true,
|
||||
duration: 200,
|
||||
easingOpen: 'swing',
|
||||
easingClose: 'swing',
|
||||
closedSymbol: '►',
|
||||
openedSymbol: '▼',
|
||||
prependTo: 'body',
|
||||
parentTag: 'a',
|
||||
closeOnClick: false,
|
||||
allowParentLinks: false,
|
||||
nestedParentLinks: true,
|
||||
showChildren: false,
|
||||
removeIds: false,
|
||||
removeClasses: false,
|
||||
brand: '',
|
||||
init: function () {},
|
||||
beforeOpen: function () {},
|
||||
beforeClose: function () {},
|
||||
afterOpen: function () {},
|
||||
afterClose: function () {}
|
||||
},
|
||||
mobileMenu = 'slicknav',
|
||||
prefix = 'slicknav';
|
||||
|
||||
function Plugin(element, options) {
|
||||
this.element = element;
|
||||
|
||||
// jQuery has an extend method which merges the contents of two or
|
||||
// more objects, storing the result in the first object. The first object
|
||||
// is generally empty as we don't want to alter the default options for
|
||||
// future instances of the plugin
|
||||
this.settings = $.extend({}, defaults, options);
|
||||
|
||||
this._defaults = defaults;
|
||||
this._name = mobileMenu;
|
||||
|
||||
this.init();
|
||||
}
|
||||
|
||||
Plugin.prototype.init = function () {
|
||||
var $this = this,
|
||||
menu = $(this.element),
|
||||
settings = this.settings,
|
||||
iconClass,
|
||||
menuBar;
|
||||
|
||||
// clone menu if needed
|
||||
if (settings.duplicate) {
|
||||
$this.mobileNav = menu.clone();
|
||||
//remove ids from clone to prevent css issues
|
||||
$this.mobileNav.removeAttr('id');
|
||||
$this.mobileNav.find('*').each(function (i, e) {
|
||||
$(e).removeAttr('id');
|
||||
});
|
||||
} else {
|
||||
$this.mobileNav = menu;
|
||||
|
||||
// remove ids if set
|
||||
$this.mobileNav.removeAttr('id');
|
||||
$this.mobileNav.find('*').each(function (i, e) {
|
||||
$(e).removeAttr('id');
|
||||
});
|
||||
}
|
||||
|
||||
// remove classes if set
|
||||
if (settings.removeClasses) {
|
||||
$this.mobileNav.removeAttr('class');
|
||||
$this.mobileNav.find('*').each(function (i, e) {
|
||||
$(e).removeAttr('class');
|
||||
});
|
||||
}
|
||||
|
||||
// styling class for the button
|
||||
iconClass = prefix + '_icon';
|
||||
|
||||
if (settings.label === '') {
|
||||
iconClass += ' ' + prefix + '_no-text';
|
||||
}
|
||||
|
||||
if (settings.parentTag == 'a') {
|
||||
settings.parentTag = 'a href="#"';
|
||||
}
|
||||
|
||||
// create menu bar
|
||||
$this.mobileNav.attr('class', prefix + '_nav');
|
||||
menuBar = $('<div class="' + prefix + '_menu"></div>');
|
||||
if (settings.brand !== '') {
|
||||
var brand = $('<div class="' + prefix + '_brand">'+settings.brand+'</div>');
|
||||
$(menuBar).append(brand);
|
||||
}
|
||||
$this.btn = $(
|
||||
['<' + settings.parentTag + ' aria-haspopup="true" tabindex="0" class="' + prefix + '_btn ' + prefix + '_collapsed">',
|
||||
'<span class="' + prefix + '_menutxt">' + settings.label + '</span>',
|
||||
'<span class="' + iconClass + '">',
|
||||
'<span class="' + prefix + '_icon-bar"></span>',
|
||||
'<span class="' + prefix + '_icon-bar"></span>',
|
||||
'<span class="' + prefix + '_icon-bar"></span>',
|
||||
'</span>',
|
||||
'</' + settings.parentTag + '>'
|
||||
].join('')
|
||||
);
|
||||
$(menuBar).append($this.btn);
|
||||
$(settings.prependTo).prepend(menuBar);
|
||||
menuBar.append($this.mobileNav);
|
||||
|
||||
// iterate over structure adding additional structure
|
||||
var items = $this.mobileNav.find('li');
|
||||
$(items).each(function () {
|
||||
var item = $(this),
|
||||
data = {};
|
||||
data.children = item.children('ul').attr('role', 'menu');
|
||||
item.data('menu', data);
|
||||
|
||||
// if a list item has a nested menu
|
||||
if (data.children.length > 0) {
|
||||
|
||||
// select all text before the child menu
|
||||
// check for anchors
|
||||
|
||||
var a = item.contents(),
|
||||
containsAnchor = false,
|
||||
nodes = [];
|
||||
|
||||
$(a).each(function () {
|
||||
if (!$(this).is('ul')) {
|
||||
nodes.push(this);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
if($(this).is("a")) {
|
||||
containsAnchor = true;
|
||||
}
|
||||
});
|
||||
|
||||
var wrapElement = $(
|
||||
'<' + settings.parentTag + ' role="menuitem" aria-haspopup="true" tabindex="-1" class="' + prefix + '_item"/>'
|
||||
);
|
||||
|
||||
// wrap item text with tag and add classes unless we are separating parent links
|
||||
if ((!settings.allowParentLinks || settings.nestedParentLinks) || !containsAnchor) {
|
||||
var $wrap = $(nodes).wrapAll(wrapElement).parent();
|
||||
$wrap.addClass(prefix+'_row');
|
||||
} else
|
||||
$(nodes).wrapAll('<span class="'+prefix+'_parent-link '+prefix+'_row"/>').parent();
|
||||
|
||||
if (!settings.showChildren) {
|
||||
item.addClass(prefix+'_collapsed');
|
||||
} else {
|
||||
item.addClass(prefix+'_open');
|
||||
}
|
||||
|
||||
item.addClass(prefix+'_parent');
|
||||
|
||||
// create parent arrow. wrap with link if parent links and separating
|
||||
var arrowElement = $('<span class="'+prefix+'_arrow">'+(settings.showChildren?settings.openedSymbol:settings.closedSymbol)+'</span>');
|
||||
|
||||
if (settings.allowParentLinks && !settings.nestedParentLinks && containsAnchor)
|
||||
arrowElement = arrowElement.wrap(wrapElement).parent();
|
||||
|
||||
//append arrow
|
||||
$(nodes).last().after(arrowElement);
|
||||
|
||||
|
||||
} else if ( item.children().length === 0) {
|
||||
item.addClass(prefix+'_txtnode');
|
||||
}
|
||||
|
||||
// accessibility for links
|
||||
item.children('a').attr('role', 'menuitem').click(function(event){
|
||||
//Ensure that it's not a parent
|
||||
if (settings.closeOnClick && !$(event.target).parent().closest('li').hasClass(prefix+'_parent')) {
|
||||
//Emulate menu close if set
|
||||
$($this.btn).click();
|
||||
}
|
||||
});
|
||||
|
||||
//also close on click if parent links are set
|
||||
if (settings.closeOnClick && settings.allowParentLinks) {
|
||||
item.children('a').children('a').click(function (event) {
|
||||
//Emulate menu close
|
||||
$($this.btn).click();
|
||||
});
|
||||
|
||||
item.find('.'+prefix+'_parent-link a:not(.'+prefix+'_item)').click(function(event){
|
||||
//Emulate menu close
|
||||
$($this.btn).click();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// structure is in place, now hide appropriate items
|
||||
$(items).each(function () {
|
||||
var data = $(this).data('menu');
|
||||
if (!settings.showChildren){
|
||||
$this._visibilityToggle(data.children, null, false, null, true);
|
||||
}
|
||||
});
|
||||
|
||||
// finally toggle entire menu
|
||||
$this._visibilityToggle($this.mobileNav, null, false, 'init', true);
|
||||
|
||||
// accessibility for menu button
|
||||
$this.mobileNav.attr('role','menu');
|
||||
|
||||
// outline prevention when using mouse
|
||||
$(document).mousedown(function(){
|
||||
$this._outlines(false);
|
||||
});
|
||||
|
||||
$(document).keyup(function(){
|
||||
$this._outlines(true);
|
||||
});
|
||||
|
||||
// menu button click
|
||||
$($this.btn).click(function (e) {
|
||||
e.preventDefault();
|
||||
$this._menuToggle();
|
||||
});
|
||||
|
||||
// click on menu parent
|
||||
$this.mobileNav.on('click', '.' + prefix + '_item', function (e) {
|
||||
e.preventDefault();
|
||||
$this._itemClick($(this));
|
||||
});
|
||||
|
||||
// check for enter key on menu button and menu parents
|
||||
$($this.btn).keydown(function (e) {
|
||||
var ev = e || event;
|
||||
if(ev.keyCode == 13) {
|
||||
e.preventDefault();
|
||||
$this._menuToggle();
|
||||
}
|
||||
});
|
||||
|
||||
$this.mobileNav.on('keydown', '.'+prefix+'_item', function(e) {
|
||||
var ev = e || event;
|
||||
if(ev.keyCode == 13) {
|
||||
e.preventDefault();
|
||||
$this._itemClick($(e.target));
|
||||
}
|
||||
});
|
||||
|
||||
// allow links clickable within parent tags if set
|
||||
if (settings.allowParentLinks && settings.nestedParentLinks) {
|
||||
$('.'+prefix+'_item a').click(function(e){
|
||||
e.stopImmediatePropagation();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
//toggle menu
|
||||
Plugin.prototype._menuToggle = function (el) {
|
||||
var $this = this;
|
||||
var btn = $this.btn;
|
||||
var mobileNav = $this.mobileNav;
|
||||
|
||||
if (btn.hasClass(prefix+'_collapsed')) {
|
||||
btn.removeClass(prefix+'_collapsed');
|
||||
btn.addClass(prefix+'_open');
|
||||
} else {
|
||||
btn.removeClass(prefix+'_open');
|
||||
btn.addClass(prefix+'_collapsed');
|
||||
}
|
||||
btn.addClass(prefix+'_animating');
|
||||
$this._visibilityToggle(mobileNav, btn.parent(), true, btn);
|
||||
};
|
||||
|
||||
// toggle clicked items
|
||||
Plugin.prototype._itemClick = function (el) {
|
||||
var $this = this;
|
||||
var settings = $this.settings;
|
||||
var data = el.data('menu');
|
||||
if (!data) {
|
||||
data = {};
|
||||
data.arrow = el.children('.'+prefix+'_arrow');
|
||||
data.ul = el.next('ul');
|
||||
data.parent = el.parent();
|
||||
//Separated parent link structure
|
||||
if (data.parent.hasClass(prefix+'_parent-link')) {
|
||||
data.parent = el.parent().parent();
|
||||
data.ul = el.parent().next('ul');
|
||||
}
|
||||
el.data('menu', data);
|
||||
}
|
||||
if (data.parent.hasClass(prefix+'_collapsed')) {
|
||||
data.arrow.html(settings.openedSymbol);
|
||||
data.parent.removeClass(prefix+'_collapsed');
|
||||
data.parent.addClass(prefix+'_open');
|
||||
data.parent.addClass(prefix+'_animating');
|
||||
$this._visibilityToggle(data.ul, data.parent, true, el);
|
||||
} else {
|
||||
data.arrow.html(settings.closedSymbol);
|
||||
data.parent.addClass(prefix+'_collapsed');
|
||||
data.parent.removeClass(prefix+'_open');
|
||||
data.parent.addClass(prefix+'_animating');
|
||||
$this._visibilityToggle(data.ul, data.parent, true, el);
|
||||
}
|
||||
};
|
||||
|
||||
// toggle actual visibility and accessibility tags
|
||||
Plugin.prototype._visibilityToggle = function(el, parent, animate, trigger, init) {
|
||||
var $this = this;
|
||||
var settings = $this.settings;
|
||||
var items = $this._getActionItems(el);
|
||||
var duration = 0;
|
||||
if (animate) {
|
||||
duration = settings.duration;
|
||||
}
|
||||
|
||||
if (el.hasClass(prefix+'_hidden')) {
|
||||
el.removeClass(prefix+'_hidden');
|
||||
//Fire beforeOpen callback
|
||||
if (!init) {
|
||||
settings.beforeOpen(trigger);
|
||||
}
|
||||
el.slideDown(duration, settings.easingOpen, function(){
|
||||
|
||||
$(trigger).removeClass(prefix+'_animating');
|
||||
$(parent).removeClass(prefix+'_animating');
|
||||
|
||||
//Fire afterOpen callback
|
||||
if (!init) {
|
||||
settings.afterOpen(trigger);
|
||||
}
|
||||
});
|
||||
el.attr('aria-hidden','false');
|
||||
items.attr('tabindex', '0');
|
||||
$this._setVisAttr(el, false);
|
||||
} else {
|
||||
el.addClass(prefix+'_hidden');
|
||||
|
||||
//Fire init or beforeClose callback
|
||||
if (!init){
|
||||
settings.beforeClose(trigger);
|
||||
}
|
||||
|
||||
el.slideUp(duration, this.settings.easingClose, function() {
|
||||
el.attr('aria-hidden','true');
|
||||
items.attr('tabindex', '-1');
|
||||
$this._setVisAttr(el, true);
|
||||
el.hide(); //jQuery 1.7 bug fix
|
||||
|
||||
$(trigger).removeClass(prefix+'_animating');
|
||||
$(parent).removeClass(prefix+'_animating');
|
||||
|
||||
//Fire init or afterClose callback
|
||||
if (!init){
|
||||
settings.afterClose(trigger);
|
||||
} else if (trigger == 'init'){
|
||||
settings.init();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// set attributes of element and children based on visibility
|
||||
Plugin.prototype._setVisAttr = function(el, hidden) {
|
||||
var $this = this;
|
||||
|
||||
// select all parents that aren't hidden
|
||||
var nonHidden = el.children('li').children('ul').not('.'+prefix+'_hidden');
|
||||
|
||||
// iterate over all items setting appropriate tags
|
||||
if (!hidden) {
|
||||
nonHidden.each(function(){
|
||||
var ul = $(this);
|
||||
ul.attr('aria-hidden','false');
|
||||
var items = $this._getActionItems(ul);
|
||||
items.attr('tabindex', '0');
|
||||
$this._setVisAttr(ul, hidden);
|
||||
});
|
||||
} else {
|
||||
nonHidden.each(function(){
|
||||
var ul = $(this);
|
||||
ul.attr('aria-hidden','true');
|
||||
var items = $this._getActionItems(ul);
|
||||
items.attr('tabindex', '-1');
|
||||
$this._setVisAttr(ul, hidden);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// get all 1st level items that are clickable
|
||||
Plugin.prototype._getActionItems = function(el) {
|
||||
var data = el.data("menu");
|
||||
if (!data) {
|
||||
data = {};
|
||||
var items = el.children('li');
|
||||
var anchors = items.find('a');
|
||||
data.links = anchors.add(items.find('.'+prefix+'_item'));
|
||||
el.data('menu', data);
|
||||
}
|
||||
return data.links;
|
||||
};
|
||||
|
||||
Plugin.prototype._outlines = function(state) {
|
||||
if (!state) {
|
||||
$('.'+prefix+'_item, .'+prefix+'_btn').css('outline','none');
|
||||
} else {
|
||||
$('.'+prefix+'_item, .'+prefix+'_btn').css('outline','');
|
||||
}
|
||||
};
|
||||
|
||||
Plugin.prototype.toggle = function(){
|
||||
var $this = this;
|
||||
$this._menuToggle();
|
||||
};
|
||||
|
||||
Plugin.prototype.open = function(){
|
||||
var $this = this;
|
||||
if ($this.btn.hasClass(prefix+'_collapsed')) {
|
||||
$this._menuToggle();
|
||||
}
|
||||
};
|
||||
|
||||
Plugin.prototype.close = function(){
|
||||
var $this = this;
|
||||
if ($this.btn.hasClass(prefix+'_open')) {
|
||||
$this._menuToggle();
|
||||
}
|
||||
};
|
||||
|
||||
$.fn[mobileMenu] = function ( options ) {
|
||||
var args = arguments;
|
||||
|
||||
// Is the first parameter an object (options), or was omitted, instantiate a new instance
|
||||
if (options === undefined || typeof options === 'object') {
|
||||
return this.each(function () {
|
||||
|
||||
// Only allow the plugin to be instantiated once due to methods
|
||||
if (!$.data(this, 'plugin_' + mobileMenu)) {
|
||||
|
||||
// if it has no instance, create a new one, pass options to our plugin constructor,
|
||||
// and store the plugin instance in the elements jQuery data object.
|
||||
$.data(this, 'plugin_' + mobileMenu, new Plugin( this, options ));
|
||||
}
|
||||
});
|
||||
|
||||
// If is a string and doesn't start with an underscore or 'init' function, treat this as a call to a public method.
|
||||
} else if (typeof options === 'string' && options[0] !== '_' && options !== 'init') {
|
||||
|
||||
// Cache the method call to make it possible to return a value
|
||||
var returns;
|
||||
|
||||
this.each(function () {
|
||||
var instance = $.data(this, 'plugin_' + mobileMenu);
|
||||
|
||||
// Tests that there's already a plugin-instance and checks that the requested public method exists
|
||||
if (instance instanceof Plugin && typeof instance[options] === 'function') {
|
||||
|
||||
// Call the method of our plugin instance, and pass it the supplied arguments.
|
||||
returns = instance[options].apply( instance, Array.prototype.slice.call( args, 1 ) );
|
||||
}
|
||||
});
|
||||
|
||||
// If the earlier cached method gives a value back return the value, otherwise return this to preserve chainability.
|
||||
return returns !== undefined ? returns : this;
|
||||
}
|
||||
};
|
||||
}(jQuery, document, window));
|
||||
126
asetlanding/js/main.js
Normal file
126
asetlanding/js/main.js
Normal file
@@ -0,0 +1,126 @@
|
||||
(function($) {
|
||||
|
||||
"use strict";
|
||||
|
||||
$(window).on('load', function() {
|
||||
|
||||
|
||||
|
||||
/*Page Loader active
|
||||
========================================================*/
|
||||
$('#preloader').fadeOut();
|
||||
|
||||
// Sticky Nav
|
||||
$(window).on('scroll', function() {
|
||||
if ($(window).scrollTop() > 100) {
|
||||
$('.scrolling-navbar').addClass('top-nav-collapse');
|
||||
} else {
|
||||
$('.scrolling-navbar').removeClass('top-nav-collapse');
|
||||
}
|
||||
});
|
||||
|
||||
/* Auto Close Responsive Navbar on Click
|
||||
========================================================*/
|
||||
function close_toggle() {
|
||||
if ($(window).width() <= 768) {
|
||||
$('.navbar-collapse a').on('click', function () {
|
||||
$('.navbar-collapse').collapse('hide');
|
||||
});
|
||||
}
|
||||
else {
|
||||
$('.navbar .navbar-inverse a').off('click');
|
||||
}
|
||||
}
|
||||
close_toggle();
|
||||
$(window).resize(close_toggle);
|
||||
|
||||
// one page navigation
|
||||
$('.navbar-nav').onePageNav({
|
||||
currentClass: 'active'
|
||||
});
|
||||
|
||||
/* slicknav mobile menu active */
|
||||
$('.mobile-menu').slicknav({
|
||||
prependTo: '.navbar-header',
|
||||
parentTag: 'liner',
|
||||
allowParentLinks: true,
|
||||
duplicate: true,
|
||||
label: '',
|
||||
closedSymbol: '<i class="lni-chevron-right"></i>',
|
||||
openedSymbol: '<i class="lni-chevron-down"></i>',
|
||||
});
|
||||
|
||||
/* WOW Scroll Spy
|
||||
========================================================*/
|
||||
var wow = new WOW({
|
||||
//disabled for mobile
|
||||
mobile: false
|
||||
});
|
||||
|
||||
wow.init();
|
||||
|
||||
/*
|
||||
CounterUp
|
||||
========================================================================== */
|
||||
$('.counter').counterUp({
|
||||
time: 1000
|
||||
});
|
||||
|
||||
/* Testimonials Carousel
|
||||
========================================================*/
|
||||
var owl = $("#testimonials");
|
||||
owl.owlCarousel({
|
||||
loop: true,
|
||||
nav: false,
|
||||
dots: true,
|
||||
center: true,
|
||||
margin: 15,
|
||||
slideSpeed: 1000,
|
||||
stopOnHover: true,
|
||||
autoPlay: true,
|
||||
responsiveClass: true,
|
||||
responsiveRefreshRate: true,
|
||||
responsive : {
|
||||
0 : {
|
||||
items: 1
|
||||
},
|
||||
768 : {
|
||||
items: 1
|
||||
},
|
||||
960 : {
|
||||
items: 1
|
||||
},
|
||||
1200 : {
|
||||
items: 1
|
||||
},
|
||||
1920 : {
|
||||
items: 1
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
/* Back Top Link active
|
||||
========================================================*/
|
||||
var offset = 200;
|
||||
var duration = 500;
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > offset) {
|
||||
$('.back-to-top').fadeIn(400);
|
||||
} else {
|
||||
$('.back-to-top').fadeOut(400);
|
||||
}
|
||||
});
|
||||
|
||||
$('.back-to-top').on('click',function(event) {
|
||||
event.preventDefault();
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 600);
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
}(jQuery));
|
||||
7
asetlanding/js/owl.carousel.min.js
vendored
Normal file
7
asetlanding/js/owl.carousel.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
5
asetlanding/js/popper.min.js
vendored
Normal file
5
asetlanding/js/popper.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
19
asetlanding/js/scrolling-nav.js
Normal file
19
asetlanding/js/scrolling-nav.js
Normal file
@@ -0,0 +1,19 @@
|
||||
//jQuery to collapse the navbar on scroll
|
||||
$(window).scroll(function() {
|
||||
if ($(".navbar").offset().top > 50) {
|
||||
$(".navbar-fixed-top").addClass("top-nav-collapse");
|
||||
} else {
|
||||
$(".navbar-fixed-top").removeClass("top-nav-collapse");
|
||||
}
|
||||
});
|
||||
|
||||
//jQuery for page scrolling feature - requires jQuery Easing plugin
|
||||
$(function() {
|
||||
$(document).on('click', 'a.page-scroll', function(event) {
|
||||
var $anchor = $(this);
|
||||
$('html, body').stop().animate({
|
||||
scrollTop: $($anchor.attr('href')).offset().top
|
||||
}, 1500, 'easeInOutExpo');
|
||||
event.preventDefault();
|
||||
});
|
||||
});
|
||||
8
asetlanding/js/waypoints.min.js
vendored
Normal file
8
asetlanding/js/waypoints.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
184
asetlanding/js/wow.js
Normal file
184
asetlanding/js/wow.js
Normal file
@@ -0,0 +1,184 @@
|
||||
(function() {
|
||||
var Util,
|
||||
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
|
||||
|
||||
Util = (function() {
|
||||
function Util() {}
|
||||
|
||||
Util.prototype.extend = function(custom, defaults) {
|
||||
var key, value;
|
||||
for (key in custom) {
|
||||
value = custom[key];
|
||||
if (value != null) {
|
||||
defaults[key] = value;
|
||||
}
|
||||
}
|
||||
return defaults;
|
||||
};
|
||||
|
||||
Util.prototype.isMobile = function(agent) {
|
||||
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(agent);
|
||||
};
|
||||
|
||||
return Util;
|
||||
|
||||
})();
|
||||
|
||||
this.WOW = (function() {
|
||||
WOW.prototype.defaults = {
|
||||
boxClass: 'wow',
|
||||
animateClass: 'animated',
|
||||
offset: 0,
|
||||
mobile: true
|
||||
};
|
||||
|
||||
function WOW(options) {
|
||||
if (options == null) {
|
||||
options = {};
|
||||
}
|
||||
this.scrollCallback = __bind(this.scrollCallback, this);
|
||||
this.scrollHandler = __bind(this.scrollHandler, this);
|
||||
this.start = __bind(this.start, this);
|
||||
this.scrolled = true;
|
||||
this.config = this.util().extend(options, this.defaults);
|
||||
}
|
||||
|
||||
WOW.prototype.init = function() {
|
||||
var _ref;
|
||||
this.element = window.document.documentElement;
|
||||
this.boxes = this.element.getElementsByClassName(this.config.boxClass);
|
||||
if (this.boxes.length) {
|
||||
if (this.disabled()) {
|
||||
return this.resetStyle();
|
||||
} else {
|
||||
if ((_ref = document.readyState) === "interactive" || _ref === "complete") {
|
||||
return this.start();
|
||||
} else {
|
||||
return document.addEventListener('DOMContentLoaded', this.start);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
WOW.prototype.start = function() {
|
||||
var box, _i, _len, _ref;
|
||||
_ref = this.boxes;
|
||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||
box = _ref[_i];
|
||||
this.applyStyle(box, true);
|
||||
}
|
||||
window.addEventListener('scroll', this.scrollHandler, false);
|
||||
window.addEventListener('resize', this.scrollHandler, false);
|
||||
return this.interval = setInterval(this.scrollCallback, 50);
|
||||
};
|
||||
|
||||
WOW.prototype.stop = function() {
|
||||
window.removeEventListener('scroll', this.scrollHandler, false);
|
||||
window.removeEventListener('resize', this.scrollHandler, false);
|
||||
if (this.interval != null) {
|
||||
return clearInterval(this.interval);
|
||||
}
|
||||
};
|
||||
|
||||
WOW.prototype.show = function(box) {
|
||||
this.applyStyle(box);
|
||||
return box.className = "" + box.className + " " + this.config.animateClass;
|
||||
};
|
||||
|
||||
WOW.prototype.applyStyle = function(box, hidden) {
|
||||
var delay, duration, iteration;
|
||||
duration = box.getAttribute('data-wow-duration');
|
||||
delay = box.getAttribute('data-wow-delay');
|
||||
iteration = box.getAttribute('data-wow-iteration');
|
||||
return box.setAttribute('style', this.customStyle(hidden, duration, delay, iteration));
|
||||
};
|
||||
|
||||
WOW.prototype.resetStyle = function() {
|
||||
var box, _i, _len, _ref, _results;
|
||||
_ref = this.boxes;
|
||||
_results = [];
|
||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||
box = _ref[_i];
|
||||
_results.push(box.setAttribute('style', 'visibility: visible;'));
|
||||
}
|
||||
return _results;
|
||||
};
|
||||
|
||||
WOW.prototype.customStyle = function(hidden, duration, delay, iteration) {
|
||||
var style;
|
||||
style = hidden ? "visibility: hidden; -webkit-animation-name: none; -moz-animation-name: none; animation-name: none;" : "visibility: visible;";
|
||||
if (duration) {
|
||||
style += "-webkit-animation-duration: " + duration + "; -moz-animation-duration: " + duration + "; animation-duration: " + duration + ";";
|
||||
}
|
||||
if (delay) {
|
||||
style += "-webkit-animation-delay: " + delay + "; -moz-animation-delay: " + delay + "; animation-delay: " + delay + ";";
|
||||
}
|
||||
if (iteration) {
|
||||
style += "-webkit-animation-iteration-count: " + iteration + "; -moz-animation-iteration-count: " + iteration + "; animation-iteration-count: " + iteration + ";";
|
||||
}
|
||||
return style;
|
||||
};
|
||||
|
||||
WOW.prototype.scrollHandler = function() {
|
||||
return this.scrolled = true;
|
||||
};
|
||||
|
||||
WOW.prototype.scrollCallback = function() {
|
||||
var box;
|
||||
if (this.scrolled) {
|
||||
this.scrolled = false;
|
||||
this.boxes = (function() {
|
||||
var _i, _len, _ref, _results;
|
||||
_ref = this.boxes;
|
||||
_results = [];
|
||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||
box = _ref[_i];
|
||||
if (!(box)) {
|
||||
continue;
|
||||
}
|
||||
if (this.isVisible(box)) {
|
||||
this.show(box);
|
||||
continue;
|
||||
}
|
||||
_results.push(box);
|
||||
}
|
||||
return _results;
|
||||
}).call(this);
|
||||
if (!this.boxes.length) {
|
||||
return this.stop();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
WOW.prototype.offsetTop = function(element) {
|
||||
var top;
|
||||
top = element.offsetTop;
|
||||
while (element = element.offsetParent) {
|
||||
top += element.offsetTop;
|
||||
}
|
||||
return top;
|
||||
};
|
||||
|
||||
WOW.prototype.isVisible = function(box) {
|
||||
var bottom, offset, top, viewBottom, viewTop;
|
||||
offset = box.getAttribute('data-wow-offset') || this.config.offset;
|
||||
viewTop = window.pageYOffset;
|
||||
viewBottom = viewTop + this.element.clientHeight - offset;
|
||||
top = this.offsetTop(box);
|
||||
bottom = top + box.clientHeight;
|
||||
return top <= viewBottom && bottom >= viewTop;
|
||||
};
|
||||
|
||||
WOW.prototype.util = function() {
|
||||
return this._util || (this._util = new Util());
|
||||
};
|
||||
|
||||
WOW.prototype.disabled = function() {
|
||||
return this.config.mobile === false && this.util().isMobile(navigator.userAgent);
|
||||
};
|
||||
|
||||
return WOW;
|
||||
|
||||
})();
|
||||
|
||||
}).call(this);
|
||||
Reference in New Issue
Block a user