message
This commit is contained in:
17
assets/js/TweenMax.min.js
vendored
Normal file
17
assets/js/TweenMax.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
151
assets/js/appear.js
Normal file
151
assets/js/appear.js
Normal file
@@ -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);
|
||||
9
assets/js/bootstrap-select.min.js
vendored
Normal file
9
assets/js/bootstrap-select.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
7
assets/js/bootstrap.min.js
vendored
Normal file
7
assets/js/bootstrap.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
8
assets/js/isotope.js
Normal file
8
assets/js/isotope.js
Normal file
File diff suppressed because one or more lines are too long
1
assets/js/jquery.ajaxchimp.min.js
vendored
Normal file
1
assets/js/jquery.ajaxchimp.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
(function($){"use strict";$.ajaxChimp={responses:{"We have sent you a confirmation email":0,"Please enter a value":1,"An email address must contain a single @":2,"The domain portion of the email address is invalid (the portion after the @: )":3,"The username portion of the email address is invalid (the portion before the @: )":4,"This email address looks fake or invalid. Please enter a real email address":5},translations:{en:null},init:function(selector,options){$(selector).ajaxChimp(options)}};$.fn.ajaxChimp=function(options){$(this).each(function(i,elem){var form=$(elem);var email=form.find("input[type=email]");var label=form.find("label[for="+email.attr("id")+"]");var settings=$.extend({url:form.attr("action"),language:"en"},options);var url=settings.url.replace("/post?","/post-json?").concat("&c=?");form.attr("novalidate","true");email.attr("name","EMAIL");form.submit(function(){var msg;function successCallback(resp){if(resp.result==="success"){msg="We have sent you a confirmation email";label.removeClass("error").addClass("valid");email.removeClass("error").addClass("valid")}else{email.removeClass("valid").addClass("error");label.removeClass("valid").addClass("error");var index=-1;try{var parts=resp.msg.split(" - ",2);if(parts[1]===undefined){msg=resp.msg}else{var i=parseInt(parts[0],10);if(i.toString()===parts[0]){index=parts[0];msg=parts[1]}else{index=-1;msg=resp.msg}}}catch(e){index=-1;msg=resp.msg}}if(settings.language!=="en"&&$.ajaxChimp.responses[msg]!==undefined&&$.ajaxChimp.translations&&$.ajaxChimp.translations[settings.language]&&$.ajaxChimp.translations[settings.language][$.ajaxChimp.responses[msg]]){msg=$.ajaxChimp.translations[settings.language][$.ajaxChimp.responses[msg]]}label.html(msg);label.show(2e3);if(settings.callback){settings.callback(resp)}}var data={};var dataArray=form.serializeArray();$.each(dataArray,function(index,item){data[item.name]=item.value});$.ajax({url:url,data:data,success:successCallback,dataType:"jsonp",error:function(resp,text){console.log("mailchimp ajax submit error: "+text)}});var submitMsg="Submitting...";if(settings.language!=="en"&&$.ajaxChimp.translations&&$.ajaxChimp.translations[settings.language]&&$.ajaxChimp.translations[settings.language]["submit"]){submitMsg=$.ajaxChimp.translations[settings.language]["submit"]}label.html(submitMsg).show(2e3);return false})});return this}})(jQuery);
|
||||
5238
assets/js/jquery.fancybox.js
vendored
Normal file
5238
assets/js/jquery.fancybox.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
4
assets/js/jquery.js
vendored
Normal file
4
assets/js/jquery.js
vendored
Normal file
File diff suppressed because one or more lines are too long
423
assets/js/jquery.polyglot.language.switcher.js
Normal file
423
assets/js/jquery.polyglot.language.switcher.js
Normal file
@@ -0,0 +1,423 @@
|
||||
// JavaScript Document
|
||||
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/* "Polyglot" Language Switcher
|
||||
/* ----------------------------------------------------------------------
|
||||
Version: 2.2
|
||||
Author: Ixtendo
|
||||
Author URI: http://www.ixtendo.com
|
||||
License: MIT License
|
||||
License URI: http://www.opensource.org/licenses/mit-license.php
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
/**
|
||||
* jquery.timer.js
|
||||
*
|
||||
* Copyright (c) 2011 Jason Chavannes <jason.chavannes@gmail.com>
|
||||
*
|
||||
* http://jchavannes.com/jquery-timer
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person
|
||||
* obtaining a copy of this software and associated documentation
|
||||
* files (the "Software"), to deal in the Software without
|
||||
* restriction, including without limitation the rights to use, copy,
|
||||
* modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
* of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be
|
||||
* included in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
(function ($) {
|
||||
|
||||
//jquery.timer.js
|
||||
$.timer = function(func, time, autostart) {
|
||||
this.set = function(func, time, autostart) {
|
||||
this.init = true;
|
||||
if(typeof func == 'object') {
|
||||
var paramList = ['autostart', 'time'];
|
||||
for(var arg in paramList) {if(func[paramList[arg]] != undefined) {eval(paramList[arg] + " = func[paramList[arg]]");}};
|
||||
func = func.action;
|
||||
}
|
||||
if(typeof func == 'function') {this.action = func;}
|
||||
if(!isNaN(time)) {this.intervalTime = time;}
|
||||
if(autostart && !this.active) {
|
||||
this.active = true;
|
||||
this.setTimer();
|
||||
}
|
||||
return this;
|
||||
};
|
||||
this.once = function(time) {
|
||||
var timer = this;
|
||||
if(isNaN(time)) {time = 0;}
|
||||
window.setTimeout(function() {timer.action();}, time);
|
||||
return this;
|
||||
};
|
||||
this.play = function(reset) {
|
||||
if(!this.active) {
|
||||
if(reset) {this.setTimer();}
|
||||
else {this.setTimer(this.remaining);}
|
||||
this.active = true;
|
||||
}
|
||||
return this;
|
||||
};
|
||||
this.pause = function() {
|
||||
if(this.active) {
|
||||
this.active = false;
|
||||
this.remaining -= new Date() - this.last;
|
||||
this.clearTimer();
|
||||
}
|
||||
return this;
|
||||
};
|
||||
this.stop = function() {
|
||||
this.active = false;
|
||||
this.remaining = this.intervalTime;
|
||||
this.clearTimer();
|
||||
return this;
|
||||
};
|
||||
this.toggle = function(reset) {
|
||||
if(this.active) {this.pause();}
|
||||
else if(reset) {this.play(true);}
|
||||
else {this.play();}
|
||||
return this;
|
||||
};
|
||||
this.reset = function() {
|
||||
this.active = false;
|
||||
this.play(true);
|
||||
return this;
|
||||
};
|
||||
this.clearTimer = function() {
|
||||
window.clearTimeout(this.timeoutObject);
|
||||
};
|
||||
this.setTimer = function(time) {
|
||||
var timer = this;
|
||||
if(typeof this.action != 'function') {return;}
|
||||
if(isNaN(time)) {time = this.intervalTime;}
|
||||
this.remaining = time;
|
||||
this.last = new Date();
|
||||
this.clearTimer();
|
||||
this.timeoutObject = window.setTimeout(function() {timer.go();}, time);
|
||||
};
|
||||
this.go = function() {
|
||||
if(this.active) {
|
||||
this.action();
|
||||
this.setTimer();
|
||||
}
|
||||
};
|
||||
|
||||
if(this.init) {
|
||||
return new $.timer(func, time, autostart);
|
||||
} else {
|
||||
this.set(func, time, autostart);
|
||||
return this;
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.polyglotLanguageSwitcher = function (op) {
|
||||
|
||||
var ls = $.fn.polyglotLanguageSwitcher;
|
||||
|
||||
var rootElement = $(this);
|
||||
var rootElementId = $(this).attr('id');
|
||||
var aElement;
|
||||
var ulElement = $("<ul class=\"dropdown\">");
|
||||
var length = 0;
|
||||
var isOpen = false;
|
||||
var liElements = [];
|
||||
var settings = $.extend({}, ls.defaults, op);
|
||||
var closePopupTimer;
|
||||
var isStaticWebSite = settings.websiteType == 'static';
|
||||
|
||||
init();
|
||||
installListeners();
|
||||
|
||||
function triggerEvent(evt) {
|
||||
if(settings[evt.name]){
|
||||
settings[evt.name].call($(this), evt);
|
||||
}
|
||||
}
|
||||
|
||||
function open() {
|
||||
if(!isOpen){
|
||||
triggerEvent({name:'beforeOpen', element:rootElement, instance:ls});
|
||||
aElement.addClass("active");
|
||||
doAnimation(true);
|
||||
setTimeout(function () {
|
||||
isOpen = true;
|
||||
triggerEvent({name:'afterOpen', element:rootElement, instance:ls});
|
||||
}, 100);
|
||||
}
|
||||
}
|
||||
|
||||
function close() {
|
||||
if(isOpen){
|
||||
triggerEvent({name:'beforeClose', element:rootElement, instance:ls});
|
||||
doAnimation(false);
|
||||
aElement.removeClass("active");
|
||||
isOpen = false;
|
||||
if (closePopupTimer && closePopupTimer.active) {
|
||||
closePopupTimer.clearTimer();
|
||||
}
|
||||
triggerEvent({name:'afterClose', element:rootElement, instance:ls});
|
||||
}
|
||||
}
|
||||
|
||||
function suspendCloseAction() {
|
||||
if (closePopupTimer && closePopupTimer.active) {
|
||||
closePopupTimer.pause();
|
||||
}
|
||||
}
|
||||
|
||||
function resumeCloseAction() {
|
||||
if (closePopupTimer) {
|
||||
closePopupTimer.play(false);
|
||||
}
|
||||
}
|
||||
|
||||
function doAnimation(open) {
|
||||
if (settings.effect == 'fade') {
|
||||
if (open) {
|
||||
ulElement.fadeIn(settings.animSpeed);
|
||||
} else {
|
||||
ulElement.fadeOut(settings.animSpeed);
|
||||
}
|
||||
} else {
|
||||
if (open) {
|
||||
ulElement.slideDown(settings.animSpeed);
|
||||
} else {
|
||||
ulElement.slideUp(settings.animSpeed);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function doAction(item) {
|
||||
close();
|
||||
var selectedAElement = $(item).children(":first-child");
|
||||
|
||||
var selectedId = $(selectedAElement).attr("id");
|
||||
var selectedText = $(selectedAElement).text();
|
||||
|
||||
$(ulElement).children().each(function () {
|
||||
$(this).detach();
|
||||
});
|
||||
for (var i = 0; i < liElements.length; i++) {
|
||||
if ($(liElements[i]).children(":first-child").attr("id") != selectedId) {
|
||||
ulElement.append(liElements[i]);
|
||||
}
|
||||
}
|
||||
var innerSpanElement = aElement.children(":first-child");
|
||||
aElement.attr("id", selectedId);
|
||||
aElement.text(selectedText);
|
||||
aElement.append(innerSpanElement);
|
||||
}
|
||||
|
||||
function installListeners() {
|
||||
$(document).click(function () {
|
||||
close();
|
||||
});
|
||||
$(document).keyup(function (e) {
|
||||
if (e.which == 27) {
|
||||
close();
|
||||
}
|
||||
});
|
||||
if (settings.openMode == 'hover') {
|
||||
closePopupTimer = $.timer(function () {
|
||||
close();
|
||||
});
|
||||
closePopupTimer.set({ time:settings.hoverTimeout, autostart:true });
|
||||
}
|
||||
}
|
||||
|
||||
function init() {
|
||||
var selectedItem;
|
||||
var options = $("#" + rootElementId + " > form > select > option");
|
||||
if (isStaticWebSite) {
|
||||
var selectedId;
|
||||
var url = window.location.href;
|
||||
options.each(function(){
|
||||
var id = $(this).attr("id");
|
||||
if(url.indexOf('/'+id+'/')>=0){
|
||||
selectedId = id;
|
||||
}
|
||||
});
|
||||
}
|
||||
options.each(function () {
|
||||
var id = $(this).attr("id");
|
||||
var selected;
|
||||
if (isStaticWebSite) {
|
||||
selected = selectedId === id;
|
||||
}else{
|
||||
selected = $(this).attr("selected")
|
||||
}
|
||||
var liElement = toLiElement($(this));
|
||||
if (selected) {
|
||||
selectedItem = liElement;
|
||||
}
|
||||
liElements.push(liElement);
|
||||
if (length > 0) {
|
||||
ulElement.append(liElement);
|
||||
} else {
|
||||
aElement = $("<a id=\"" + $(this).attr("id") + "\" class=\"current\" href=\"#\">" + $(this).text() + " <span class=\"trigger\">»</span></a>");
|
||||
if (settings.openMode == 'hover') {
|
||||
aElement.hover(function () {
|
||||
open();
|
||||
suspendCloseAction();
|
||||
}, function () {
|
||||
resumeCloseAction();
|
||||
});
|
||||
} else {
|
||||
aElement.click(
|
||||
function () {
|
||||
open();
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
length++;
|
||||
});
|
||||
$("#" + rootElementId + " form:first-child").remove();
|
||||
rootElement.append(aElement);
|
||||
rootElement.append(ulElement);
|
||||
if (selectedItem) {
|
||||
doAction(selectedItem);
|
||||
}
|
||||
}
|
||||
|
||||
function toLiElement(option) {
|
||||
var id = $(option).attr("id");
|
||||
var value = $(option).attr("value");
|
||||
var text = $(option).text();
|
||||
var liElement;
|
||||
if (isStaticWebSite) {
|
||||
var url = window.location.href;
|
||||
var page = url.substring(url.lastIndexOf("/")+1);
|
||||
var urlPage = 'http://' + document.domain + '/' + settings.pagePrefix + id + '/' + page;
|
||||
liElement = $("<li><a id=\"" + id + "\" href=\"" + urlPage + "\">" + text + "</a></li>");
|
||||
} else {
|
||||
var href = document.URL.replace('#', '');
|
||||
var params = parseQueryString();
|
||||
params[settings.paramName] = value;
|
||||
if (href.indexOf('?') > 0) {
|
||||
href = href.substring(0, href.indexOf('?'));
|
||||
}
|
||||
href += toQueryString(params);
|
||||
liElement = $("<li><a id=\"" + id + "\" href=\"" + href + "\">" + text + "</a></li>");
|
||||
}
|
||||
liElement.bind('click', function () {
|
||||
triggerEvent({name:'onChange', selectedItem: $(this).children(":first").attr('id'), element:rootElement, instance:ls});
|
||||
doAction($(this));
|
||||
});
|
||||
if (settings.openMode == 'hover') {
|
||||
liElement.hover(function () {
|
||||
suspendCloseAction();
|
||||
}, function () {
|
||||
resumeCloseAction();
|
||||
});
|
||||
}
|
||||
return liElement;
|
||||
}
|
||||
|
||||
function parseQueryString() {
|
||||
var params = {};
|
||||
var query = window.location.search.substr(1).split('&');
|
||||
if (query.length > 0) {
|
||||
for (var i = 0; i < query.length; ++i) {
|
||||
var p = query[i].split('=');
|
||||
if (p.length != 2) {
|
||||
continue;
|
||||
}
|
||||
params[p[0]] = decodeURIComponent(p[1].replace(/\+/g, " "));
|
||||
}
|
||||
}
|
||||
return params;
|
||||
}
|
||||
|
||||
function toQueryString(params) {
|
||||
if (settings.testMode) {
|
||||
return '#';
|
||||
} else {
|
||||
var queryString = '?';
|
||||
var i = 0;
|
||||
for (var param in params) {
|
||||
var x = '';
|
||||
if (i > 0) {
|
||||
x = '&';
|
||||
}
|
||||
queryString += x + param + "=" + params[param];
|
||||
i++;
|
||||
}
|
||||
return queryString;
|
||||
}
|
||||
}
|
||||
|
||||
ls.open = function () {
|
||||
open();
|
||||
};
|
||||
ls.close = function () {
|
||||
close();
|
||||
};
|
||||
triggerEvent({name:'afterLoad', element:rootElement, instance:ls});
|
||||
return ls;
|
||||
};
|
||||
|
||||
var ls = $.fn.polyglotLanguageSwitcher;
|
||||
ls.defaults = {
|
||||
openMode:'click',
|
||||
hoverTimeout:1500,
|
||||
animSpeed:200,
|
||||
effect:'slide',
|
||||
paramName:'lang',
|
||||
pagePrefix:'',
|
||||
websiteType:'dynamic',
|
||||
testMode:false,
|
||||
onChange:NaN,
|
||||
afterLoad:NaN,
|
||||
beforeOpen:NaN,
|
||||
afterOpen:NaN,
|
||||
beforeClose:NaN,
|
||||
afterClose:NaN
|
||||
};
|
||||
|
||||
|
||||
})(jQuery);
|
||||
|
||||
|
||||
|
||||
jQuery(document).ready(function(){
|
||||
// Language switcher
|
||||
if ($("#polyglot-language-options").length) {
|
||||
$('#polyglotLanguageSwitcher').polyglotLanguageSwitcher({
|
||||
effect: 'slide',
|
||||
animSpeed: 150,
|
||||
testMode: true,
|
||||
onChange: function(evt) {
|
||||
alert("The selected language is: " + evt.selectedItem);
|
||||
}
|
||||
|
||||
});
|
||||
};
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
491
assets/js/lazyload.js
Normal file
491
assets/js/lazyload.js
Normal file
@@ -0,0 +1,491 @@
|
||||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
||||
|
||||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||
|
||||
(function (global, factory) {
|
||||
(typeof exports === "undefined" ? "undefined" : _typeof(exports)) === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : global.LazyLoad = factory();
|
||||
})(this, function () {
|
||||
'use strict';
|
||||
|
||||
var runningOnBrowser = typeof window !== "undefined";
|
||||
var isBot = runningOnBrowser && !("onscroll" in window) || typeof navigator !== "undefined" && /(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent);
|
||||
var supportsIntersectionObserver = runningOnBrowser && "IntersectionObserver" in window;
|
||||
var supportsClassList = runningOnBrowser && "classList" in document.createElement("p");
|
||||
var defaultSettings = {
|
||||
elements_selector: "img",
|
||||
container: isBot || runningOnBrowser ? document : null,
|
||||
threshold: 300,
|
||||
thresholds: null,
|
||||
data_src: "src",
|
||||
data_srcset: "srcset",
|
||||
data_sizes: "sizes",
|
||||
data_bg: "bg",
|
||||
class_loading: "loading",
|
||||
class_loaded: "loaded",
|
||||
class_error: "error",
|
||||
load_delay: 0,
|
||||
auto_unobserve: true,
|
||||
callback_enter: null,
|
||||
callback_exit: null,
|
||||
callback_reveal: null,
|
||||
callback_loaded: null,
|
||||
callback_error: null,
|
||||
callback_finish: null,
|
||||
use_native: false
|
||||
};
|
||||
|
||||
var getInstanceSettings = function getInstanceSettings(customSettings) {
|
||||
return _extends({}, defaultSettings, customSettings);
|
||||
};
|
||||
/* Creates instance and notifies it through the window element */
|
||||
|
||||
|
||||
var createInstance = function createInstance(classObj, options) {
|
||||
var event;
|
||||
var eventString = "LazyLoad::Initialized";
|
||||
var instance = new classObj(options);
|
||||
|
||||
try {
|
||||
// Works in modern browsers
|
||||
event = new CustomEvent(eventString, {
|
||||
detail: {
|
||||
instance: instance
|
||||
}
|
||||
});
|
||||
} catch (err) {
|
||||
// Works in Internet Explorer (all versions)
|
||||
event = document.createEvent("CustomEvent");
|
||||
event.initCustomEvent(eventString, false, false, {
|
||||
instance: instance
|
||||
});
|
||||
}
|
||||
|
||||
window.dispatchEvent(event);
|
||||
};
|
||||
/* Auto initialization of one or more instances of lazyload, depending on the
|
||||
options passed in (plain object or an array) */
|
||||
|
||||
|
||||
function autoInitialize(classObj, options) {
|
||||
if (!options) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!options.length) {
|
||||
// Plain object
|
||||
createInstance(classObj, options);
|
||||
} else {
|
||||
// Array of objects
|
||||
for (var i = 0, optionsItem; optionsItem = options[i]; i += 1) {
|
||||
createInstance(classObj, optionsItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var dataPrefix = "data-";
|
||||
var processedDataName = "was-processed";
|
||||
var timeoutDataName = "ll-timeout";
|
||||
var trueString = "true";
|
||||
|
||||
var getData = function getData(element, attribute) {
|
||||
return element.getAttribute(dataPrefix + attribute);
|
||||
};
|
||||
|
||||
var setData = function setData(element, attribute, value) {
|
||||
var attrName = dataPrefix + attribute;
|
||||
|
||||
if (value === null) {
|
||||
element.removeAttribute(attrName);
|
||||
return;
|
||||
}
|
||||
|
||||
element.setAttribute(attrName, value);
|
||||
};
|
||||
|
||||
var setWasProcessedData = function setWasProcessedData(element) {
|
||||
return setData(element, processedDataName, trueString);
|
||||
};
|
||||
|
||||
var getWasProcessedData = function getWasProcessedData(element) {
|
||||
return getData(element, processedDataName) === trueString;
|
||||
};
|
||||
|
||||
var setTimeoutData = function setTimeoutData(element, value) {
|
||||
return setData(element, timeoutDataName, value);
|
||||
};
|
||||
|
||||
var getTimeoutData = function getTimeoutData(element) {
|
||||
return getData(element, timeoutDataName);
|
||||
};
|
||||
|
||||
var purgeProcessedElements = function purgeProcessedElements(elements) {
|
||||
return elements.filter(function (element) {
|
||||
return !getWasProcessedData(element);
|
||||
});
|
||||
};
|
||||
|
||||
var purgeOneElement = function purgeOneElement(elements, elementToPurge) {
|
||||
return elements.filter(function (element) {
|
||||
return element !== elementToPurge;
|
||||
});
|
||||
};
|
||||
|
||||
var callbackIfSet = function callbackIfSet(callback, argument) {
|
||||
if (callback) {
|
||||
callback(argument);
|
||||
}
|
||||
};
|
||||
|
||||
var updateLoadingCount = function updateLoadingCount(instance, plusMinus) {
|
||||
instance._loadingCount += plusMinus;
|
||||
|
||||
if (instance._elements.length === 0 && instance._loadingCount === 0) {
|
||||
callbackIfSet(instance._settings.callback_finish);
|
||||
}
|
||||
};
|
||||
|
||||
var getSourceTags = function getSourceTags(parentTag) {
|
||||
var sourceTags = [];
|
||||
|
||||
for (var i = 0, childTag; childTag = parentTag.children[i]; i += 1) {
|
||||
if (childTag.tagName === "SOURCE") {
|
||||
sourceTags.push(childTag);
|
||||
}
|
||||
}
|
||||
|
||||
return sourceTags;
|
||||
};
|
||||
|
||||
var setAttributeIfValue = function setAttributeIfValue(element, attrName, value) {
|
||||
if (!value) {
|
||||
return;
|
||||
}
|
||||
|
||||
element.setAttribute(attrName, value);
|
||||
};
|
||||
|
||||
var setImageAttributes = function setImageAttributes(element, settings) {
|
||||
setAttributeIfValue(element, "sizes", getData(element, settings.data_sizes));
|
||||
setAttributeIfValue(element, "srcset", getData(element, settings.data_srcset));
|
||||
setAttributeIfValue(element, "src", getData(element, settings.data_src));
|
||||
};
|
||||
|
||||
var setSourcesImg = function setSourcesImg(element, settings) {
|
||||
var parent = element.parentNode;
|
||||
|
||||
if (parent && parent.tagName === "PICTURE") {
|
||||
var sourceTags = getSourceTags(parent);
|
||||
sourceTags.forEach(function (sourceTag) {
|
||||
setImageAttributes(sourceTag, settings);
|
||||
});
|
||||
}
|
||||
|
||||
setImageAttributes(element, settings);
|
||||
};
|
||||
|
||||
var setSourcesIframe = function setSourcesIframe(element, settings) {
|
||||
setAttributeIfValue(element, "src", getData(element, settings.data_src));
|
||||
};
|
||||
|
||||
var setSourcesVideo = function setSourcesVideo(element, settings) {
|
||||
var sourceTags = getSourceTags(element);
|
||||
sourceTags.forEach(function (sourceTag) {
|
||||
setAttributeIfValue(sourceTag, "src", getData(sourceTag, settings.data_src));
|
||||
});
|
||||
setAttributeIfValue(element, "src", getData(element, settings.data_src));
|
||||
element.load();
|
||||
};
|
||||
|
||||
var setSourcesBgImage = function setSourcesBgImage(element, settings) {
|
||||
var srcDataValue = getData(element, settings.data_src);
|
||||
var bgDataValue = getData(element, settings.data_bg);
|
||||
|
||||
if (srcDataValue) {
|
||||
element.style.backgroundImage = "url(\"".concat(srcDataValue, "\")");
|
||||
}
|
||||
|
||||
if (bgDataValue) {
|
||||
element.style.backgroundImage = bgDataValue;
|
||||
}
|
||||
};
|
||||
|
||||
var setSourcesFunctions = {
|
||||
IMG: setSourcesImg,
|
||||
IFRAME: setSourcesIframe,
|
||||
VIDEO: setSourcesVideo
|
||||
};
|
||||
|
||||
var setSources = function setSources(element, instance) {
|
||||
var settings = instance._settings;
|
||||
var tagName = element.tagName;
|
||||
var setSourcesFunction = setSourcesFunctions[tagName];
|
||||
|
||||
if (setSourcesFunction) {
|
||||
setSourcesFunction(element, settings);
|
||||
updateLoadingCount(instance, 1);
|
||||
instance._elements = purgeOneElement(instance._elements, element);
|
||||
return;
|
||||
}
|
||||
|
||||
setSourcesBgImage(element, settings);
|
||||
};
|
||||
|
||||
var addClass = function addClass(element, className) {
|
||||
if (supportsClassList) {
|
||||
element.classList.add(className);
|
||||
return;
|
||||
}
|
||||
|
||||
element.className += (element.className ? " " : "") + className;
|
||||
};
|
||||
|
||||
var removeClass = function removeClass(element, className) {
|
||||
if (supportsClassList) {
|
||||
element.classList.remove(className);
|
||||
return;
|
||||
}
|
||||
|
||||
element.className = element.className.replace(new RegExp("(^|\\s+)" + className + "(\\s+|$)"), " ").replace(/^\s+/, "").replace(/\s+$/, "");
|
||||
};
|
||||
|
||||
var genericLoadEventName = "load";
|
||||
var mediaLoadEventName = "loadeddata";
|
||||
var errorEventName = "error";
|
||||
|
||||
var addEventListener = function addEventListener(element, eventName, handler) {
|
||||
element.addEventListener(eventName, handler);
|
||||
};
|
||||
|
||||
var removeEventListener = function removeEventListener(element, eventName, handler) {
|
||||
element.removeEventListener(eventName, handler);
|
||||
};
|
||||
|
||||
var addEventListeners = function addEventListeners(element, loadHandler, errorHandler) {
|
||||
addEventListener(element, genericLoadEventName, loadHandler);
|
||||
addEventListener(element, mediaLoadEventName, loadHandler);
|
||||
addEventListener(element, errorEventName, errorHandler);
|
||||
};
|
||||
|
||||
var removeEventListeners = function removeEventListeners(element, loadHandler, errorHandler) {
|
||||
removeEventListener(element, genericLoadEventName, loadHandler);
|
||||
removeEventListener(element, mediaLoadEventName, loadHandler);
|
||||
removeEventListener(element, errorEventName, errorHandler);
|
||||
};
|
||||
|
||||
var eventHandler = function eventHandler(event, success, instance) {
|
||||
var settings = instance._settings;
|
||||
var className = success ? settings.class_loaded : settings.class_error;
|
||||
var callback = success ? settings.callback_loaded : settings.callback_error;
|
||||
var element = event.target;
|
||||
removeClass(element, settings.class_loading);
|
||||
addClass(element, className);
|
||||
callbackIfSet(callback, element);
|
||||
updateLoadingCount(instance, -1);
|
||||
};
|
||||
|
||||
var addOneShotEventListeners = function addOneShotEventListeners(element, instance) {
|
||||
var loadHandler = function loadHandler(event) {
|
||||
eventHandler(event, true, instance);
|
||||
removeEventListeners(element, loadHandler, errorHandler);
|
||||
};
|
||||
|
||||
var errorHandler = function errorHandler(event) {
|
||||
eventHandler(event, false, instance);
|
||||
removeEventListeners(element, loadHandler, errorHandler);
|
||||
};
|
||||
|
||||
addEventListeners(element, loadHandler, errorHandler);
|
||||
};
|
||||
|
||||
var managedTags = ["IMG", "IFRAME", "VIDEO"];
|
||||
|
||||
var onEnter = function onEnter(element, instance) {
|
||||
var settings = instance._settings;
|
||||
callbackIfSet(settings.callback_enter, element);
|
||||
|
||||
if (!settings.load_delay) {
|
||||
revealAndUnobserve(element, instance);
|
||||
return;
|
||||
}
|
||||
|
||||
delayLoad(element, instance);
|
||||
};
|
||||
|
||||
var revealAndUnobserve = function revealAndUnobserve(element, instance) {
|
||||
var observer = instance._observer;
|
||||
revealElement(element, instance);
|
||||
|
||||
if (observer && instance._settings.auto_unobserve) {
|
||||
observer.unobserve(element);
|
||||
}
|
||||
};
|
||||
|
||||
var onExit = function onExit(element, instance) {
|
||||
var settings = instance._settings;
|
||||
callbackIfSet(settings.callback_exit, element);
|
||||
|
||||
if (!settings.load_delay) {
|
||||
return;
|
||||
}
|
||||
|
||||
cancelDelayLoad(element);
|
||||
};
|
||||
|
||||
var cancelDelayLoad = function cancelDelayLoad(element) {
|
||||
var timeoutId = getTimeoutData(element);
|
||||
|
||||
if (!timeoutId) {
|
||||
return; // do nothing if timeout doesn't exist
|
||||
}
|
||||
|
||||
clearTimeout(timeoutId);
|
||||
setTimeoutData(element, null);
|
||||
};
|
||||
|
||||
var delayLoad = function delayLoad(element, instance) {
|
||||
var loadDelay = instance._settings.load_delay;
|
||||
var timeoutId = getTimeoutData(element);
|
||||
|
||||
if (timeoutId) {
|
||||
return; // do nothing if timeout already set
|
||||
}
|
||||
|
||||
timeoutId = setTimeout(function () {
|
||||
revealAndUnobserve(element, instance);
|
||||
cancelDelayLoad(element);
|
||||
}, loadDelay);
|
||||
setTimeoutData(element, timeoutId);
|
||||
};
|
||||
|
||||
var revealElement = function revealElement(element, instance, force) {
|
||||
var settings = instance._settings;
|
||||
|
||||
if (!force && getWasProcessedData(element)) {
|
||||
return; // element has already been processed and force wasn't true
|
||||
}
|
||||
|
||||
if (managedTags.indexOf(element.tagName) > -1) {
|
||||
addOneShotEventListeners(element, instance);
|
||||
addClass(element, settings.class_loading);
|
||||
}
|
||||
|
||||
setSources(element, instance);
|
||||
setWasProcessedData(element);
|
||||
callbackIfSet(settings.callback_reveal, element);
|
||||
callbackIfSet(settings.callback_set, element);
|
||||
};
|
||||
|
||||
var isIntersecting = function isIntersecting(entry) {
|
||||
return entry.isIntersecting || entry.intersectionRatio > 0;
|
||||
};
|
||||
|
||||
var getObserverSettings = function getObserverSettings(settings) {
|
||||
return {
|
||||
root: settings.container === document ? null : settings.container,
|
||||
rootMargin: settings.thresholds || settings.threshold + "px"
|
||||
};
|
||||
};
|
||||
|
||||
var setObserver = function setObserver(instance) {
|
||||
if (!supportsIntersectionObserver) {
|
||||
return false;
|
||||
}
|
||||
|
||||
instance._observer = new IntersectionObserver(function (entries) {
|
||||
entries.forEach(function (entry) {
|
||||
return isIntersecting(entry) ? onEnter(entry.target, instance) : onExit(entry.target, instance);
|
||||
});
|
||||
}, getObserverSettings(instance._settings));
|
||||
return true;
|
||||
};
|
||||
|
||||
var nativeLazyTags = ["IMG", "IFRAME"];
|
||||
|
||||
var shouldUseNative = function shouldUseNative(settings) {
|
||||
return settings.use_native && "loading" in HTMLImageElement.prototype;
|
||||
};
|
||||
|
||||
var loadAllNative = function loadAllNative(instance) {
|
||||
instance._elements.forEach(function (element) {
|
||||
if (nativeLazyTags.indexOf(element.tagName) === -1) {
|
||||
return;
|
||||
}
|
||||
|
||||
element.setAttribute("loading", "lazy");
|
||||
revealElement(element, instance);
|
||||
});
|
||||
};
|
||||
|
||||
var nodeSetToArray = function nodeSetToArray(nodeSet) {
|
||||
return Array.prototype.slice.call(nodeSet);
|
||||
};
|
||||
|
||||
var queryElements = function queryElements(settings) {
|
||||
return settings.container.querySelectorAll(settings.elements_selector);
|
||||
};
|
||||
|
||||
var getElements = function getElements(elements, settings) {
|
||||
return purgeProcessedElements(nodeSetToArray(elements || queryElements(settings)));
|
||||
};
|
||||
|
||||
var LazyLoad = function LazyLoad(customSettings, elements) {
|
||||
this._settings = getInstanceSettings(customSettings);
|
||||
this._loadingCount = 0;
|
||||
setObserver(this);
|
||||
this.update(elements);
|
||||
};
|
||||
|
||||
LazyLoad.prototype = {
|
||||
update: function update(elements) {
|
||||
var _this = this;
|
||||
|
||||
var settings = this._settings;
|
||||
this._elements = getElements(elements, settings);
|
||||
|
||||
if (isBot || !this._observer) {
|
||||
this.loadAll();
|
||||
return;
|
||||
}
|
||||
|
||||
if (shouldUseNative(settings)) {
|
||||
loadAllNative(this);
|
||||
this._elements = getElements(elements, settings);
|
||||
}
|
||||
|
||||
this._elements.forEach(function (element) {
|
||||
_this._observer.observe(element);
|
||||
});
|
||||
},
|
||||
destroy: function destroy() {
|
||||
var _this2 = this;
|
||||
|
||||
if (this._observer) {
|
||||
this._elements.forEach(function (element) {
|
||||
_this2._observer.unobserve(element);
|
||||
});
|
||||
|
||||
this._observer = null;
|
||||
}
|
||||
|
||||
this._elements = null;
|
||||
this._settings = null;
|
||||
},
|
||||
load: function load(element, force) {
|
||||
revealElement(element, this, force);
|
||||
},
|
||||
loadAll: function loadAll() {
|
||||
var _this3 = this;
|
||||
|
||||
this._elements.forEach(function (element) {
|
||||
revealAndUnobserve(element, _this3);
|
||||
});
|
||||
}
|
||||
};
|
||||
/* Automatic instances creation if required (useful for async script loading) */
|
||||
|
||||
if (runningOnBrowser) {
|
||||
autoInitialize(LazyLoad, window.lazyLoadOptions);
|
||||
}
|
||||
|
||||
return LazyLoad;
|
||||
});
|
||||
3448
assets/js/owl.js
Normal file
3448
assets/js/owl.js
Normal file
File diff suppressed because it is too large
Load Diff
58
assets/js/pagination.js
Normal file
58
assets/js/pagination.js
Normal file
@@ -0,0 +1,58 @@
|
||||
|
||||
const itemsPerPage = 3;
|
||||
const items = document.querySelectorAll(".gallery-item");
|
||||
const pagination = document.getElementById("pagination");
|
||||
const totalPages = Math.ceil(items.length / itemsPerPage);
|
||||
let currentPage = 1;
|
||||
|
||||
function showPage(page) {
|
||||
if (page < 1 || page > totalPages) return;
|
||||
currentPage = page;
|
||||
|
||||
items.forEach((item, index) => {
|
||||
item.style.display =
|
||||
index >= (page - 1) * itemsPerPage &&
|
||||
index < page * itemsPerPage
|
||||
? ""
|
||||
: "none";
|
||||
});
|
||||
|
||||
renderPagination();
|
||||
}
|
||||
|
||||
function renderPagination() {
|
||||
pagination.innerHTML = "";
|
||||
|
||||
function createItem(label, page, active = false, disabled = false) {
|
||||
const li = document.createElement("li");
|
||||
if (active) li.classList.add("active");
|
||||
if (disabled) li.classList.add("disabled");
|
||||
|
||||
const a = document.createElement("a");
|
||||
a.href = "#";
|
||||
a.textContent = label;
|
||||
|
||||
a.addEventListener("click", function (e) {
|
||||
e.preventDefault();
|
||||
if (!disabled) showPage(page);
|
||||
});
|
||||
|
||||
li.appendChild(a);
|
||||
pagination.appendChild(li);
|
||||
}
|
||||
|
||||
// Prev
|
||||
createItem("Prev", currentPage - 1, false, currentPage === 1);
|
||||
|
||||
// Page numbers
|
||||
for (let i = 1; i <= totalPages; i++) {
|
||||
createItem(i, i, i === currentPage);
|
||||
}
|
||||
|
||||
// Next
|
||||
createItem("Next", currentPage + 1, false, currentPage === totalPages);
|
||||
}
|
||||
|
||||
// Init
|
||||
showPage(1);
|
||||
|
||||
185
assets/js/parallax-scroll.js
Normal file
185
assets/js/parallax-scroll.js
Normal file
@@ -0,0 +1,185 @@
|
||||
jQuery(function() {
|
||||
ParallaxScroll.init();
|
||||
});
|
||||
|
||||
var ParallaxScroll = {
|
||||
/* PUBLIC VARIABLES */
|
||||
showLogs: false,
|
||||
round: 1000,
|
||||
|
||||
/* PUBLIC FUNCTIONS */
|
||||
init: function() {
|
||||
this._log("init");
|
||||
if (this._inited) {
|
||||
this._log("Already Inited");
|
||||
this._inited = true;
|
||||
return;
|
||||
}
|
||||
this._requestAnimationFrame = (function(){
|
||||
return window.requestAnimationFrame ||
|
||||
window.webkitRequestAnimationFrame ||
|
||||
window.mozRequestAnimationFrame ||
|
||||
window.oRequestAnimationFrame ||
|
||||
window.msRequestAnimationFrame ||
|
||||
function(/* function */ callback, /* DOMElement */ element){
|
||||
window.setTimeout(callback, 1000 / 60);
|
||||
};
|
||||
})();
|
||||
this._onScroll(true);
|
||||
},
|
||||
|
||||
/* PRIVATE VARIABLES */
|
||||
_inited: false,
|
||||
_properties: ['x', 'y', 'z', 'rotateX', 'rotateY', 'rotateZ', 'scaleX', 'scaleY', 'scaleZ', 'scale'],
|
||||
_requestAnimationFrame:null,
|
||||
|
||||
/* PRIVATE FUNCTIONS */
|
||||
_log: function(message) {
|
||||
if (this.showLogs) console.log("Parallax Scroll / " + message);
|
||||
},
|
||||
_onScroll: function(noSmooth) {
|
||||
var scroll = jQuery(document).scrollTop();
|
||||
var windowHeight = jQuery(window).height();
|
||||
this._log("onScroll " + scroll);
|
||||
jQuery("[data-parallax]").each(jQuery.proxy(function(index, el) {
|
||||
var jQueryel = jQuery(el);
|
||||
var properties = [];
|
||||
var applyProperties = false;
|
||||
var style = jQueryel.data("style");
|
||||
if (style == undefined) {
|
||||
style = jQueryel.attr("style") || "";
|
||||
jQueryel.data("style", style);
|
||||
}
|
||||
var datas = [jQueryel.data("parallax")];
|
||||
var iData;
|
||||
for(iData = 2; ; iData++) {
|
||||
if(jQueryel.data("parallax"+iData)) {
|
||||
datas.push(jQueryel.data("parallax-"+iData));
|
||||
}
|
||||
else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
var datasLength = datas.length;
|
||||
for(iData = 0; iData < datasLength; iData ++) {
|
||||
var data = datas[iData];
|
||||
var scrollFrom = data["from-scroll"];
|
||||
if (scrollFrom == undefined) scrollFrom = Math.max(0, jQuery(el).offset().top - windowHeight);
|
||||
scrollFrom = scrollFrom | 0;
|
||||
var scrollDistance = data["distance"];
|
||||
var scrollTo = data["to-scroll"];
|
||||
if (scrollDistance == undefined && scrollTo == undefined) scrollDistance = windowHeight;
|
||||
scrollDistance = Math.max(scrollDistance | 0, 1);
|
||||
var easing = data["easing"];
|
||||
var easingReturn = data["easing-return"];
|
||||
if (easing == undefined || !jQuery.easing|| !jQuery.easing[easing]) easing = null;
|
||||
if (easingReturn == undefined || !jQuery.easing|| !jQuery.easing[easingReturn]) easingReturn = easing;
|
||||
if (easing) {
|
||||
var totalTime = data["duration"];
|
||||
if (totalTime == undefined) totalTime = scrollDistance;
|
||||
totalTime = Math.max(totalTime | 0, 1);
|
||||
var totalTimeReturn = data["duration-return"];
|
||||
if (totalTimeReturn == undefined) totalTimeReturn = totalTime;
|
||||
scrollDistance = 1;
|
||||
var currentTime = jQueryel.data("current-time");
|
||||
if(currentTime == undefined) currentTime = 0;
|
||||
}
|
||||
if (scrollTo == undefined) scrollTo = scrollFrom + scrollDistance;
|
||||
scrollTo = scrollTo | 0;
|
||||
var smoothness = data["smoothness"];
|
||||
if (smoothness == undefined) smoothness = 30;
|
||||
smoothness = smoothness | 0;
|
||||
if (noSmooth || smoothness == 0) smoothness = 1;
|
||||
smoothness = smoothness | 0;
|
||||
var scrollCurrent = scroll;
|
||||
scrollCurrent = Math.max(scrollCurrent, scrollFrom);
|
||||
scrollCurrent = Math.min(scrollCurrent, scrollTo);
|
||||
if(easing) {
|
||||
if(jQueryel.data("sens") == undefined) jQueryel.data("sens", "back");
|
||||
if(scrollCurrent>scrollFrom) {
|
||||
if(jQueryel.data("sens") == "back") {
|
||||
currentTime = 1;
|
||||
jQueryel.data("sens", "go");
|
||||
}
|
||||
else {
|
||||
currentTime++;
|
||||
}
|
||||
}
|
||||
if(scrollCurrent<scrollTo) {
|
||||
if(jQueryel.data("sens") == "go") {
|
||||
currentTime = 1;
|
||||
jQueryel.data("sens", "back");
|
||||
}
|
||||
else {
|
||||
currentTime++;
|
||||
}
|
||||
}
|
||||
if(noSmooth) currentTime = totalTime;
|
||||
jQueryel.data("current-time", currentTime);
|
||||
}
|
||||
this._properties.map(jQuery.proxy(function(prop) {
|
||||
var defaultProp = 0;
|
||||
var to = data[prop];
|
||||
if (to == undefined) return;
|
||||
if(prop=="scale" || prop=="scaleX" || prop=="scaleY" || prop=="scaleZ" ) {
|
||||
defaultProp = 1;
|
||||
}
|
||||
else {
|
||||
to = to | 0;
|
||||
}
|
||||
var prev = jQueryel.data("_" + prop);
|
||||
if (prev == undefined) prev = defaultProp;
|
||||
var next = ((to-defaultProp) * ((scrollCurrent - scrollFrom) / (scrollTo - scrollFrom))) + defaultProp;
|
||||
var val = prev + (next - prev) / smoothness;
|
||||
if(easing && currentTime>0 && currentTime<=totalTime) {
|
||||
var from = defaultProp;
|
||||
if(jQueryel.data("sens") == "back") {
|
||||
from = to;
|
||||
to = -to;
|
||||
easing = easingReturn;
|
||||
totalTime = totalTimeReturn;
|
||||
}
|
||||
val = jQuery.easing[easing](null, currentTime, from, to, totalTime);
|
||||
}
|
||||
val = Math.ceil(val * this.round) / this.round;
|
||||
if(val==prev&&next==to) val = to;
|
||||
if(!properties[prop]) properties[prop] = 0;
|
||||
properties[prop] += val;
|
||||
if (prev != properties[prop]) {
|
||||
jQueryel.data("_" + prop, properties[prop]);
|
||||
applyProperties = true;
|
||||
}
|
||||
}, this));
|
||||
}
|
||||
if (applyProperties) {
|
||||
if (properties["z"] != undefined) {
|
||||
var perspective = data["perspective"];
|
||||
if (perspective == undefined) perspective = 800;
|
||||
var jQueryparent = jQueryel.parent();
|
||||
if(!jQueryparent.data("style")) jQueryparent.data("style", jQueryparent.attr("style") || "");
|
||||
jQueryparent.attr("style", "perspective:" + perspective + "px; -webkit-perspective:" + perspective + "px; "+ jQueryparent.data("style"));
|
||||
}
|
||||
if(properties["scaleX"] == undefined) properties["scaleX"] = 1;
|
||||
if(properties["scaleY"] == undefined) properties["scaleY"] = 1;
|
||||
if(properties["scaleZ"] == undefined) properties["scaleZ"] = 1;
|
||||
if (properties["scale"] != undefined) {
|
||||
properties["scaleX"] *= properties["scale"];
|
||||
properties["scaleY"] *= properties["scale"];
|
||||
properties["scaleZ"] *= properties["scale"];
|
||||
}
|
||||
var translate3d = "translate3d(" + (properties["x"] ? properties["x"] : 0) + "px, " + (properties["y"] ? properties["y"] : 0) + "px, " + (properties["z"] ? properties["z"] : 0) + "px)";
|
||||
var rotate3d = "rotateX(" + (properties["rotateX"] ? properties["rotateX"] : 0) + "deg) rotateY(" + (properties["rotateY"] ? properties["rotateY"] : 0) + "deg) rotateZ(" + (properties["rotateZ"] ? properties["rotateZ"] : 0) + "deg)";
|
||||
var scale3d = "scaleX(" + properties["scaleX"] + ") scaleY(" + properties["scaleY"] + ") scaleZ(" + properties["scaleZ"] + ")";
|
||||
var cssTransform = translate3d + " " + rotate3d + " " + scale3d + ";";
|
||||
this._log(cssTransform);
|
||||
jQueryel.attr("style", "transform:" + cssTransform + " -webkit-transform:" + cssTransform + " " + style);
|
||||
}
|
||||
}, this));
|
||||
if(window.requestAnimationFrame) {
|
||||
window.requestAnimationFrame(jQuery.proxy(this._onScroll, this, false));
|
||||
}
|
||||
else {
|
||||
this._requestAnimationFrame(jQuery.proxy(this._onScroll, this, false));
|
||||
}
|
||||
}
|
||||
};
|
||||
5
assets/js/popper.min.js
vendored
Normal file
5
assets/js/popper.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
692
assets/js/script.js
Normal file
692
assets/js/script.js
Normal file
@@ -0,0 +1,692 @@
|
||||
(function($) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
//Hide Loading Box (Preloader)
|
||||
function handlePreloader() {
|
||||
if($('.loader-wrap').length){
|
||||
$('.loader-wrap').delay(1000).fadeOut(500);
|
||||
}
|
||||
TweenMax.to($(".loader-wrap .overlay"), 1.2, {
|
||||
force3D: true,
|
||||
left: "100%",
|
||||
ease: Expo.easeInOut,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
//Event Countdown Timer
|
||||
if($('.time-countdown').length){
|
||||
$('.time-countdown').each(function() {
|
||||
var $this = $(this), finalDate = $(this).data('countdown');
|
||||
$this.countdown(finalDate, function(event) {
|
||||
var $this = $(this).html(event.strftime('' + '<div class="counter-column"><span class="count">%D</span>Days</div> ' + '<div class="counter-column"><span class="count">%H</span>Hours</div> ' + '<div class="counter-column"><span class="count">%M</span>Minutes</div> ' + '<div class="counter-column"><span class="count">%S</span>Seconds</div>'));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
if ($(".preloader-close").length) {
|
||||
$(".preloader-close").on("click", function(){
|
||||
$('.loader-wrap').delay(200).fadeOut(500);
|
||||
})
|
||||
}
|
||||
|
||||
function dynamicCurrentMenuClass(selector) {
|
||||
let FileName = window.location.href.split('/').reverse()[0];
|
||||
|
||||
selector.find('li').each(function () {
|
||||
let anchor = $(this).find('a');
|
||||
if ($(anchor).attr('href') == FileName) {
|
||||
$(this).addClass('current');
|
||||
}
|
||||
});
|
||||
// if any li has .current elmnt add class
|
||||
selector.children('li').each(function () {
|
||||
if ($(this).find('.current').length) {
|
||||
$(this).addClass('current');
|
||||
}
|
||||
});
|
||||
// if no file name return
|
||||
if ('' == FileName) {
|
||||
selector.find('li').eq(0).addClass('current');
|
||||
}
|
||||
}
|
||||
|
||||
// dynamic current class
|
||||
let mainNavUL = $('.main-menu').find('.navigation');
|
||||
dynamicCurrentMenuClass(mainNavUL);
|
||||
|
||||
//Update Header Style and Scroll to Top
|
||||
function headerStyle() {
|
||||
if($('.main-header').length){
|
||||
var windowpos = $(window).scrollTop();
|
||||
var siteHeader = $('.main-header');
|
||||
var scrollLink = $('.scroll-to-top');
|
||||
var sticky_header = $('.main-header .sticky-header');
|
||||
if (windowpos > 100) {
|
||||
siteHeader.addClass('fixed-header');
|
||||
sticky_header.addClass("animated slideInDown");
|
||||
scrollLink.fadeIn(300);
|
||||
} else {
|
||||
siteHeader.removeClass('fixed-header');
|
||||
sticky_header.removeClass("animated slideInDown");
|
||||
scrollLink.fadeOut(300);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
headerStyle();
|
||||
|
||||
//Submenu Dropdown Toggle
|
||||
if($('.main-header li.dropdown ul').length){
|
||||
$('.main-header .navigation li.dropdown').append('<div class="dropdown-btn"><span class="fa fa-angle-right"></span></div>');
|
||||
}
|
||||
|
||||
//Hidden Sidebar
|
||||
if($('.hidden-sidebar').length){
|
||||
|
||||
var animButton = $(".sidemenu-nav-toggler"),
|
||||
hiddenBar = $(".hidden-sidebar"),
|
||||
navOverlay = $(".nav-overlay"),
|
||||
hiddenBarClose = $(".hidden-sidebar-close");
|
||||
|
||||
function showMenu() {
|
||||
TweenMax.to(hiddenBar, 0.6, {
|
||||
force3D: false,
|
||||
left: "0",
|
||||
ease: Expo.easeInOut
|
||||
});
|
||||
hiddenBar.removeClass("close-sidebar");
|
||||
navOverlay.fadeIn(500);
|
||||
}
|
||||
|
||||
function hideMenu() {
|
||||
TweenMax.to(hiddenBar, 0.6, {
|
||||
force3D: false,
|
||||
left: "-480px",
|
||||
ease: Expo.easeInOut
|
||||
});
|
||||
hiddenBar.addClass("close-sidebar");
|
||||
navOverlay.fadeOut(500);
|
||||
}
|
||||
animButton.on("click", function() {
|
||||
if (hiddenBar.hasClass("close-sidebar")) showMenu();
|
||||
else hideMenu();
|
||||
});
|
||||
navOverlay.on("click", function() {
|
||||
hideMenu();
|
||||
});
|
||||
hiddenBarClose.on("click", function() {
|
||||
hideMenu();
|
||||
});
|
||||
}
|
||||
|
||||
if ($('.nav-overlay').length) {
|
||||
// / cursor /
|
||||
var cursor = $(".nav-overlay .cursor"),
|
||||
follower = $(".nav-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");
|
||||
});
|
||||
$(".nav-overlay").on("mouseenter", function() {
|
||||
cursor.addClass("close-cursor");
|
||||
follower.addClass("close-cursor");
|
||||
});
|
||||
$(".nav-overlay").on("mouseleave", function() {
|
||||
cursor.removeClass("close-cursor");
|
||||
follower.removeClass("close-cursor");
|
||||
});
|
||||
}
|
||||
|
||||
//Mobile Nav Hide Show
|
||||
if($('.mobile-menu').length){
|
||||
|
||||
$('.mobile-menu .menu-box').mCustomScrollbar();
|
||||
|
||||
var mobileMenuContent = $('.main-header .nav-outer .main-menu').html();
|
||||
$('.mobile-menu .menu-box .menu-outer').append(mobileMenuContent);
|
||||
$('.sticky-header .main-menu').append(mobileMenuContent);
|
||||
|
||||
//Dropdown Button
|
||||
$('.mobile-menu li.dropdown .dropdown-btn').on('click', function() {
|
||||
$(this).toggleClass('open');
|
||||
$(this).prev('ul').slideToggle(500);
|
||||
});
|
||||
//Menu Toggle Btn
|
||||
$('.mobile-nav-toggler').on('click', function() {
|
||||
$('body').addClass('mobile-menu-visible');
|
||||
});
|
||||
|
||||
//Menu Toggle Btn
|
||||
$('.mobile-menu .menu-backdrop,.mobile-menu .close-btn,.scroll-nav li a').on('click', function() {
|
||||
$('body').removeClass('mobile-menu-visible');
|
||||
});
|
||||
}
|
||||
|
||||
//Sidemenu Nav Hide Show
|
||||
if($('.side-menu').length){
|
||||
|
||||
$('.side-menu .menu-box').mCustomScrollbar();
|
||||
|
||||
//Dropdown Button
|
||||
$('.side-menu li.dropdown .dropdown-btn').on('click', function() {
|
||||
$(this).toggleClass('open');
|
||||
$(this).prev('ul').slideToggle(500);
|
||||
});
|
||||
|
||||
$('body').addClass('side-menu-visible');
|
||||
//Menu Toggle Btn
|
||||
$('.side-nav-toggler').on('click', function() {
|
||||
$('body').addClass('side-menu-visible');
|
||||
});
|
||||
|
||||
//Menu Toggle Btn
|
||||
$('.side-menu .side-menu-resize').on('click', function() {
|
||||
$('body').toggleClass('side-menu-visible');
|
||||
});
|
||||
|
||||
//Menu Toggle Btn
|
||||
$('.main-header .mobile-nav-toggler-two').on('click', function() {
|
||||
$('body').addClass('side-menu-visible-s2');
|
||||
});
|
||||
|
||||
//Menu Overlay
|
||||
$('.main-header .side-menu-overlay').on('click', function() {
|
||||
$('body').removeClass('side-menu-visible-s2');
|
||||
});
|
||||
}
|
||||
|
||||
//Search Popup
|
||||
if($('#search-popup').length){
|
||||
|
||||
//Show Popup
|
||||
$('.search-toggler').on('click', function() {
|
||||
$('#search-popup').addClass('popup-visible');
|
||||
});
|
||||
$(document).keydown(function(e){
|
||||
if(e.keyCode === 27) {
|
||||
$('#search-popup').removeClass('popup-visible');
|
||||
}
|
||||
});
|
||||
//Hide Popup
|
||||
$('.close-search,.search-popup .overlay-layer').on('click', function() {
|
||||
$('#search-popup').removeClass('popup-visible');
|
||||
});
|
||||
}
|
||||
|
||||
// Testimonial
|
||||
var galleryThumbs = new Swiper('.testimonial-thumbs', {
|
||||
loop: false,
|
||||
spaceBetween: 10,
|
||||
slidesPerView: 3,
|
||||
initialSlide: 1,
|
||||
freeMode: true,
|
||||
speed: 1400,
|
||||
watchSlidesVisibility: true,
|
||||
watchSlidesProgress: true,
|
||||
centeredSlides: true,
|
||||
autoplay: {
|
||||
delay: 5000,
|
||||
},
|
||||
});
|
||||
var totalSlides = $(".swiper-container").length;
|
||||
var galleryTop = new Swiper('.testimonial-content', {
|
||||
spaceBetween: 10,
|
||||
slidesPerView: 1,
|
||||
mousewheel: true,
|
||||
autoplay: {
|
||||
delay: 5000,
|
||||
},
|
||||
loop: false,
|
||||
speed: 1400,
|
||||
navigation: {
|
||||
nextEl: '.swiper-button-next',
|
||||
prevEl: '.swiper-button-prev',
|
||||
},
|
||||
thumbs: {
|
||||
swiper: galleryThumbs
|
||||
}
|
||||
});
|
||||
|
||||
// Language Selector
|
||||
$(".languages").click(function(){
|
||||
$(".languages ul").show();
|
||||
})
|
||||
$(".languages ul").mouseleave(function(){
|
||||
$(".languages ul").hide();
|
||||
});
|
||||
|
||||
$(".languages li a").click(function(){
|
||||
$(".languages li a").removeClass('sel');
|
||||
$(this).addClass('sel');
|
||||
var selectedValue = $(this).text();
|
||||
var showLang = selectedValue.substring(0, 2);
|
||||
$('.languages .current').html(showLang);
|
||||
$('.languages .current').attr("title", selectedValue);
|
||||
$('.languages .hover').html(selectedValue);
|
||||
})
|
||||
|
||||
function bannerSlider() {
|
||||
if ($(".banner-slider").length > 0) {
|
||||
|
||||
// Banner Slider
|
||||
var bannerSlider = new Swiper('.banner-slider', {
|
||||
preloadImages: false,
|
||||
loop: true,
|
||||
grabCursor: true,
|
||||
centeredSlides: false,
|
||||
resistance: true,
|
||||
resistanceRatio: 0.6,
|
||||
speed: 1400,
|
||||
spaceBetween: 0,
|
||||
parallax: false,
|
||||
effect: "fade",
|
||||
autoplay: {
|
||||
delay: 4000,
|
||||
disableOnInteraction: false
|
||||
},
|
||||
pagination: {
|
||||
el: '.banner-slider-pagination',
|
||||
clickable: true,
|
||||
},
|
||||
navigation: {
|
||||
nextEl: '.banner-slider-button-next',
|
||||
prevEl: '.banner-slider-button-prev',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
//Price Range Slider
|
||||
if($('.price-range-slider').length){
|
||||
$( ".price-range-slider" ).slider({
|
||||
range: true,
|
||||
min: 10,
|
||||
max: 200,
|
||||
values: [ 10, 99 ],
|
||||
slide: function( event, ui ) {
|
||||
$( "input.property-amount" ).val( ui.values[ 0 ] + " - " + ui.values[ 1 ] );
|
||||
}
|
||||
});
|
||||
|
||||
$( "input.property-amount" ).val( $( ".price-range-slider" ).slider( "values", 0 ) + " - $" + $( ".price-range-slider" ).slider( "values", 1 ) );
|
||||
}
|
||||
|
||||
// Lazyload Images
|
||||
if($('.lazy-image').length){
|
||||
new LazyLoad({
|
||||
elements_selector: ".lazy-image",
|
||||
load_delay: 0,
|
||||
threshold: 300
|
||||
});
|
||||
}
|
||||
|
||||
/////////////////////////////
|
||||
//Universal Code for All Owl Carousel Sliders
|
||||
/////////////////////////////
|
||||
|
||||
if ($('.theme_carousel').length) {
|
||||
$(".theme_carousel").each(function (index) {
|
||||
var $owlAttr = {},
|
||||
$extraAttr = $(this).data("options");
|
||||
$.extend($owlAttr, $extraAttr);
|
||||
$(this).owlCarousel($owlAttr);
|
||||
});
|
||||
}
|
||||
|
||||
// Donation Progress Bar
|
||||
if ($('.count-bar').length) {
|
||||
$('.count-bar').appear(function(){
|
||||
var el = $(this);
|
||||
var percent = el.data('percent');
|
||||
$(el).css('width',percent).addClass('counted');
|
||||
},{accY: -50});
|
||||
|
||||
}
|
||||
|
||||
//Jquery Spinner / Quantity Spinner
|
||||
if($('.quantity-spinner').length){
|
||||
$("input.quantity-spinner").TouchSpin({
|
||||
verticalbuttons: true
|
||||
});
|
||||
}
|
||||
|
||||
//Fact Counter + Text Count
|
||||
if($('.count-box').length){
|
||||
$('.count-box').appear(function(){
|
||||
|
||||
var $t = $(this),
|
||||
n = $t.find(".count-text").attr("data-stop"),
|
||||
r = parseInt($t.find(".count-text").attr("data-speed"), 10);
|
||||
|
||||
if (!$t.hasClass("counted")) {
|
||||
$t.addClass("counted");
|
||||
$({
|
||||
countNum: $t.find(".count-text").text()
|
||||
}).animate({
|
||||
countNum: n
|
||||
}, {
|
||||
duration: r,
|
||||
easing: "linear",
|
||||
step: function() {
|
||||
$t.find(".count-text").text(Math.floor(this.countNum));
|
||||
},
|
||||
complete: function() {
|
||||
$t.find(".count-text").text(this.countNum);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
},{accY: 0});
|
||||
}
|
||||
|
||||
//Tabs Box
|
||||
if($('.tabs-box').length){
|
||||
$('.tabs-box .tab-buttons .tab-btn').on('click', function(e) {
|
||||
e.preventDefault();
|
||||
var target = $($(this).attr('data-tab'));
|
||||
|
||||
if ($(target).is(':visible')){
|
||||
return false;
|
||||
}else{
|
||||
target.parents('.tabs-box').find('.tab-buttons').find('.tab-btn').removeClass('active-btn');
|
||||
$(this).addClass('active-btn');
|
||||
target.parents('.tabs-box').find('.tabs-content').find('.tab').fadeOut(0);
|
||||
target.parents('.tabs-box').find('.tabs-content').find('.tab').removeClass('active-tab');
|
||||
$(target).fadeIn(300);
|
||||
$(target).addClass('active-tab');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//Accordion Box
|
||||
if($('.accordion-box').length){
|
||||
$(".accordion-box").on('click', '.acc-btn', function() {
|
||||
|
||||
var outerBox = $(this).parents('.accordion-box');
|
||||
var target = $(this).parents('.accordion');
|
||||
|
||||
if($(this).hasClass('active')!==true){
|
||||
$(outerBox).find('.accordion .acc-btn').removeClass('active');
|
||||
}
|
||||
|
||||
if ($(this).next('.acc-content').is(':visible')){
|
||||
return false;
|
||||
}else{
|
||||
$(this).addClass('active');
|
||||
$(outerBox).children('.accordion').removeClass('active-block');
|
||||
$(outerBox).find('.accordion').children('.acc-content').slideUp(300);
|
||||
target.addClass('active-block');
|
||||
$(this).next('.acc-content').slideDown(300);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
//LightBox / Fancybox
|
||||
if($('.lightbox-image').length) {
|
||||
$('.lightbox-image').fancybox({
|
||||
openEffect : 'fade',
|
||||
closeEffect : 'fade',
|
||||
helpers : {
|
||||
media : {}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//Sortable Masonary with Filters
|
||||
function sortableMasonry() {
|
||||
if ($('.sortable-masonry').length) {
|
||||
var winDow = $(window);
|
||||
// Needed variables
|
||||
var $container = $('.sortable-masonry .items-container');
|
||||
var $filter = $('.filter-btns');
|
||||
$container.isotope({
|
||||
filter: '.all',
|
||||
animationOptions: {
|
||||
duration: 500,
|
||||
easing: 'linear'
|
||||
}
|
||||
});
|
||||
// Isotope Filter
|
||||
$filter.find('li').on('click', function() {
|
||||
var selector = $(this).attr('data-filter');
|
||||
try {
|
||||
$container.isotope({
|
||||
filter: selector,
|
||||
animationOptions: {
|
||||
duration: 500,
|
||||
easing: 'linear',
|
||||
queue: false
|
||||
}
|
||||
});
|
||||
} catch (err) {}
|
||||
return false;
|
||||
});
|
||||
winDow.on('resize', function() {
|
||||
var selector = $filter.find('li.active').attr('data-filter');
|
||||
$container.isotope({
|
||||
filter: selector,
|
||||
animationOptions: {
|
||||
duration: 500,
|
||||
easing: 'linear',
|
||||
queue: false
|
||||
}
|
||||
});
|
||||
$container.isotope()
|
||||
});
|
||||
var filterItemA = $('.filter-btns li');
|
||||
filterItemA.on('click', function() {
|
||||
var $this = $(this);
|
||||
if (!$this.hasClass('active')) {
|
||||
filterItemA.removeClass('active');
|
||||
$this.addClass('active');
|
||||
}
|
||||
});
|
||||
$container.isotope("on", "layoutComplete", function(a, b) {
|
||||
var a = b.length,
|
||||
pcn = $(".filters .count");
|
||||
pcn.html(a);
|
||||
});
|
||||
}
|
||||
}
|
||||
sortableMasonry();
|
||||
|
||||
|
||||
// Testimonial
|
||||
if ($('.testimonial-carousel').length) {
|
||||
var testimonialThumb = new Swiper('.testimonial-thumbs', {
|
||||
preloadImages: false,
|
||||
loop: true,
|
||||
speed: 2400,
|
||||
slidesPerView: 3,
|
||||
centeredSlides: true,
|
||||
spaceBetween: 0,
|
||||
effect: "slide",
|
||||
});
|
||||
var totalSlides = $(".swiper-container").length;
|
||||
var testimonialContent = new Swiper('.testimonial-content', {
|
||||
preloadImages: false,
|
||||
loop: true,
|
||||
speed: 2400,
|
||||
spaceBetween: 0,
|
||||
effect: "slide",
|
||||
thumbs: {
|
||||
swiper: testimonialThumb
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Single Image Carousel
|
||||
if ($('.single-image-carousel').length) {
|
||||
var productThumbs = new Swiper('.single-image-carousel', {
|
||||
preloadImages: false,
|
||||
loop: true,
|
||||
speed: 1400,
|
||||
spaceBetween: 0,
|
||||
effect: "fade",
|
||||
autoplay: {
|
||||
delay: 5000,
|
||||
disableOnInteraction: false
|
||||
},
|
||||
|
||||
navigation: {
|
||||
nextEl: '.slider-button-next',
|
||||
prevEl: '.slider-button-prev',
|
||||
},
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
//Projects Tabs
|
||||
if($('.project-tab').length){
|
||||
$('.project-tab .project-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{
|
||||
$('.project-tab .project-tab-btns .p-tab-btn').removeClass('active-btn');
|
||||
$(this).addClass('active-btn');
|
||||
$('.project-tab .p-tabs-content .p-tab').removeClass('active-tab');
|
||||
$(target).addClass('active-tab');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Isotop Layout
|
||||
function isotopeBlock() {
|
||||
if($(".isotope-block").length){
|
||||
var $grid = $('.isotope-block').isotope();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
isotopeBlock();
|
||||
|
||||
//Progress Bar / Levels
|
||||
if ($('.progress-levels .progress-box .bar-fill').length) {
|
||||
$(".progress-box .bar-fill").each(function() {
|
||||
var progressWidth = $(this).attr('data-percent');
|
||||
$(this).css('width', progressWidth + '%');
|
||||
$(this).children('.percent').html(progressWidth + '%');
|
||||
});
|
||||
}
|
||||
|
||||
// Scroll to a Specific Div
|
||||
if($('.scroll-to-target').length){
|
||||
$(".scroll-to-target").on('click', function() {
|
||||
var target = $(this).attr('data-target');
|
||||
// animate
|
||||
$('html, body').animate({
|
||||
scrollTop: $(target).offset().top
|
||||
}, 1500);
|
||||
});
|
||||
}
|
||||
|
||||
if ($('.ajax-sub-form').length > 0) {
|
||||
$('.ajax-sub-form').ajaxChimp({
|
||||
language: 'es',
|
||||
url: "https://gmail.us17.list-manage.com/subscribe/post?u=8a43765a655b07d21fa500e4e&id=2eda0a58a7" //Replace this with your mailchimp post URL.
|
||||
});
|
||||
|
||||
$.ajaxChimp.translations.es = {
|
||||
'submit': 'Submitting...',
|
||||
0: 'Thanks for your subscription',
|
||||
1: 'Please enter a valid email',
|
||||
2: 'An email address must contain a single @',
|
||||
3: 'The domain portion of the email address is invalid (the portion after the @: )',
|
||||
4: 'The username portion of the email address is invalid (the portion before the @: )',
|
||||
5: 'This email address looks fake or invalid. Please enter a real email address'
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// 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: true, // trigger animations on mobile devices (default is true)
|
||||
live: true // act on asynchronously loaded content (default is true)
|
||||
}
|
||||
);
|
||||
wow.init();
|
||||
}
|
||||
|
||||
//Add One Page nav
|
||||
if($('.scroll-nav').length) {
|
||||
$('.scroll-nav ul').onePageNav();
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
When document is Scrollig, do
|
||||
========================================================================== */
|
||||
|
||||
$(window).on('scroll', function() {
|
||||
headerStyle();
|
||||
});
|
||||
|
||||
/* ==========================================================================
|
||||
When document is loading, do
|
||||
========================================================================== */
|
||||
|
||||
$(window).on('load', function() {
|
||||
handlePreloader();
|
||||
sortableMasonry();
|
||||
isotopeBlock();
|
||||
bannerSlider();
|
||||
});
|
||||
|
||||
})(window.jQuery);
|
||||
5
assets/js/scrollbar.js
Normal file
5
assets/js/scrollbar.js
Normal file
File diff suppressed because one or more lines are too long
13
assets/js/swiper.min.js
vendored
Normal file
13
assets/js/swiper.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
5
assets/js/video.js
Normal file
5
assets/js/video.js
Normal file
@@ -0,0 +1,5 @@
|
||||
|
||||
// for podcast video
|
||||
function changeVideo(videoId) {
|
||||
document.getElementById("mainVideo").src = "https://www.youtube.com/embed/" + videoId;
|
||||
}
|
||||
2
assets/js/wow.js
Normal file
2
assets/js/wow.js
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user