Merms New Website
This commit is contained in:
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
// SmoothScroll for websites v1.2.1
|
||||
// Licensed under the terms of the MIT license.
|
||||
|
||||
// People involved
|
||||
// - Balazs Galambosi (maintainer)
|
||||
// - Michael Herf (Pulse Algorithm)
|
||||
!function(){var e,t={frameRate:1000,animationTime:700,stepSize:85,pulseAlgorithm:!0,pulseScale:8,pulseNormalize:1,accelerationDelta:20,accelerationMax:1,keyboardSupport:!0,arrowScroll:50,touchpadSupport:!0,fixedBackground:!0,excluded:""},a=t,r=!1,o=!1,n={x:0,y:0},i=!1,l=document.documentElement,c=[120,120,120],u={left:37,up:38,right:39,down:40,spacebar:32,pageup:33,pagedown:34,end:35,home:36};a=t;function s(){a.keyboardSupport&&x("keydown",w)}function d(){if(document.body){var t=document.body,n=document.documentElement,c=window.innerHeight,u=t.scrollHeight;if(l=document.compatMode.indexOf("CSS")>=0?n:t,e=t,s(),i=!0,top!=self)o=!0;else if(u>c&&(t.offsetHeight<=c||n.offsetHeight<=c)&&(n.style.height="auto",l.offsetHeight<=c)){var d=document.createElement("div");d.style.clear="both",t.appendChild(d)}a.fixedBackground||r||(t.style.backgroundAttachment="scroll",n.style.backgroundAttachment="scroll")}}var f=[],p=!1,h=+new Date;function m(e,t,r,o){var i,l;if(o||(o=1e3),i=(i=t)>0?1:-1,l=(l=r)>0?1:-1,(n.x!==i||n.y!==l)&&(n.x=i,n.y=l,f=[],h=0),1!=a.accelerationMax){var c=+new Date-h;if(c<a.accelerationDelta){var u=(1+30/c)/2;u>1&&(u=Math.min(u,a.accelerationMax),t*=u,r*=u)}h=+new Date}if(f.push({x:t,y:r,lastX:t<0?.99:-.99,lastY:r<0?.99:-.99,start:+new Date}),!p){var s=e===document.body,d=function(n){for(var i=+new Date,l=0,c=0,u=0;u<f.length;u++){var h=f[u],m=i-h.start,w=m>=a.animationTime,v=w?1:m/a.animationTime;a.pulseAlgorithm&&(v=T(v));var g=h.x*v-h.lastX>>0,b=h.y*v-h.lastY>>0;l+=g,c+=b,h.lastX+=g,h.lastY+=b,w&&(f.splice(u,1),u--)}s?window.scrollBy(l,c):(l&&(e.scrollLeft+=l),c&&(e.scrollTop+=c)),t||r||(f=[]),f.length?M(d,e,o/a.frameRate+1):p=!1};M(d,e,0),p=!0}}function w(t){var r=t.target,o=t.ctrlKey||t.altKey||t.metaKey||t.shiftKey&&t.keyCode!==u.spacebar;if(/input|textarea|select|embed/i.test(r.nodeName)||r.isContentEditable||t.defaultPrevented||o)return!0;if(D(r,"button")&&t.keyCode===u.spacebar)return!0;var n=0,i=0,l=S(e),c=l.clientHeight;switch(l==document.body&&(c=window.innerHeight),t.keyCode){case u.up:i=-a.arrowScroll;break;case u.down:i=a.arrowScroll;break;case u.spacebar:i=-(t.shiftKey?1:-1)*c*.9;break;case u.pageup:i=.9*-c;break;case u.pagedown:i=.9*c;break;case u.home:i=-l.scrollTop;break;case u.end:var s=l.scrollHeight-l.scrollTop-c;i=s>0?s+10:0;break;case u.left:n=-a.arrowScroll;break;case u.right:n=a.arrowScroll;break;default:return!0}m(l,n,i),t.preventDefault()}var v={};setInterval(function(){v={}},1e4);var g,b,y=(g=0,function(e){return e.uniqueID||(e.uniqueID=g++)});function k(e,t){for(var a=e.length;a--;)v[y(e[a])]=t;return t}function S(e){var t=[],a=l.scrollHeight;do{var r=v[y(e)];if(r)return k(t,r);if(t.push(e),a===e.scrollHeight){if(!o||l.clientHeight+10<a)return k(t,document.body)}else if(e.clientHeight+10<e.scrollHeight&&(overflow=getComputedStyle(e,"").getPropertyValue("overflow-y"),"scroll"===overflow||"auto"===overflow))return k(t,e)}while(e=e.parentNode)}function x(e,t,a){window.addEventListener(e,t,a||!1)}function D(e,t){return(e.nodeName||"").toLowerCase()===t.toLowerCase()}function H(e,t){return Math.floor(e/t)==e/t}var M=window.requestAnimationFrame||window.webkitRequestAnimationFrame||function(e,t,a){window.setTimeout(e,a||1e3/60)};function C(e){var t,r;return(e*=a.pulseScale)<1?t=e-(1-Math.exp(-e)):(e-=1,t=(r=Math.exp(-1))+(1-Math.exp(-e))*(1-r)),t*a.pulseNormalize}function T(e){return e>=1?1:e<=0?0:(1==a.pulseNormalize&&(a.pulseNormalize/=C(1)),C(e))}var z=/chrome/i.test(window.navigator.userAgent);"onmousewheel"in document&&z&&(x("mousedown",function(t){e=t.target}),x("mousewheel",function(t){i||d();var r=t.target,o=S(r);if(!o||t.defaultPrevented||D(e,"embed")||D(r,"embed")&&/\.pdf/i.test(r.src))return!0;var n=t.wheelDeltaX||0,l=t.wheelDeltaY||0;if(n||l||(l=t.wheelDelta||0),!a.touchpadSupport&&function(e){if(e){e=Math.abs(e),c.push(e),c.shift(),clearTimeout(b);var t=c[0]==c[1]&&c[1]==c[2],a=H(c[0],120)&&H(c[1],120)&&H(c[2],120);return!(t||a)}}(l))return!0;Math.abs(n)>1.2&&(n*=a.stepSize/120),Math.abs(l)>1.2&&(l*=a.stepSize/120),m(o,-n,-l),t.preventDefault()}),x("load",d))}();
|
||||
Vendored
+17
File diff suppressed because one or more lines are too long
@@ -0,0 +1,151 @@
|
||||
/*
|
||||
* jQuery.appear
|
||||
* https://github.com/bas2k/jquery.appear/
|
||||
* http://code.google.com/p/jquery-appear/
|
||||
* http://bas2k.ru/
|
||||
*
|
||||
* Copyright (c) 2009 Michael Hixson
|
||||
* Copyright (c) 2012-2014 Alexander Brovikov
|
||||
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
|
||||
*/
|
||||
(function($) {
|
||||
$.fn.appear = function(fn, options) {
|
||||
|
||||
var settings = $.extend({
|
||||
|
||||
//arbitrary data to pass to fn
|
||||
data: undefined,
|
||||
|
||||
//call fn only on the first appear?
|
||||
one: true,
|
||||
|
||||
// X & Y accuracy
|
||||
accX: 0,
|
||||
accY: 0
|
||||
|
||||
}, options);
|
||||
|
||||
return this.each(function() {
|
||||
|
||||
var t = $(this);
|
||||
|
||||
//whether the element is currently visible
|
||||
t.appeared = false;
|
||||
|
||||
if (!fn) {
|
||||
|
||||
//trigger the custom event
|
||||
t.trigger('appear', settings.data);
|
||||
return;
|
||||
}
|
||||
|
||||
var w = $(window);
|
||||
|
||||
//fires the appear event when appropriate
|
||||
var check = function() {
|
||||
|
||||
//is the element hidden?
|
||||
if (!t.is(':visible')) {
|
||||
|
||||
//it became hidden
|
||||
t.appeared = false;
|
||||
return;
|
||||
}
|
||||
|
||||
//is the element inside the visible window?
|
||||
var a = w.scrollLeft();
|
||||
var b = w.scrollTop();
|
||||
var o = t.offset();
|
||||
var x = o.left;
|
||||
var y = o.top;
|
||||
|
||||
var ax = settings.accX;
|
||||
var ay = settings.accY;
|
||||
var th = t.height();
|
||||
var wh = w.height();
|
||||
var tw = t.width();
|
||||
var ww = w.width();
|
||||
|
||||
if (y + th + ay >= b &&
|
||||
y <= b + wh + ay &&
|
||||
x + tw + ax >= a &&
|
||||
x <= a + ww + ax) {
|
||||
|
||||
//trigger the custom event
|
||||
if (!t.appeared) t.trigger('appear', settings.data);
|
||||
|
||||
} else {
|
||||
|
||||
//it scrolled out of view
|
||||
t.appeared = false;
|
||||
}
|
||||
};
|
||||
|
||||
//create a modified fn with some additional logic
|
||||
var modifiedFn = function() {
|
||||
|
||||
//mark the element as visible
|
||||
t.appeared = true;
|
||||
|
||||
//is this supposed to happen only once?
|
||||
if (settings.one) {
|
||||
|
||||
//remove the check
|
||||
w.unbind('scroll', check);
|
||||
var i = $.inArray(check, $.fn.appear.checks);
|
||||
if (i >= 0) $.fn.appear.checks.splice(i, 1);
|
||||
}
|
||||
|
||||
//trigger the original fn
|
||||
fn.apply(this, arguments);
|
||||
};
|
||||
|
||||
//bind the modified fn to the element
|
||||
if (settings.one) t.one('appear', settings.data, modifiedFn);
|
||||
else t.bind('appear', settings.data, modifiedFn);
|
||||
|
||||
//check whenever the window scrolls
|
||||
w.scroll(check);
|
||||
|
||||
//check whenever the dom changes
|
||||
$.fn.appear.checks.push(check);
|
||||
|
||||
//check now
|
||||
(check)();
|
||||
});
|
||||
};
|
||||
|
||||
//keep a queue of appearance checks
|
||||
$.extend($.fn.appear, {
|
||||
|
||||
checks: [],
|
||||
timeout: null,
|
||||
|
||||
//process the queue
|
||||
checkAll: function() {
|
||||
var length = $.fn.appear.checks.length;
|
||||
if (length > 0) while (length--) ($.fn.appear.checks[length])();
|
||||
},
|
||||
|
||||
//check the queue asynchronously
|
||||
run: function() {
|
||||
if ($.fn.appear.timeout) clearTimeout($.fn.appear.timeout);
|
||||
$.fn.appear.timeout = setTimeout($.fn.appear.checkAll, 20);
|
||||
}
|
||||
});
|
||||
|
||||
//run checks when these methods are called
|
||||
$.each(['append', 'prepend', 'after', 'before', 'attr',
|
||||
'removeAttr', 'addClass', 'removeClass', 'toggleClass',
|
||||
'remove', 'css', 'show', 'hide'], function(i, n) {
|
||||
var old = $.fn[n];
|
||||
if (old) {
|
||||
$.fn[n] = function() {
|
||||
var r = old.apply(this, arguments);
|
||||
$.fn.appear.run();
|
||||
return r;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
Vendored
+7
File diff suppressed because one or more lines are too long
Vendored
+59
@@ -0,0 +1,59 @@
|
||||
! function(n) {
|
||||
"use strict";
|
||||
var a = {
|
||||
initialize: function() { this.event(), this.toggler(), this.dropdown(), this.sideMenu(), this.navbarSticky(), this.scrollspy() },
|
||||
event: function() {},
|
||||
toggler: function() {
|
||||
n(".navbar-toggler").each(function() {
|
||||
var a = n(this);
|
||||
a.on("click", function() { a.toggleClass("active") }), n(window).resize(function() { n(".navbar-toggler").removeClass("active") })
|
||||
})
|
||||
},
|
||||
dropdown: function() { n(".bsnav .nav-item.dropdown").on("mouseenter", function() { n(this).find("> .navbar-nav").addClass("in") }).on("mouseleave", function() { n(this).find("> .navbar-nav").removeClass("in") }) },
|
||||
mobileMenu: function() {
|
||||
n(".bsnav .navbar-mobile")[0] && n(".bsnav-mobile")[0] && (n(".bsnav .navbar-mobile").closest(".bsnav-dark")[0] && n(".bsnav-mobile .navbar").addClass("bsnav-dark"), n(".bsnav .navbar-mobile").closest(".bsnav-light")[0] && n(".bsnav-mobile .navbar").addClass("bsnav-dark"), n(".bsnav .navbar-mobile").each(function() {
|
||||
var a = n(this).clone();
|
||||
a.find(".dropdown").removeClass("dropdown"), a.appendTo(".bsnav-mobile .navbar")
|
||||
}), n(".navbar-toggler").attr("data-target") || n(".navbar-toggler").on("click", function() { n(".bsnav-mobile").toggleClass("in") }), n(".bsnav-mobile .bsnav-mobile-overlay").on("click", function() { n(".bsnav-mobile").removeClass("in"), n(".navbar-toggler").removeClass("active") }), this.sideMenuNavigation(n(".bsnav-mobile")), n(window).resize(function() { n(".bsnav-mobile").removeClass("in") }))
|
||||
},
|
||||
sideMenu: function() { n(".bsnav-sidebar")[0] && (this.sideMenuNavigation(n(".bsnav-sidebar")), n(".bsnav-sidebar-left")[0] && n("body").addClass("bsnav-has-left-sidebar"), n(".bsnav-sidebar-right")[0] && n("body").addClass("bsnav-has-right-sidebar"), n(".bsnav-sidebar-condensed")[0] && n("body").addClass("bsnav-has-condensed-sidebar"), n(".bsnav-sidebar .nav-item > .navbar-nav").parent().addClass("menu-item-has-children")) },
|
||||
sideMenuNavigation: function(a) {
|
||||
a.find(".nav-link").on("click", function(s) {
|
||||
var i = n(this);
|
||||
i.siblings(".navbar-nav")[0] && (s.preventDefault(), i.parent().hasClass("in") ? (i.parent().removeClass("in"), i.parent().find(".in").removeClass("in"), i.parent().find(".navbar-nav").stop(!0).slideUp(300)) : (i.closest(".in")[0] || (a.find(".nav-item.in .navbar-nav").stop(!0).slideUp(300), a.find(".nav-item.in").removeClass("in")), i.parent().addClass("in"), i.parent().siblings(".in").find(".navbar-nav").stop(!0).slideUp(300), i.parent().siblings(".in").removeClass("in"), i.siblings(".navbar-nav").stop(!0).slideDown(300)))
|
||||
})
|
||||
},
|
||||
navbarSticky: function() {
|
||||
var a = function(n, a, s) { s > a && n.addClass("sticked"), s > a + 30 && n.addClass("in"), 0 == s && n.removeClass("sticked").removeClass("in") };
|
||||
if (n(".bsnav-sticky")[0]) {
|
||||
var s = n(".bsnav-sticky").outerHeight(),
|
||||
i = n(window).scrollTop();
|
||||
a(n(".bsnav-sticky"), s, i), n(window).on("scroll", function() { i = n(window).scrollTop(), a(n(".bsnav-sticky"), s, i) })
|
||||
}
|
||||
},
|
||||
scrollspy: function() {
|
||||
var a = n(".bsnav-scrollspy"),
|
||||
s = a.outerHeight(),
|
||||
i = [];
|
||||
if (a.length) {
|
||||
a.find("[data-scrollspy]").each(function(a) { i.push(n(this).data("scrollspy")) }), n(window).scroll(function() {
|
||||
! function() {
|
||||
if (!a.hasClass("spying")) {
|
||||
var e = n(window).scrollTop();
|
||||
i.map(function(i, o) {
|
||||
var t = n("#" + i).offset() - s,
|
||||
l = t + n("#" + i).outerHeight();
|
||||
e >= t && e <= l && (a.find(".nav-item").removeClass("active"), n("[data-scrollspy=" + i + "]").parent().addClass("active"))
|
||||
})
|
||||
}
|
||||
}()
|
||||
}), a.find("[data-scrollspy]").click(function(i) {
|
||||
i.preventDefault(), a.addClass("spying");
|
||||
var e = n(this).data("scrollspy");
|
||||
a.find(".nav-item").removeClass("active"), n(this).parent().addClass("active"), n("html,body").animate({ scrollTop: n("#" + e).offset().top - s }, 800, function() { a.removeClass("spying") })
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
n(document).ready(function() { a.initialize() }), n(window).on("load", function() { a.mobileMenu() })
|
||||
}(jQuery);
|
||||
@@ -0,0 +1,777 @@
|
||||
/***************************************************************************************************************
|
||||
|||||||||||||||||||||||||||| CUSTOM SCRIPT FOR corano |||||||||||||||||||||||||||
|
||||
****************************************************************************************************************
|
||||
|||||||||||||||||||||||||||| TABLE OF CONTENT ||||||||||||||||||||||||||||||||||||
|
||||
****************************************************************************************************************
|
||||
****************************************************************************************************************
|
||||
|
||||
01. Elements Animation
|
||||
02. prealoader
|
||||
03. Odometer JS
|
||||
04. selectdropdown
|
||||
05. LightBox
|
||||
06. searchpopuptoggler
|
||||
07. customcursoroverlay
|
||||
08. sidemenutoggler
|
||||
09. update clock
|
||||
10. isotope
|
||||
11. Portfolio Tabs
|
||||
12. scrolltotop
|
||||
13. cart product increasing
|
||||
14. pricefilter
|
||||
15. owl-carousel
|
||||
|
||||
|
||||
****************************************************************************************************************
|
||||
|||||||||||||||||||||||||||| End TABLE OF CONTENT ||||||||||||||||||||||||||||||||||||
|
||||
****************************************************************************************************************/
|
||||
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
/*-----------------Elements Animation-----------------*/
|
||||
if ($('.wow').length) {
|
||||
var wow = new WOW({
|
||||
boxClass: 'wow', // animated element css class (default is wow)
|
||||
animateClass: 'animated', // animation css class (default is animated)
|
||||
offset: 0, // distance to the element when triggering the animation (default is 0)
|
||||
mobile: false, // trigger animations on mobile devices (default is true)
|
||||
live: true // act on asynchronously loaded content (default is true)
|
||||
});
|
||||
wow.init();
|
||||
}
|
||||
/*-----------------Elements Animation-----------------*/
|
||||
|
||||
function prealoader() { // makes sure the whole site is loaded
|
||||
$('.preloader').fadeOut(); // will first fade out the loading animation
|
||||
$('.preloader').delay(500).fadeOut('slow'); // will fade out the white DIV that covers the website.
|
||||
$('body').delay(500);
|
||||
}
|
||||
/*-----------------Odometer JS-----------------*/
|
||||
|
||||
jQuery(window).scroll(startCounter);
|
||||
|
||||
function startCounter() {
|
||||
|
||||
if (jQuery(window).scrollTop() > 0) {
|
||||
jQuery(window).off("scroll", startCounter);
|
||||
jQuery('.counter-value').each(function() {
|
||||
var $this = jQuery(this);
|
||||
jQuery({ Counter: 0 }).animate({ Counter: $this.text() }, {
|
||||
duration: 2000,
|
||||
easing: 'swing',
|
||||
step: function() {
|
||||
$this.text(Math.ceil(this.Counter) + '');
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
if (jQuery(window).scrollTop() > 0) {
|
||||
jQuery(window).off("scroll", startCounter);
|
||||
jQuery('.counter-value-plus').each(function() {
|
||||
var $this = jQuery(this);
|
||||
jQuery({ Counter: 0 }).animate({ Counter: $this.text() }, {
|
||||
duration: 2000,
|
||||
easing: 'swing',
|
||||
step: function() {
|
||||
$this.text(Math.ceil(this.Counter) + '+');
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
startCounter();
|
||||
/*-----------------Odometer JS-----------------*/
|
||||
/*-----------------selectdropdown-----------------*/
|
||||
function selectdropdown() {
|
||||
$("#country").selectmenu();
|
||||
$("#shopdropdown").selectmenu();
|
||||
$("#countrytwo").selectmenu();
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*-----------------LightBox-----------------*/
|
||||
//LightBox / Fancybox
|
||||
if ($('.lightbox-image').length) {
|
||||
$('.lightbox-image').fancybox({
|
||||
openEffect: 'fade',
|
||||
closeEffect: 'fade',
|
||||
helpers: {
|
||||
media: {}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*-----------------searchpopuptoggler-----------------*/
|
||||
function searchpopuptoggler() {
|
||||
if ($('.search-popup__toggler').length) {
|
||||
$('.search-popup__toggler').on('click', function(e) {
|
||||
$('.search-popup').addClass('active');
|
||||
e.preventDefault();
|
||||
});
|
||||
}
|
||||
}
|
||||
/*-----------------searchpopupoverlay-----------------*/
|
||||
|
||||
function searchpopupoverlay() {
|
||||
|
||||
if ($('.search-popup__overlay').length) {
|
||||
$('.search-popup__overlay').on('click', function(e) {
|
||||
$('.search-popup').removeClass('active');
|
||||
e.preventDefault();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/*-----------------customcursoroverlay-----------------*/
|
||||
function customcursoroverlay() {
|
||||
|
||||
if ($('.custom-cursor__overlay').length) {
|
||||
|
||||
// / cursor /
|
||||
var cursor = $(".custom-cursor__overlay .cursor"),
|
||||
follower = $(".custom-cursor__overlay .cursor-follower");
|
||||
|
||||
var posX = 0,
|
||||
posY = 0;
|
||||
|
||||
var mouseX = 0,
|
||||
mouseY = 0;
|
||||
|
||||
TweenMax.to({}, 0.016, {
|
||||
repeat: -1,
|
||||
onRepeat: function() {
|
||||
posX += (mouseX - posX) / 9;
|
||||
posY += (mouseY - posY) / 9;
|
||||
|
||||
TweenMax.set(follower, {
|
||||
css: {
|
||||
left: posX - 22,
|
||||
top: posY - 22
|
||||
}
|
||||
});
|
||||
|
||||
TweenMax.set(cursor, {
|
||||
css: {
|
||||
left: mouseX,
|
||||
top: mouseY
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on("mousemove", function(e) {
|
||||
var scrollTop = window.pageYOffset || document.documentElement.scrollTop;
|
||||
mouseX = e.pageX;
|
||||
mouseY = e.pageY - scrollTop;
|
||||
});
|
||||
$("button, a").on("mouseenter", function() {
|
||||
cursor.addClass("active");
|
||||
follower.addClass("active");
|
||||
});
|
||||
$("button, a").on("mouseleave", function() {
|
||||
cursor.removeClass("active");
|
||||
follower.removeClass("active");
|
||||
});
|
||||
$(".custom-cursor__overlay").on("mouseenter", function() {
|
||||
cursor.addClass("close-cursor");
|
||||
follower.addClass("close-cursor");
|
||||
});
|
||||
$(".custom-cursor__overlay").on("mouseleave", function() {
|
||||
cursor.removeClass("close-cursor");
|
||||
follower.removeClass("close-cursor");
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*-----------------sidemenutoggler-----------------*/
|
||||
function sidemenutoggler() {
|
||||
if ($('.side-menu__toggler').length) {
|
||||
$('.side-menu__toggler').on('click', function(e) {
|
||||
$('.side-menu__block').addClass('active');
|
||||
e.preventDefault();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/*-----------------sidemenublockoverlay-----------------*/
|
||||
function sidemenublockoverlay() {
|
||||
|
||||
if ($('.side-menu__block-overlay').length) {
|
||||
$('.side-menu__block-overlay').on('click', function(e) {
|
||||
$('.side-menu__block').removeClass('active');
|
||||
e.preventDefault();
|
||||
});
|
||||
}
|
||||
}
|
||||
/*-----------------update clock-----------------*/
|
||||
function update() {
|
||||
|
||||
$('#clock').html(moment().format('D. MMMM YYYY H:mm:ss'));
|
||||
}
|
||||
|
||||
setInterval(update, 1000);
|
||||
/*-----------------isotope-----------------*/
|
||||
// use document.ready instead of window.load
|
||||
// window.load waits for all resources to be loaded first,
|
||||
// can be a long time
|
||||
/*jQuery(function() {
|
||||
// now doc is ready, make selection
|
||||
// use another selector, not .isotope,
|
||||
// since that is dynamically added in Isotope v1
|
||||
var $container = jQuery('#filter_container');
|
||||
// use imagesLoaded, instead of window.load
|
||||
$container.imagesLoaded(function() {
|
||||
$container.isotope({
|
||||
itemSelector: '.grid-item',
|
||||
animationOptions: {
|
||||
duration: 500,
|
||||
easing: 'linear',
|
||||
queue: false
|
||||
}
|
||||
});
|
||||
})
|
||||
});*/
|
||||
/*-----------------Portfolio Tabs-----------------*/
|
||||
if ($('.product_tabs').length) {
|
||||
$('.product_tabs .product_tab_btns .p_tab_btn').on('click', function(e) {
|
||||
e.preventDefault();
|
||||
var target = $($(this).attr('data-tab'));
|
||||
|
||||
if ($(target).hasClass('actve-tab')) {
|
||||
return false;
|
||||
} else {
|
||||
$('.product_tabs .product_tab_btns .p_tab_btn').removeClass('active-btn');
|
||||
$(this).addClass('active-btn');
|
||||
$('.product_tabs .p_tabs_content .p_tab').removeClass('active-tab');
|
||||
$(target).addClass('active-tab');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
//Update Header Style and Scroll to Top
|
||||
|
||||
function scrolltotop() {
|
||||
|
||||
$(document).ready(function() {
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 100) {
|
||||
$('#scroll').fadeIn();
|
||||
} else {
|
||||
$('#scroll').fadeOut();
|
||||
}
|
||||
});
|
||||
$('#scroll').click(function() {
|
||||
$("html, body").animate({
|
||||
scrollTop: 0
|
||||
}, 600);
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
scrolltotop();
|
||||
/*-----------------scrollnav-----------------*/
|
||||
function scrollnav() {
|
||||
//Add One Page nav
|
||||
if ($('.scroll-nav').length) {
|
||||
$('.scroll-nav ul').onePageNav();
|
||||
}
|
||||
}
|
||||
|
||||
function scrollnavone() {
|
||||
//Add One Page nav
|
||||
if ($('.scroll-navone').length) {
|
||||
$('.scroll-navone ul').onePageNav();
|
||||
}
|
||||
}
|
||||
|
||||
function scrollnavtwo() {
|
||||
//Add One Page nav
|
||||
if ($('.scroll-navtwo').length) {
|
||||
$('.scroll-navtwo ul').onePageNav();
|
||||
}
|
||||
}
|
||||
$(document).ready(function() {
|
||||
|
||||
var CurrentUrl= document.URL;
|
||||
var CurrentUrlEnd = CurrentUrl.split('/').filter(Boolean).pop();
|
||||
console.log(CurrentUrlEnd);
|
||||
$( "#nav .nav_item a" ).each(function() {
|
||||
var ThisUrl = $(this).attr('href');
|
||||
var ThisUrlEnd = ThisUrl.split('/').filter(Boolean).pop();
|
||||
|
||||
if(ThisUrlEnd == CurrentUrlEnd){
|
||||
$(this).closest('.nav_item').addClass('active')
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
/*-----------------pricefilter-----------------*/
|
||||
|
||||
function pricefilter() {
|
||||
if ($('#slider-range').length) {
|
||||
$(function() {
|
||||
$("#slider-range").slider({
|
||||
range: true,
|
||||
min: 0,
|
||||
max: 500,
|
||||
values: [75, 300],
|
||||
slide: function(event, ui) {
|
||||
$("#amount").val("$" + ui.values[0] + " - $" + ui.values[1]);
|
||||
}
|
||||
});
|
||||
$("#amount").val("$" + $("#slider-range").slider("values", 0) +
|
||||
" - $" + $("#slider-range").slider("values", 1));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*-----------------cart---product---increasing--------------*/
|
||||
|
||||
|
||||
$('.add').click(function() {
|
||||
if ($(this).prev().val() < 20) {
|
||||
$(this).prev().val(+$(this).prev().val() + 1);
|
||||
}
|
||||
});
|
||||
$('.sub').click(function() {
|
||||
if ($(this).next().val() > 1) {
|
||||
if ($(this).next().val() > 1) $(this).next().val(+$(this).next().val() - 1);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
/*--------------//single_items Carousel------------------*/
|
||||
|
||||
|
||||
function singleitems() {
|
||||
if ($('.single_items').length) {
|
||||
|
||||
$('.single_items').owlCarousel({
|
||||
|
||||
loop: true,
|
||||
|
||||
margin: 30,
|
||||
|
||||
nav: false,
|
||||
|
||||
dots: false,
|
||||
|
||||
autoplay: true,
|
||||
|
||||
slideTransition: 'linear',
|
||||
|
||||
autoplaySpeed: 1000,
|
||||
|
||||
autoplayHoverPause: true,
|
||||
|
||||
navText: ['<span class="icon flaticon-left-arrow"></span>', '<span class="icon flaticon-next"></span>'],
|
||||
|
||||
responsive: {
|
||||
|
||||
0: {
|
||||
|
||||
items: 1
|
||||
|
||||
},
|
||||
|
||||
600: {
|
||||
|
||||
items: 1
|
||||
|
||||
},
|
||||
|
||||
768: {
|
||||
|
||||
items: 1
|
||||
|
||||
},
|
||||
|
||||
1024: {
|
||||
|
||||
items: 1
|
||||
|
||||
},
|
||||
|
||||
1200: {
|
||||
|
||||
items: 1
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
/*--------------one_items------------------*/
|
||||
function mainslider() {
|
||||
if ($('.main_slider').length) {
|
||||
$('.main_slider').owlCarousel({
|
||||
loop: true,
|
||||
margin: 0,
|
||||
nav: true,
|
||||
dots: true,
|
||||
center: false,
|
||||
autoplay: true,
|
||||
animateOut: 'fadeOut',
|
||||
animateIn: 'fadeIn',
|
||||
active: true,
|
||||
smartSpeed: 1000,
|
||||
autoplayTimeout: 7000,
|
||||
navText: ['<span class="clearfix prev flaticon-left"></span>', '<span class="clearfix flaticon-right"></span>'],
|
||||
|
||||
responsive: {
|
||||
0: {
|
||||
items: 1
|
||||
},
|
||||
800: {
|
||||
items: 1
|
||||
},
|
||||
|
||||
1000: {
|
||||
items: 1
|
||||
},
|
||||
1200: {
|
||||
items: 1
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
function mainslidertwo() {
|
||||
if ($('.main_slider_two').length) {
|
||||
$('.main_slider_two').owlCarousel({
|
||||
loop: true,
|
||||
margin: 0,
|
||||
nav: true,
|
||||
dots: true,
|
||||
center: false,
|
||||
autoplay: true,
|
||||
animateOut: 'fadeOut',
|
||||
animateIn: 'fadeIn',
|
||||
active: true,
|
||||
smartSpeed: 1000,
|
||||
autoplayTimeout: 7000,
|
||||
navText: ['<span class="clearfix prev flaticon-left"></span>', '<span class="clearfix flaticon-right"></span>'],
|
||||
|
||||
responsive: {
|
||||
0: {
|
||||
items: 1
|
||||
},
|
||||
800: {
|
||||
items: 1
|
||||
},
|
||||
|
||||
1000: {
|
||||
items: 1
|
||||
},
|
||||
1200: {
|
||||
items: 1
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
/*--------------four_items------------------*/
|
||||
function fouritems() {
|
||||
if ($('.four_items').length) {
|
||||
$('.four_items').owlCarousel({
|
||||
loop: true,
|
||||
margin: 0,
|
||||
nav: true,
|
||||
dots: true,
|
||||
center: false,
|
||||
autoplay: true,
|
||||
smartSpeed: 3000,
|
||||
autoplayTimeout: 4000,
|
||||
navText: ['<span class="clearfix prev flaticon-left-arrow"></span>', '<span class="clearfix flaticon-next"></span>'],
|
||||
|
||||
responsive: {
|
||||
0: {
|
||||
items: 1
|
||||
},
|
||||
800: {
|
||||
items: 2
|
||||
},
|
||||
|
||||
1200: {
|
||||
items: 3
|
||||
},
|
||||
1400: {
|
||||
items: 4
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*--------------three_items_center------------------*/
|
||||
function threeitemscenter() {
|
||||
if ($('.three_items_center').length) {
|
||||
$('.three_items_center').owlCarousel({
|
||||
loop: true,
|
||||
margin: 0,
|
||||
nav: true,
|
||||
dots: true,
|
||||
center: true,
|
||||
autoplay: true,
|
||||
smartSpeed: 3000,
|
||||
autoplayTimeout: 4000,
|
||||
navText: ['<span class="clearfix prev flaticon-left-arrow"></span>', '<span class="clearfix flaticon-next"></span>'],
|
||||
|
||||
responsive: {
|
||||
0: {
|
||||
items: 1
|
||||
},
|
||||
800: {
|
||||
items: 2
|
||||
},
|
||||
|
||||
1000: {
|
||||
items: 3
|
||||
},
|
||||
1200: {
|
||||
items: 3,
|
||||
margin: 0,
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
/*--------------three_items------------------*/
|
||||
function threeitems() {
|
||||
if ($('.three_items').length) {
|
||||
$('.three_items').owlCarousel({
|
||||
loop: true,
|
||||
margin: 0,
|
||||
nav: true,
|
||||
dots: true,
|
||||
center: false,
|
||||
autoplay: true,
|
||||
smartSpeed: 3000,
|
||||
autoplayTimeout: 4000,
|
||||
navText: ['<span class="clearfix prev flaticon-left-arrow"></span>', '<span class="clearfix flaticon-next"></span>'],
|
||||
|
||||
responsive: {
|
||||
0: {
|
||||
items: 1
|
||||
},
|
||||
800: {
|
||||
items: 2
|
||||
},
|
||||
|
||||
1000: {
|
||||
items: 3
|
||||
},
|
||||
1200: {
|
||||
items: 3
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*--------------three_items------------------*/
|
||||
function threeitemsnoloop() {
|
||||
if ($('.three_items_noloop').length) {
|
||||
$('.three_items_noloop').owlCarousel({
|
||||
loop: false,
|
||||
margin: 0,
|
||||
nav: false,
|
||||
dots: false,
|
||||
center: false,
|
||||
autoplay: false,
|
||||
smartSpeed: 3000,
|
||||
autoplayTimeout: 4000,
|
||||
navText: ['<span class="clearfix prev flaticon-left-arrow"></span>', '<span class="clearfix flaticon-next"></span>'],
|
||||
|
||||
responsive: {
|
||||
0: {
|
||||
items: 1
|
||||
},
|
||||
800: {
|
||||
items: 2
|
||||
},
|
||||
|
||||
1000: {
|
||||
items: 3
|
||||
},
|
||||
1200: {
|
||||
items: 3
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------two_items------------------*/
|
||||
function twoitems() {
|
||||
if ($('.two_items').length) {
|
||||
$('.two_items').owlCarousel({
|
||||
loop: true,
|
||||
margin: 0,
|
||||
nav: true,
|
||||
dots: true,
|
||||
center: false,
|
||||
autoplay: true,
|
||||
smartSpeed: 3000,
|
||||
autoplayTimeout: 4000,
|
||||
navText: ['<span class="clearfix prev flaticon-left-arrow"></span>', '<span class="clearfix flaticon-next"></span>'],
|
||||
|
||||
responsive: {
|
||||
0: {
|
||||
items: 1
|
||||
},
|
||||
800: {
|
||||
items: 2
|
||||
},
|
||||
|
||||
1000: {
|
||||
items: 3
|
||||
},
|
||||
1200: {
|
||||
items: 2
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
/*--------------one_items------------------*/
|
||||
function oneitems() {
|
||||
if ($('.one_items').length) {
|
||||
$('.one_items').owlCarousel({
|
||||
loop: true,
|
||||
margin: 0,
|
||||
nav: true,
|
||||
dots: true,
|
||||
center: false,
|
||||
autoplay: true,
|
||||
smartSpeed: 3000,
|
||||
autoplayTimeout: 4000,
|
||||
navText: ['<span class="clearfix prev flaticon-left-arrow"></span>', '<span class="clearfix flaticon-next"></span>'],
|
||||
|
||||
responsive: {
|
||||
0: {
|
||||
items: 1
|
||||
},
|
||||
800: {
|
||||
items: 1
|
||||
},
|
||||
|
||||
1000: {
|
||||
items: 1
|
||||
},
|
||||
1200: {
|
||||
items: 1
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function flexslideractivation() {
|
||||
$('#carousel').flexslider({
|
||||
animation: "slide",
|
||||
controlNav: false,
|
||||
animationLoop: false,
|
||||
slideshow: false,
|
||||
itemWidth: 140,
|
||||
itemMargin: 30,
|
||||
asNavFor: '#slider'
|
||||
});
|
||||
|
||||
$('#slider').flexslider({
|
||||
animation: "slide",
|
||||
controlNav: false,
|
||||
animationLoop: false,
|
||||
slideshow: false,
|
||||
sync: "#carousel",
|
||||
start: function(slider){
|
||||
$('body').removeClass('loading');
|
||||
}
|
||||
});
|
||||
}
|
||||
if ($('.swiper-three').length) {
|
||||
var swiper = new Swiper('.swiper-three', {
|
||||
|
||||
|
||||
spaceBetween: 15,
|
||||
pagination: {
|
||||
el: '.swiper-pagination',
|
||||
type: 'progressbar',
|
||||
clickable: true,
|
||||
},
|
||||
breakpoints: {
|
||||
640: {
|
||||
slidesPerView: 1,
|
||||
|
||||
},
|
||||
768: {
|
||||
slidesPerView: 2,
|
||||
|
||||
},
|
||||
1024: {
|
||||
slidesPerView: 3,
|
||||
|
||||
},
|
||||
}
|
||||
});
|
||||
};
|
||||
// Dom Ready Function
|
||||
jQuery(document).on('ready', function() {
|
||||
(function($) {
|
||||
oneitems();
|
||||
singleitems();
|
||||
twoitems();
|
||||
threeitems();
|
||||
threeitemsnoloop();
|
||||
threeitemscenter();
|
||||
fouritems();
|
||||
mainslider();
|
||||
flexslideractivation();
|
||||
selectdropdown();
|
||||
pricefilter();
|
||||
searchpopuptoggler();
|
||||
searchpopupoverlay();
|
||||
customcursoroverlay();
|
||||
sidemenutoggler();
|
||||
sidemenublockoverlay();
|
||||
scrollnav();
|
||||
mainslidertwo();
|
||||
scrollnavone();
|
||||
scrollnavtwo();
|
||||
})(jQuery);
|
||||
});
|
||||
|
||||
/* ==========================================================================
|
||||
When document is Scrollig, do
|
||||
========================================================================== */
|
||||
|
||||
|
||||
|
||||
// Instance Of Fuction while Window Load event
|
||||
jQuery(window).on('load', function() {
|
||||
(function($) {
|
||||
prealoader();
|
||||
|
||||
|
||||
})(jQuery);
|
||||
});
|
||||
File diff suppressed because one or more lines are too long
Vendored
+1790
File diff suppressed because it is too large
Load Diff
Vendored
+18709
File diff suppressed because it is too large
Load Diff
Vendored
+5238
File diff suppressed because it is too large
Load Diff
+6
File diff suppressed because one or more lines are too long
Vendored
+11008
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,159 @@
|
||||
|
||||
// 7. google map
|
||||
function gMap () {
|
||||
if ($('.google-map').length) {
|
||||
$('.google-map').each(function () {
|
||||
// getting options from html
|
||||
var Self = $(this);
|
||||
var mapName = Self.attr('id');
|
||||
var mapLat = Self.data('map-lat');
|
||||
var mapLng = Self.data('map-lng');
|
||||
var iconPath = Self.data('icon-path');
|
||||
var mapZoom = Self.data('map-zoom');
|
||||
var mapTitle = Self.data('map-title');
|
||||
var markers = Self.data('markers');
|
||||
|
||||
// defined default style
|
||||
var styles = [
|
||||
{
|
||||
"featureType": "administrative",
|
||||
"elementType": "labels.text.fill",
|
||||
"stylers": [
|
||||
{
|
||||
"color": "#222222"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"featureType": "landscape",
|
||||
"elementType": "all",
|
||||
"stylers": [
|
||||
{
|
||||
"color": "#f8f4e8"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"featureType": "poi",
|
||||
"elementType": "all",
|
||||
"stylers": [
|
||||
{
|
||||
"visibility": "off"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"featureType": "road",
|
||||
"elementType": "all",
|
||||
"stylers": [
|
||||
{
|
||||
"saturation": -100
|
||||
},
|
||||
{
|
||||
"color": "#ffffff"
|
||||
},
|
||||
{
|
||||
"lightness": 45
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"featureType": "road.highway",
|
||||
"elementType": "all",
|
||||
"stylers": [
|
||||
{
|
||||
"color": "#f2f2f2"
|
||||
},
|
||||
{
|
||||
"visibility": "simplified"
|
||||
}
|
||||
|
||||
]
|
||||
},
|
||||
{
|
||||
"featureType": "road.arterial",
|
||||
"elementType": "labels.icon",
|
||||
"stylers": [
|
||||
{
|
||||
"visibility": "off"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"featureType": "transit",
|
||||
"elementType": "all",
|
||||
"stylers": [
|
||||
{
|
||||
"visibility": "off"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"featureType": "water",
|
||||
"elementType": "all",
|
||||
"stylers": [
|
||||
{
|
||||
"color": "#abd0fa"
|
||||
},
|
||||
{
|
||||
"visibility": "on"
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
// if zoom not defined the zoom value will be 15;
|
||||
if (mapZoom) {
|
||||
var mapZoom = 6;
|
||||
};
|
||||
// init map
|
||||
var map;
|
||||
map = new GMaps({
|
||||
div: '#'+mapName,
|
||||
scrollwheel: false,
|
||||
lat: mapLat,
|
||||
lng: mapLng,
|
||||
styles: styles,
|
||||
zoom: mapZoom
|
||||
});
|
||||
// if icon path setted then show marker
|
||||
if(iconPath) {
|
||||
$.each(markers, function (index, value) {
|
||||
var index = value;
|
||||
var html;
|
||||
if (index[2]) {
|
||||
html = index[2];
|
||||
};
|
||||
if (!index[3]) {
|
||||
index[3] = iconPath;
|
||||
};
|
||||
|
||||
map.addMarker({
|
||||
icon: index[3],
|
||||
lat: index[0],
|
||||
lng: index[1],
|
||||
infoWindow: {
|
||||
content: html
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Instance of fuction while Document ready event
|
||||
jQuery(document).ready(function () {
|
||||
(function ($) {
|
||||
gMap();
|
||||
|
||||
|
||||
})(jQuery);
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
Vendored
+2
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@@ -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.nav-link',
|
||||
currentClass: 'current',
|
||||
changeHash: false,
|
||||
easing: 'swing',
|
||||
filter: '',
|
||||
scrollSpeed: 1500,
|
||||
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 - 80;
|
||||
|
||||
$('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);
|
||||
Vendored
+339
@@ -0,0 +1,339 @@
|
||||
/*
|
||||
Copyright (C) Federico Zivolo 2019
|
||||
Distributed under the MIT License (license terms are at http://opensource.org/licenses/MIT).
|
||||
*/
|
||||
(function(e, t) { 'object' == typeof exports && 'undefined' != typeof module ? module.exports = t() : 'function' == typeof define && define.amd ? define(t) : e.Popper = t() })(this, function() { 'use strict';
|
||||
|
||||
function e(e) { return e && '[object Function]' === {}.toString.call(e) }
|
||||
|
||||
function t(e, t) { if (1 !== e.nodeType) return []; var o = e.ownerDocument.defaultView,
|
||||
n = o.getComputedStyle(e, null); return t ? n[t] : n }
|
||||
|
||||
function o(e) { return 'HTML' === e.nodeName ? e : e.parentNode || e.host }
|
||||
|
||||
function n(e) { if (!e) return document.body; switch (e.nodeName) {
|
||||
case 'HTML':
|
||||
case 'BODY':
|
||||
return e.ownerDocument.body;
|
||||
case '#document':
|
||||
return e.body; } var i = t(e),
|
||||
r = i.overflow,
|
||||
p = i.overflowX,
|
||||
s = i.overflowY; return /(auto|scroll|overlay)/.test(r + s + p) ? e : n(o(e)) }
|
||||
|
||||
function i(e) { return e && e.referenceNode ? e.referenceNode : e }
|
||||
|
||||
function r(e) { return 11 === e ? re : 10 === e ? pe : re || pe }
|
||||
|
||||
function p(e) { if (!e) return document.documentElement; for (var o = r(10) ? document.body : null, n = e.offsetParent || null; n === o && e.nextElementSibling;) n = (e = e.nextElementSibling).offsetParent; var i = n && n.nodeName; return i && 'BODY' !== i && 'HTML' !== i ? -1 !== ['TH', 'TD', 'TABLE'].indexOf(n.nodeName) && 'static' === t(n, 'position') ? p(n) : n : e ? e.ownerDocument.documentElement : document.documentElement }
|
||||
|
||||
function s(e) { var t = e.nodeName; return 'BODY' !== t && ('HTML' === t || p(e.firstElementChild) === e) }
|
||||
|
||||
function d(e) { return null === e.parentNode ? e : d(e.parentNode) }
|
||||
|
||||
function a(e, t) { if (!e || !e.nodeType || !t || !t.nodeType) return document.documentElement; var o = e.compareDocumentPosition(t) & Node.DOCUMENT_POSITION_FOLLOWING,
|
||||
n = o ? e : t,
|
||||
i = o ? t : e,
|
||||
r = document.createRange();
|
||||
r.setStart(n, 0), r.setEnd(i, 0); var l = r.commonAncestorContainer; if (e !== l && t !== l || n.contains(i)) return s(l) ? l : p(l); var f = d(e); return f.host ? a(f.host, t) : a(e, d(t).host) }
|
||||
|
||||
function l(e) { var t = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : 'top',
|
||||
o = 'top' === t ? 'scrollTop' : 'scrollLeft',
|
||||
n = e.nodeName; if ('BODY' === n || 'HTML' === n) { var i = e.ownerDocument.documentElement,
|
||||
r = e.ownerDocument.scrollingElement || i; return r[o] } return e[o] }
|
||||
|
||||
function f(e, t) { var o = 2 < arguments.length && void 0 !== arguments[2] && arguments[2],
|
||||
n = l(t, 'top'),
|
||||
i = l(t, 'left'),
|
||||
r = o ? -1 : 1; return e.top += n * r, e.bottom += n * r, e.left += i * r, e.right += i * r, e }
|
||||
|
||||
function m(e, t) { var o = 'x' === t ? 'Left' : 'Top',
|
||||
n = 'Left' == o ? 'Right' : 'Bottom'; return parseFloat(e['border' + o + 'Width'], 10) + parseFloat(e['border' + n + 'Width'], 10) }
|
||||
|
||||
function h(e, t, o, n) { return ee(t['offset' + e], t['scroll' + e], o['client' + e], o['offset' + e], o['scroll' + e], r(10) ? parseInt(o['offset' + e]) + parseInt(n['margin' + ('Height' === e ? 'Top' : 'Left')]) + parseInt(n['margin' + ('Height' === e ? 'Bottom' : 'Right')]) : 0) }
|
||||
|
||||
function c(e) { var t = e.body,
|
||||
o = e.documentElement,
|
||||
n = r(10) && getComputedStyle(o); return { height: h('Height', t, o, n), width: h('Width', t, o, n) } }
|
||||
|
||||
function g(e) { return le({}, e, { right: e.left + e.width, bottom: e.top + e.height }) }
|
||||
|
||||
function u(e) { var o = {}; try { if (r(10)) { o = e.getBoundingClientRect(); var n = l(e, 'top'),
|
||||
i = l(e, 'left');
|
||||
o.top += n, o.left += i, o.bottom += n, o.right += i } else o = e.getBoundingClientRect() } catch (t) {} var p = { left: o.left, top: o.top, width: o.right - o.left, height: o.bottom - o.top },
|
||||
s = 'HTML' === e.nodeName ? c(e.ownerDocument) : {},
|
||||
d = s.width || e.clientWidth || p.width,
|
||||
a = s.height || e.clientHeight || p.height,
|
||||
f = e.offsetWidth - d,
|
||||
h = e.offsetHeight - a; if (f || h) { var u = t(e);
|
||||
f -= m(u, 'x'), h -= m(u, 'y'), p.width -= f, p.height -= h } return g(p) }
|
||||
|
||||
function b(e, o) { var i = 2 < arguments.length && void 0 !== arguments[2] && arguments[2],
|
||||
p = r(10),
|
||||
s = 'HTML' === o.nodeName,
|
||||
d = u(e),
|
||||
a = u(o),
|
||||
l = n(e),
|
||||
m = t(o),
|
||||
h = parseFloat(m.borderTopWidth, 10),
|
||||
c = parseFloat(m.borderLeftWidth, 10);
|
||||
i && s && (a.top = ee(a.top, 0), a.left = ee(a.left, 0)); var b = g({ top: d.top - a.top - h, left: d.left - a.left - c, width: d.width, height: d.height }); if (b.marginTop = 0, b.marginLeft = 0, !p && s) { var w = parseFloat(m.marginTop, 10),
|
||||
y = parseFloat(m.marginLeft, 10);
|
||||
b.top -= h - w, b.bottom -= h - w, b.left -= c - y, b.right -= c - y, b.marginTop = w, b.marginLeft = y } return (p && !i ? o.contains(l) : o === l && 'BODY' !== l.nodeName) && (b = f(b, o)), b }
|
||||
|
||||
function w(e) { var t = 1 < arguments.length && void 0 !== arguments[1] && arguments[1],
|
||||
o = e.ownerDocument.documentElement,
|
||||
n = b(e, o),
|
||||
i = ee(o.clientWidth, window.innerWidth || 0),
|
||||
r = ee(o.clientHeight, window.innerHeight || 0),
|
||||
p = t ? 0 : l(o),
|
||||
s = t ? 0 : l(o, 'left'),
|
||||
d = { top: p - n.top + n.marginTop, left: s - n.left + n.marginLeft, width: i, height: r }; return g(d) }
|
||||
|
||||
function y(e) { var n = e.nodeName; if ('BODY' === n || 'HTML' === n) return !1; if ('fixed' === t(e, 'position')) return !0; var i = o(e); return !!i && y(i) }
|
||||
|
||||
function E(e) { if (!e || !e.parentElement || r()) return document.documentElement; for (var o = e.parentElement; o && 'none' === t(o, 'transform');) o = o.parentElement; return o || document.documentElement }
|
||||
|
||||
function v(e, t, r, p) { var s = 4 < arguments.length && void 0 !== arguments[4] && arguments[4],
|
||||
d = { top: 0, left: 0 },
|
||||
l = s ? E(e) : a(e, i(t)); if ('viewport' === p) d = w(l, s);
|
||||
else { var f; 'scrollParent' === p ? (f = n(o(t)), 'BODY' === f.nodeName && (f = e.ownerDocument.documentElement)) : 'window' === p ? f = e.ownerDocument.documentElement : f = p; var m = b(f, l, s); if ('HTML' === f.nodeName && !y(l)) { var h = c(e.ownerDocument),
|
||||
g = h.height,
|
||||
u = h.width;
|
||||
d.top += m.top - m.marginTop, d.bottom = g + m.top, d.left += m.left - m.marginLeft, d.right = u + m.left } else d = m }
|
||||
r = r || 0; var v = 'number' == typeof r; return d.left += v ? r : r.left || 0, d.top += v ? r : r.top || 0, d.right -= v ? r : r.right || 0, d.bottom -= v ? r : r.bottom || 0, d }
|
||||
|
||||
function x(e) { var t = e.width,
|
||||
o = e.height; return t * o }
|
||||
|
||||
function O(e, t, o, n, i) { var r = 5 < arguments.length && void 0 !== arguments[5] ? arguments[5] : 0; if (-1 === e.indexOf('auto')) return e; var p = v(o, n, r, i),
|
||||
s = { top: { width: p.width, height: t.top - p.top }, right: { width: p.right - t.right, height: p.height }, bottom: { width: p.width, height: p.bottom - t.bottom }, left: { width: t.left - p.left, height: p.height } },
|
||||
d = Object.keys(s).map(function(e) { return le({ key: e }, s[e], { area: x(s[e]) }) }).sort(function(e, t) { return t.area - e.area }),
|
||||
a = d.filter(function(e) { var t = e.width,
|
||||
n = e.height; return t >= o.clientWidth && n >= o.clientHeight }),
|
||||
l = 0 < a.length ? a[0].key : d[0].key,
|
||||
f = e.split('-')[1]; return l + (f ? '-' + f : '') }
|
||||
|
||||
function L(e, t, o) { var n = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null,
|
||||
r = n ? E(t) : a(t, i(o)); return b(o, r, n) }
|
||||
|
||||
function S(e) { var t = e.ownerDocument.defaultView,
|
||||
o = t.getComputedStyle(e),
|
||||
n = parseFloat(o.marginTop || 0) + parseFloat(o.marginBottom || 0),
|
||||
i = parseFloat(o.marginLeft || 0) + parseFloat(o.marginRight || 0),
|
||||
r = { width: e.offsetWidth + i, height: e.offsetHeight + n }; return r }
|
||||
|
||||
function T(e) { var t = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' }; return e.replace(/left|right|bottom|top/g, function(e) { return t[e] }) }
|
||||
|
||||
function C(e, t, o) { o = o.split('-')[0]; var n = S(e),
|
||||
i = { width: n.width, height: n.height },
|
||||
r = -1 !== ['right', 'left'].indexOf(o),
|
||||
p = r ? 'top' : 'left',
|
||||
s = r ? 'left' : 'top',
|
||||
d = r ? 'height' : 'width',
|
||||
a = r ? 'width' : 'height'; return i[p] = t[p] + t[d] / 2 - n[d] / 2, i[s] = o === s ? t[s] - n[a] : t[T(s)], i }
|
||||
|
||||
function D(e, t) { return Array.prototype.find ? e.find(t) : e.filter(t)[0] }
|
||||
|
||||
function N(e, t, o) { if (Array.prototype.findIndex) return e.findIndex(function(e) { return e[t] === o }); var n = D(e, function(e) { return e[t] === o }); return e.indexOf(n) }
|
||||
|
||||
function P(t, o, n) { var i = void 0 === n ? t : t.slice(0, N(t, 'name', n)); return i.forEach(function(t) { t['function'] && console.warn('`modifier.function` is deprecated, use `modifier.fn`!'); var n = t['function'] || t.fn;
|
||||
t.enabled && e(n) && (o.offsets.popper = g(o.offsets.popper), o.offsets.reference = g(o.offsets.reference), o = n(o, t)) }), o }
|
||||
|
||||
function k() { if (!this.state.isDestroyed) { var e = { instance: this, styles: {}, arrowStyles: {}, attributes: {}, flipped: !1, offsets: {} };
|
||||
e.offsets.reference = L(this.state, this.popper, this.reference, this.options.positionFixed), e.placement = O(this.options.placement, e.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding), e.originalPlacement = e.placement, e.positionFixed = this.options.positionFixed, e.offsets.popper = C(this.popper, e.offsets.reference, e.placement), e.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute', e = P(this.modifiers, e), this.state.isCreated ? this.options.onUpdate(e) : (this.state.isCreated = !0, this.options.onCreate(e)) } }
|
||||
|
||||
function W(e, t) { return e.some(function(e) { var o = e.name,
|
||||
n = e.enabled; return n && o === t }) }
|
||||
|
||||
function B(e) { for (var t = [!1, 'ms', 'Webkit', 'Moz', 'O'], o = e.charAt(0).toUpperCase() + e.slice(1), n = 0; n < t.length; n++) { var i = t[n],
|
||||
r = i ? '' + i + o : e; if ('undefined' != typeof document.body.style[r]) return r } return null }
|
||||
|
||||
function H() { return this.state.isDestroyed = !0, W(this.modifiers, 'applyStyle') && (this.popper.removeAttribute('x-placement'), this.popper.style.position = '', this.popper.style.top = '', this.popper.style.left = '', this.popper.style.right = '', this.popper.style.bottom = '', this.popper.style.willChange = '', this.popper.style[B('transform')] = ''), this.disableEventListeners(), this.options.removeOnDestroy && this.popper.parentNode.removeChild(this.popper), this }
|
||||
|
||||
function A(e) { var t = e.ownerDocument; return t ? t.defaultView : window }
|
||||
|
||||
function M(e, t, o, i) { var r = 'BODY' === e.nodeName,
|
||||
p = r ? e.ownerDocument.defaultView : e;
|
||||
p.addEventListener(t, o, { passive: !0 }), r || M(n(p.parentNode), t, o, i), i.push(p) }
|
||||
|
||||
function F(e, t, o, i) { o.updateBound = i, A(e).addEventListener('resize', o.updateBound, { passive: !0 }); var r = n(e); return M(r, 'scroll', o.updateBound, o.scrollParents), o.scrollElement = r, o.eventsEnabled = !0, o }
|
||||
|
||||
function I() { this.state.eventsEnabled || (this.state = F(this.reference, this.options, this.state, this.scheduleUpdate)) }
|
||||
|
||||
function R(e, t) { return A(e).removeEventListener('resize', t.updateBound), t.scrollParents.forEach(function(e) { e.removeEventListener('scroll', t.updateBound) }), t.updateBound = null, t.scrollParents = [], t.scrollElement = null, t.eventsEnabled = !1, t }
|
||||
|
||||
function U() { this.state.eventsEnabled && (cancelAnimationFrame(this.scheduleUpdate), this.state = R(this.reference, this.state)) }
|
||||
|
||||
function Y(e) { return '' !== e && !isNaN(parseFloat(e)) && isFinite(e) }
|
||||
|
||||
function V(e, t) { Object.keys(t).forEach(function(o) { var n = ''; - 1 !== ['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(o) && Y(t[o]) && (n = 'px'), e.style[o] = t[o] + n }) }
|
||||
|
||||
function j(e, t) { Object.keys(t).forEach(function(o) { var n = t[o];!1 === n ? e.removeAttribute(o) : e.setAttribute(o, t[o]) }) }
|
||||
|
||||
function q(e, t) { var o = e.offsets,
|
||||
n = o.popper,
|
||||
i = o.reference,
|
||||
r = $,
|
||||
p = function(e) { return e },
|
||||
s = r(i.width),
|
||||
d = r(n.width),
|
||||
a = -1 !== ['left', 'right'].indexOf(e.placement),
|
||||
l = -1 !== e.placement.indexOf('-'),
|
||||
f = t ? a || l || s % 2 == d % 2 ? r : Z : p,
|
||||
m = t ? r : p; return { left: f(1 == s % 2 && 1 == d % 2 && !l && t ? n.left - 1 : n.left), top: m(n.top), bottom: m(n.bottom), right: f(n.right) } }
|
||||
|
||||
function K(e, t, o) { var n = D(e, function(e) { var o = e.name; return o === t }),
|
||||
i = !!n && e.some(function(e) { return e.name === o && e.enabled && e.order < n.order }); if (!i) { var r = '`' + t + '`';
|
||||
console.warn('`' + o + '`' + ' modifier is required by ' + r + ' modifier in order to work, be sure to include it before ' + r + '!') } return i }
|
||||
|
||||
function z(e) { return 'end' === e ? 'start' : 'start' === e ? 'end' : e }
|
||||
|
||||
function G(e) { var t = 1 < arguments.length && void 0 !== arguments[1] && arguments[1],
|
||||
o = he.indexOf(e),
|
||||
n = he.slice(o + 1).concat(he.slice(0, o)); return t ? n.reverse() : n }
|
||||
|
||||
function _(e, t, o, n) { var i = e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),
|
||||
r = +i[1],
|
||||
p = i[2]; if (!r) return e; if (0 === p.indexOf('%')) { var s; switch (p) {
|
||||
case '%p':
|
||||
s = o; break;
|
||||
case '%':
|
||||
case '%r':
|
||||
default:
|
||||
s = n; } var d = g(s); return d[t] / 100 * r } if ('vh' === p || 'vw' === p) { var a; return a = 'vh' === p ? ee(document.documentElement.clientHeight, window.innerHeight || 0) : ee(document.documentElement.clientWidth, window.innerWidth || 0), a / 100 * r } return r }
|
||||
|
||||
function X(e, t, o, n) { var i = [0, 0],
|
||||
r = -1 !== ['right', 'left'].indexOf(n),
|
||||
p = e.split(/(\+|\-)/).map(function(e) { return e.trim() }),
|
||||
s = p.indexOf(D(p, function(e) { return -1 !== e.search(/,|\s/) }));
|
||||
p[s] && -1 === p[s].indexOf(',') && console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.'); var d = /\s*,\s*|\s+/,
|
||||
a = -1 === s ? [p] : [p.slice(0, s).concat([p[s].split(d)[0]]), [p[s].split(d)[1]].concat(p.slice(s + 1))]; return a = a.map(function(e, n) { var i = (1 === n ? !r : r) ? 'height' : 'width',
|
||||
p = !1; return e.reduce(function(e, t) { return '' === e[e.length - 1] && -1 !== ['+', '-'].indexOf(t) ? (e[e.length - 1] = t, p = !0, e) : p ? (e[e.length - 1] += t, p = !1, e) : e.concat(t) }, []).map(function(e) { return _(e, i, t, o) }) }), a.forEach(function(e, t) { e.forEach(function(o, n) { Y(o) && (i[t] += o * ('-' === e[n - 1] ? -1 : 1)) }) }), i }
|
||||
|
||||
function J(e, t) { var o, n = t.offset,
|
||||
i = e.placement,
|
||||
r = e.offsets,
|
||||
p = r.popper,
|
||||
s = r.reference,
|
||||
d = i.split('-')[0]; return o = Y(+n) ? [+n, 0] : X(n, p, s, d), 'left' === d ? (p.top += o[0], p.left -= o[1]) : 'right' === d ? (p.top += o[0], p.left += o[1]) : 'top' === d ? (p.left += o[0], p.top -= o[1]) : 'bottom' === d && (p.left += o[0], p.top += o[1]), e.popper = p, e } var Q = Math.min,
|
||||
Z = Math.floor,
|
||||
$ = Math.round,
|
||||
ee = Math.max,
|
||||
te = 'undefined' != typeof window && 'undefined' != typeof document && 'undefined' != typeof navigator,
|
||||
oe = function() { for (var e = ['Edge', 'Trident', 'Firefox'], t = 0; t < e.length; t += 1)
|
||||
if (te && 0 <= navigator.userAgent.indexOf(e[t])) return 1;
|
||||
return 0 }(),
|
||||
ne = te && window.Promise,
|
||||
ie = ne ? function(e) { var t = !1; return function() { t || (t = !0, window.Promise.resolve().then(function() { t = !1, e() })) } } : function(e) { var t = !1; return function() { t || (t = !0, setTimeout(function() { t = !1, e() }, oe)) } },
|
||||
re = te && !!(window.MSInputMethodContext && document.documentMode),
|
||||
pe = te && /MSIE 10/.test(navigator.userAgent),
|
||||
se = function(e, t) { if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function') },
|
||||
de = function() {
|
||||
function e(e, t) { for (var o, n = 0; n < t.length; n++) o = t[n], o.enumerable = o.enumerable || !1, o.configurable = !0, 'value' in o && (o.writable = !0), Object.defineProperty(e, o.key, o) } return function(t, o, n) { return o && e(t.prototype, o), n && e(t, n), t } }(),
|
||||
ae = function(e, t, o) { return t in e ? Object.defineProperty(e, t, { value: o, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = o, e },
|
||||
le = Object.assign || function(e) { for (var t, o = 1; o < arguments.length; o++)
|
||||
for (var n in t = arguments[o], t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]); return e },
|
||||
fe = te && /Firefox/i.test(navigator.userAgent),
|
||||
me = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start'],
|
||||
he = me.slice(3),
|
||||
ce = { FLIP: 'flip', CLOCKWISE: 'clockwise', COUNTERCLOCKWISE: 'counterclockwise' },
|
||||
ge = function() {
|
||||
function t(o, n) { var i = this,
|
||||
r = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : {};
|
||||
se(this, t), this.scheduleUpdate = function() { return requestAnimationFrame(i.update) }, this.update = ie(this.update.bind(this)), this.options = le({}, t.Defaults, r), this.state = { isDestroyed: !1, isCreated: !1, scrollParents: [] }, this.reference = o && o.jquery ? o[0] : o, this.popper = n && n.jquery ? n[0] : n, this.options.modifiers = {}, Object.keys(le({}, t.Defaults.modifiers, r.modifiers)).forEach(function(e) { i.options.modifiers[e] = le({}, t.Defaults.modifiers[e] || {}, r.modifiers ? r.modifiers[e] : {}) }), this.modifiers = Object.keys(this.options.modifiers).map(function(e) { return le({ name: e }, i.options.modifiers[e]) }).sort(function(e, t) { return e.order - t.order }), this.modifiers.forEach(function(t) { t.enabled && e(t.onLoad) && t.onLoad(i.reference, i.popper, i.options, t, i.state) }), this.update(); var p = this.options.eventsEnabled;
|
||||
p && this.enableEventListeners(), this.state.eventsEnabled = p } return de(t, [{ key: 'update', value: function() { return k.call(this) } }, { key: 'destroy', value: function() { return H.call(this) } }, { key: 'enableEventListeners', value: function() { return I.call(this) } }, { key: 'disableEventListeners', value: function() { return U.call(this) } }]), t }(); return ge.Utils = ('undefined' == typeof window ? global : window).PopperUtils, ge.placements = me, ge.Defaults = { placement: 'bottom', positionFixed: !1, eventsEnabled: !0, removeOnDestroy: !1, onCreate: function() {}, onUpdate: function() {}, modifiers: { shift: { order: 100, enabled: !0, fn: function(e) { var t = e.placement,
|
||||
o = t.split('-')[0],
|
||||
n = t.split('-')[1]; if (n) { var i = e.offsets,
|
||||
r = i.reference,
|
||||
p = i.popper,
|
||||
s = -1 !== ['bottom', 'top'].indexOf(o),
|
||||
d = s ? 'left' : 'top',
|
||||
a = s ? 'width' : 'height',
|
||||
l = { start: ae({}, d, r[d]), end: ae({}, d, r[d] + r[a] - p[a]) };
|
||||
e.offsets.popper = le({}, p, l[n]) } return e } }, offset: { order: 200, enabled: !0, fn: J, offset: 0 }, preventOverflow: { order: 300, enabled: !0, fn: function(e, t) { var o = t.boundariesElement || p(e.instance.popper);
|
||||
e.instance.reference === o && (o = p(o)); var n = B('transform'),
|
||||
i = e.instance.popper.style,
|
||||
r = i.top,
|
||||
s = i.left,
|
||||
d = i[n];
|
||||
i.top = '', i.left = '', i[n] = ''; var a = v(e.instance.popper, e.instance.reference, t.padding, o, e.positionFixed);
|
||||
i.top = r, i.left = s, i[n] = d, t.boundaries = a; var l = t.priority,
|
||||
f = e.offsets.popper,
|
||||
m = { primary: function(e) { var o = f[e]; return f[e] < a[e] && !t.escapeWithReference && (o = ee(f[e], a[e])), ae({}, e, o) }, secondary: function(e) { var o = 'right' === e ? 'left' : 'top',
|
||||
n = f[o]; return f[e] > a[e] && !t.escapeWithReference && (n = Q(f[o], a[e] - ('right' === e ? f.width : f.height))), ae({}, o, n) } }; return l.forEach(function(e) { var t = -1 === ['left', 'top'].indexOf(e) ? 'secondary' : 'primary';
|
||||
f = le({}, f, m[t](e)) }), e.offsets.popper = f, e }, priority: ['left', 'right', 'top', 'bottom'], padding: 5, boundariesElement: 'scrollParent' }, keepTogether: { order: 400, enabled: !0, fn: function(e) { var t = e.offsets,
|
||||
o = t.popper,
|
||||
n = t.reference,
|
||||
i = e.placement.split('-')[0],
|
||||
r = Z,
|
||||
p = -1 !== ['top', 'bottom'].indexOf(i),
|
||||
s = p ? 'right' : 'bottom',
|
||||
d = p ? 'left' : 'top',
|
||||
a = p ? 'width' : 'height'; return o[s] < r(n[d]) && (e.offsets.popper[d] = r(n[d]) - o[a]), o[d] > r(n[s]) && (e.offsets.popper[d] = r(n[s])), e } }, arrow: { order: 500, enabled: !0, fn: function(e, o) { var n; if (!K(e.instance.modifiers, 'arrow', 'keepTogether')) return e; var i = o.element; if ('string' == typeof i) { if (i = e.instance.popper.querySelector(i), !i) return e; } else if (!e.instance.popper.contains(i)) return console.warn('WARNING: `arrow.element` must be child of its popper element!'), e; var r = e.placement.split('-')[0],
|
||||
p = e.offsets,
|
||||
s = p.popper,
|
||||
d = p.reference,
|
||||
a = -1 !== ['left', 'right'].indexOf(r),
|
||||
l = a ? 'height' : 'width',
|
||||
f = a ? 'Top' : 'Left',
|
||||
m = f.toLowerCase(),
|
||||
h = a ? 'left' : 'top',
|
||||
c = a ? 'bottom' : 'right',
|
||||
u = S(i)[l];
|
||||
d[c] - u < s[m] && (e.offsets.popper[m] -= s[m] - (d[c] - u)), d[m] + u > s[c] && (e.offsets.popper[m] += d[m] + u - s[c]), e.offsets.popper = g(e.offsets.popper); var b = d[m] + d[l] / 2 - u / 2,
|
||||
w = t(e.instance.popper),
|
||||
y = parseFloat(w['margin' + f], 10),
|
||||
E = parseFloat(w['border' + f + 'Width'], 10),
|
||||
v = b - e.offsets.popper[m] - y - E; return v = ee(Q(s[l] - u, v), 0), e.arrowElement = i, e.offsets.arrow = (n = {}, ae(n, m, $(v)), ae(n, h, ''), n), e }, element: '[x-arrow]' }, flip: { order: 600, enabled: !0, fn: function(e, t) { if (W(e.instance.modifiers, 'inner')) return e; if (e.flipped && e.placement === e.originalPlacement) return e; var o = v(e.instance.popper, e.instance.reference, t.padding, t.boundariesElement, e.positionFixed),
|
||||
n = e.placement.split('-')[0],
|
||||
i = T(n),
|
||||
r = e.placement.split('-')[1] || '',
|
||||
p = []; switch (t.behavior) {
|
||||
case ce.FLIP:
|
||||
p = [n, i]; break;
|
||||
case ce.CLOCKWISE:
|
||||
p = G(n); break;
|
||||
case ce.COUNTERCLOCKWISE:
|
||||
p = G(n, !0); break;
|
||||
default:
|
||||
p = t.behavior; } return p.forEach(function(s, d) { if (n !== s || p.length === d + 1) return e;
|
||||
n = e.placement.split('-')[0], i = T(n); var a = e.offsets.popper,
|
||||
l = e.offsets.reference,
|
||||
f = Z,
|
||||
m = 'left' === n && f(a.right) > f(l.left) || 'right' === n && f(a.left) < f(l.right) || 'top' === n && f(a.bottom) > f(l.top) || 'bottom' === n && f(a.top) < f(l.bottom),
|
||||
h = f(a.left) < f(o.left),
|
||||
c = f(a.right) > f(o.right),
|
||||
g = f(a.top) < f(o.top),
|
||||
u = f(a.bottom) > f(o.bottom),
|
||||
b = 'left' === n && h || 'right' === n && c || 'top' === n && g || 'bottom' === n && u,
|
||||
w = -1 !== ['top', 'bottom'].indexOf(n),
|
||||
y = !!t.flipVariations && (w && 'start' === r && h || w && 'end' === r && c || !w && 'start' === r && g || !w && 'end' === r && u),
|
||||
E = !!t.flipVariationsByContent && (w && 'start' === r && c || w && 'end' === r && h || !w && 'start' === r && u || !w && 'end' === r && g),
|
||||
v = y || E;
|
||||
(m || b || v) && (e.flipped = !0, (m || b) && (n = p[d + 1]), v && (r = z(r)), e.placement = n + (r ? '-' + r : ''), e.offsets.popper = le({}, e.offsets.popper, C(e.instance.popper, e.offsets.reference, e.placement)), e = P(e.instance.modifiers, e, 'flip')) }), e }, behavior: 'flip', padding: 5, boundariesElement: 'viewport', flipVariations: !1, flipVariationsByContent: !1 }, inner: { order: 700, enabled: !1, fn: function(e) { var t = e.placement,
|
||||
o = t.split('-')[0],
|
||||
n = e.offsets,
|
||||
i = n.popper,
|
||||
r = n.reference,
|
||||
p = -1 !== ['left', 'right'].indexOf(o),
|
||||
s = -1 === ['top', 'left'].indexOf(o); return i[p ? 'left' : 'top'] = r[o] - (s ? i[p ? 'width' : 'height'] : 0), e.placement = T(t), e.offsets.popper = g(i), e } }, hide: { order: 800, enabled: !0, fn: function(e) { if (!K(e.instance.modifiers, 'hide', 'preventOverflow')) return e; var t = e.offsets.reference,
|
||||
o = D(e.instance.modifiers, function(e) { return 'preventOverflow' === e.name }).boundaries; if (t.bottom < o.top || t.left > o.right || t.top > o.bottom || t.right < o.left) { if (!0 === e.hide) return e;
|
||||
e.hide = !0, e.attributes['x-out-of-boundaries'] = '' } else { if (!1 === e.hide) return e;
|
||||
e.hide = !1, e.attributes['x-out-of-boundaries'] = !1 } return e } }, computeStyle: { order: 850, enabled: !0, fn: function(e, t) { var o = t.x,
|
||||
n = t.y,
|
||||
i = e.offsets.popper,
|
||||
r = D(e.instance.modifiers, function(e) { return 'applyStyle' === e.name }).gpuAcceleration;
|
||||
void 0 !== r && console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!'); var s, d, a = void 0 === r ? t.gpuAcceleration : r,
|
||||
l = p(e.instance.popper),
|
||||
f = u(l),
|
||||
m = { position: i.position },
|
||||
h = q(e, 2 > window.devicePixelRatio || !fe),
|
||||
c = 'bottom' === o ? 'top' : 'bottom',
|
||||
g = 'right' === n ? 'left' : 'right',
|
||||
b = B('transform'); if (d = 'bottom' == c ? 'HTML' === l.nodeName ? -l.clientHeight + h.bottom : -f.height + h.bottom : h.top, s = 'right' == g ? 'HTML' === l.nodeName ? -l.clientWidth + h.right : -f.width + h.right : h.left, a && b) m[b] = 'translate3d(' + s + 'px, ' + d + 'px, 0)', m[c] = 0, m[g] = 0, m.willChange = 'transform';
|
||||
else { var w = 'bottom' == c ? -1 : 1,
|
||||
y = 'right' == g ? -1 : 1;
|
||||
m[c] = d * w, m[g] = s * y, m.willChange = c + ', ' + g } var E = { "x-placement": e.placement }; return e.attributes = le({}, E, e.attributes), e.styles = le({}, m, e.styles), e.arrowStyles = le({}, e.offsets.arrow, e.arrowStyles), e }, gpuAcceleration: !0, x: 'bottom', y: 'right' }, applyStyle: { order: 900, enabled: !0, fn: function(e) { return V(e.instance.popper, e.styles), j(e.instance.popper, e.attributes), e.arrowElement && Object.keys(e.arrowStyles).length && V(e.arrowElement, e.arrowStyles), e }, onLoad: function(e, t, o, n, i) { var r = L(i, t, e, o.positionFixed),
|
||||
p = O(o.placement, r, t, e, o.modifiers.flip.boundariesElement, o.modifiers.flip.padding); return t.setAttribute('x-placement', p), V(t, { position: o.positionFixed ? 'fixed' : 'absolute' }), o }, gpuAcceleration: void 0 } } }, ge });
|
||||
//# sourceMappingURL=popper.min.js.map
|
||||
Vendored
+14
File diff suppressed because one or more lines are too long
Vendored
+9
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user