changes
changes
This commit is contained in:
48
template/assets/js/ajax-mail.js
Normal file
48
template/assets/js/ajax-mail.js
Normal file
@ -0,0 +1,48 @@
|
||||
$(function() {
|
||||
|
||||
// Get the form.
|
||||
var form = $('#contact-form');
|
||||
|
||||
// Get the messages div.
|
||||
var formMessages = $('.form-message');
|
||||
|
||||
// Set up an event listener for the contact form.
|
||||
$(form).submit(function(e) {
|
||||
// Stop the browser from submitting the form.
|
||||
e.preventDefault();
|
||||
|
||||
// Serialize the form data.
|
||||
var formData = $(form).serialize();
|
||||
|
||||
// Submit the form using AJAX.
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: $(form).attr('action'),
|
||||
data: formData
|
||||
})
|
||||
.done(function(response) {
|
||||
// Make sure that the formMessages div has the 'success' class.
|
||||
$(formMessages).removeClass('error');
|
||||
$(formMessages).addClass('success');
|
||||
|
||||
// Set the message text.
|
||||
$(formMessages).text(response);
|
||||
|
||||
// Clear the form.
|
||||
$('#contact-form input, #contact-form textarea').val('');
|
||||
})
|
||||
.fail(function(data) {
|
||||
// Make sure that the formMessages div has the 'error' class.
|
||||
$(formMessages).removeClass('success');
|
||||
$(formMessages).addClass('error');
|
||||
|
||||
// Set the message text.
|
||||
if (data.responseText !== '') {
|
||||
$(formMessages).text(data.responseText);
|
||||
} else {
|
||||
$(formMessages).text('Oops! An error occurred and your message could not be sent.');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
55
template/assets/js/animation.js
Normal file
55
template/assets/js/animation.js
Normal file
File diff suppressed because one or more lines are too long
1655
template/assets/js/bootstrap-datepicker.js
vendored
Normal file
1655
template/assets/js/bootstrap-datepicker.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
7
template/assets/js/bootstrap.bundle.min.js
vendored
Normal file
7
template/assets/js/bootstrap.bundle.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
2
template/assets/js/jquery-3.7.1.min.js
vendored
Normal file
2
template/assets/js/jquery-3.7.1.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
template/assets/js/jquery.counterup.min.js
vendored
Normal file
1
template/assets/js/jquery.counterup.min.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
(function($){"use strict";$.fn.counterUp=function(options){var settings=$.extend({time:400,delay:10,offset:100,beginAt:0,formatter:false,context:"window",callback:function(){}},options),s;return this.each(function(){var $this=$(this),counter={time:$(this).data("counterup-time")||settings.time,delay:$(this).data("counterup-delay")||settings.delay,offset:$(this).data("counterup-offset")||settings.offset,beginAt:$(this).data("counterup-beginat")||settings.beginAt,context:$(this).data("counterup-context")||settings.context};var counterUpper=function(){var nums=[];var divisions=counter.time/counter.delay;var num=$(this).attr("data-num")?$(this).attr("data-num"):$this.text();var isComma=/[0-9]+,[0-9]+/.test(num);num=num.replace(/,/g,"");var decimalPlaces=(num.split(".")[1]||[]).length;if(counter.beginAt>num)counter.beginAt=num;var isTime=/[0-9]+:[0-9]+:[0-9]+/.test(num);if(isTime){var times=num.split(":"),m=1;s=0;while(times.length>0){s+=m*parseInt(times.pop(),10);m*=60}}for(var i=divisions;i>=counter.beginAt/num*divisions;i--){var newNum=parseFloat(num/divisions*i).toFixed(decimalPlaces);if(isTime){newNum=parseInt(s/divisions*i);var hours=parseInt(newNum/3600)%24;var minutes=parseInt(newNum/60)%60;var seconds=parseInt(newNum%60,10);newNum=(hours<10?"0"+hours:hours)+":"+(minutes<10?"0"+minutes:minutes)+":"+(seconds<10?"0"+seconds:seconds)}if(isComma){while(/(\d+)(\d{3})/.test(newNum.toString())){newNum=newNum.toString().replace(/(\d+)(\d{3})/,"$1"+","+"$2")}}if(settings.formatter){newNum=settings.formatter.call(this,newNum)}nums.unshift(newNum)}$this.data("counterup-nums",nums);$this.text(counter.beginAt);var f=function(){if(!$this.data("counterup-nums")){settings.callback.call(this);return}$this.html($this.data("counterup-nums").shift());if($this.data("counterup-nums").length){setTimeout($this.data("counterup-func"),counter.delay)}else{$this.data("counterup-nums",null);$this.data("counterup-func",null);settings.callback.call(this)}};$this.data("counterup-func",f);setTimeout($this.data("counterup-func"),counter.delay)};$this.waypoint(function(direction){counterUpper();this.destroy()},{offset:counter.offset+"%",context:counter.context})})}})(jQuery);
|
4
template/assets/js/jquery.magnific-popup.min.js
vendored
Normal file
4
template/assets/js/jquery.magnific-popup.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
90
template/assets/js/jquery.meanmenu.min.js
vendored
Normal file
90
template/assets/js/jquery.meanmenu.min.js
vendored
Normal file
@ -0,0 +1,90 @@
|
||||
/*!
|
||||
* jQuery meanMenu v2.0.8
|
||||
* @Copyright (C) 2012-2014 Chris Wharton @ MeanThemes (https://github.com/meanthemes/meanMenu)
|
||||
*
|
||||
*/
|
||||
! function(e) {
|
||||
"use strict";
|
||||
e.fn.meanmenu = function(n) {
|
||||
var a = {
|
||||
meanMenuTarget: jQuery(this),
|
||||
meanMenuContainer: "body",
|
||||
meanMenuClose: "X",
|
||||
meanMenuCloseSize: "18px",
|
||||
meanMenuOpen: "<span /><span /><span />",
|
||||
meanRevealPosition: "right",
|
||||
meanRevealPositionDistance: "0",
|
||||
meanRevealColour: "",
|
||||
meanScreenWidth: "480",
|
||||
meanNavPush: "",
|
||||
meanShowChildren: !0,
|
||||
meanExpandableChildren: !0,
|
||||
meanRemoveAttrs: !1,
|
||||
onePage: !1,
|
||||
meanDisplay: "block",
|
||||
removeElements: ""
|
||||
};
|
||||
n = e.extend(a, n);
|
||||
var t = window.innerWidth || document.documentElement.clientWidth;
|
||||
return this.each(function() {
|
||||
var e = n.meanMenuTarget,
|
||||
a = n.meanMenuContainer,
|
||||
r = n.meanMenuClose,
|
||||
i = n.meanMenuCloseSize,
|
||||
s = n.meanMenuOpen,
|
||||
u = n.meanRevealPosition,
|
||||
m = n.meanRevealPositionDistance,
|
||||
l = n.meanRevealColour,
|
||||
o = n.meanScreenWidth,
|
||||
c = n.meanNavPush,
|
||||
d = n.meanShowChildren,
|
||||
v = n.meanExpandableChildren,
|
||||
h = n.meanExpand,
|
||||
y = n.meanRemoveAttrs,
|
||||
j = n.onePage,
|
||||
Q = n.meanDisplay,
|
||||
f = n.removeElements,
|
||||
p = !1;
|
||||
(navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPod/i) || navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/Blackberry/i) || navigator.userAgent.match(/Windows Phone/i)) && (p = !0), (navigator.userAgent.match(/MSIE 8/i) || navigator.userAgent.match(/MSIE 7/i)) && jQuery("html").css("overflow-y", "scroll");
|
||||
var g = "",
|
||||
C = function() {
|
||||
if ("center" === u) {
|
||||
var e = (window.innerWidth || document.documentElement.clientWidth) / 2 - 22 + "px";
|
||||
g = "left:" + e + ";right:auto;", p ? jQuery(".meanmenu-reveal").animate({
|
||||
left: e
|
||||
}) : jQuery(".meanmenu-reveal").css("left", e)
|
||||
}
|
||||
},
|
||||
w = !1,
|
||||
A = !1;
|
||||
"right" === u && (g = "right:" + m + ";left:auto;"), "left" === u && (g = "left:" + m + ";right:auto;"), C();
|
||||
var M = "",
|
||||
P = function() {
|
||||
jQuery(".mean-bar,.mean-push").remove(), jQuery(a).removeClass("mean-container"), jQuery(e).css("display", Q), w = !1, A = !1, jQuery(f).removeClass("mean-remove")
|
||||
},
|
||||
E = function() {
|
||||
var n = "background:" + l + ";color:" + l + ";" + g;
|
||||
if (t <= o) {
|
||||
jQuery(f).addClass("mean-remove"), A = !0, jQuery(a).addClass("mean-container"), jQuery(".mean-container").prepend('<div class="mean-bar"><a href="#nav" class="meanmenu-reveal" style="' + n + '">Show Navigation</a><nav class="mean-nav"></nav></div>');
|
||||
var u = jQuery(e).html();
|
||||
jQuery(".mean-nav").html(u), y && jQuery("nav.mean-nav ul, nav.mean-nav ul *").each(function() {
|
||||
jQuery(this).is(".mean-remove") ? jQuery(this).attr("class", "mean-remove") : jQuery(this).removeAttr("class"), jQuery(this).removeAttr("id")
|
||||
}), jQuery(e).before('<div class="mean-push" />'), jQuery(".mean-push").css("margin-top", c), jQuery(e).hide(), jQuery(".meanmenu-reveal").show(), jQuery(".meanmenu-reveal").html(s), M = jQuery(".meanmenu-reveal"), jQuery(".mean-nav ul").hide(), d ? v ? (jQuery(".mean-nav ul ul").each(function() {
|
||||
jQuery(this).children().length && jQuery(this, "li:first").parent().append('<a class="mean-expand" href="#" style="font-size: ' + i + '">' + h + "</a>")
|
||||
}), jQuery(".mean-expand").on("click", function(e) {
|
||||
e.preventDefault(), jQuery(this).hasClass("mean-clicked") ? (jQuery(this).prev("ul").slideUp(300, function() {}), jQuery(this).parent().removeClass("dropdown-opened")) : (jQuery(this).prev("ul").slideDown(300, function() {}), jQuery(this).parent().addClass("dropdown-opened")), jQuery(this).toggleClass("mean-clicked")
|
||||
})) : jQuery(".mean-nav ul ul").show() : jQuery(".mean-nav ul ul").hide(), jQuery(".mean-nav ul li").last().addClass("mean-last"), M.removeClass("meanclose"), jQuery(M).click(function(e) {
|
||||
e.preventDefault(), !1 === w ? (M.css("text-align", "center"), M.css("text-indent", "0"), M.css("font-size", i), jQuery(".mean-nav ul:first").slideDown(), w = !0) : (jQuery(".mean-nav ul:first").slideUp(), w = !1), M.toggleClass("meanclose"), jQuery(M).is(".meanmenu-reveal.meanclose") ? M.html(r) : M.html(s), jQuery(f).addClass("mean-remove")
|
||||
}), j && jQuery(".mean-nav ul > li > a:first-child").on("click", function() {
|
||||
jQuery(".mean-nav ul:first").slideUp(), w = !1, jQuery(M).toggleClass("meanclose").html(s)
|
||||
})
|
||||
} else P()
|
||||
};
|
||||
p || jQuery(window).resize(function() {
|
||||
t = window.innerWidth || document.documentElement.clientWidth, P(), t <= o ? (E(), C()) : P()
|
||||
}), jQuery(window).resize(function() {
|
||||
t = window.innerWidth || document.documentElement.clientWidth, p ? (C(), t <= o ? !1 === A && E() : P()) : (P(), t <= o && (E(), C()))
|
||||
}), E()
|
||||
})
|
||||
}
|
||||
}(jQuery);
|
4
template/assets/js/jquery.nice-select.min.js
vendored
Normal file
4
template/assets/js/jquery.nice-select.min.js
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
/* jQuery Nice Select - v1.0
|
||||
https://github.com/hernansartorio/jquery-nice-select
|
||||
Made by Hernán Sartorio */
|
||||
!function(e){e.fn.niceSelect=function(t){function s(t){t.after(e("<div></div>").addClass("nice-select").addClass(t.attr("class")||"").addClass(t.attr("disabled")?"disabled":"").attr("tabindex",t.attr("disabled")?null:"0").html('<span class="current"></span><ul class="list"></ul>'));var s=t.next(),n=t.find("option"),i=t.find("option:selected");s.find(".current").html(i.data("display")||i.text()),n.each(function(t){var n=e(this),i=n.data("display");s.find("ul").append(e("<li></li>").attr("data-value",n.val()).attr("data-display",i||null).addClass("option"+(n.is(":selected")?" selected":"")+(n.is(":disabled")?" disabled":"")).html(n.text()))})}if("string"==typeof t)return"update"==t?this.each(function(){var t=e(this),n=e(this).next(".nice-select"),i=n.hasClass("open");n.length&&(n.remove(),s(t),i&&t.next().trigger("click"))}):"destroy"==t?(this.each(function(){var t=e(this),s=e(this).next(".nice-select");s.length&&(s.remove(),t.css("display",""))}),0==e(".nice-select").length&&e(document).off(".nice_select")):console.log('Method "'+t+'" does not exist.'),this;this.hide(),this.each(function(){var t=e(this);t.next().hasClass("nice-select")||s(t)}),e(document).off(".nice_select"),e(document).on("click.nice_select",".nice-select",function(t){var s=e(this);e(".nice-select").not(s).removeClass("open"),s.toggleClass("open"),s.hasClass("open")?(s.find(".option"),s.find(".focus").removeClass("focus"),s.find(".selected").addClass("focus")):s.focus()}),e(document).on("click.nice_select",function(t){0===e(t.target).closest(".nice-select").length&&e(".nice-select").removeClass("open").find(".option")}),e(document).on("click.nice_select",".nice-select .option:not(.disabled)",function(t){var s=e(this),n=s.closest(".nice-select");n.find(".selected").removeClass("selected"),s.addClass("selected");var i=s.data("display")||s.text();n.find(".current").text(i),n.prev("select").val(s.data("value")).trigger("change")}),e(document).on("keydown.nice_select",".nice-select",function(t){var s=e(this),n=e(s.find(".focus")||s.find(".list .option.selected"));if(32==t.keyCode||13==t.keyCode)return s.hasClass("open")?n.trigger("click"):s.trigger("click"),!1;if(40==t.keyCode){if(s.hasClass("open")){var i=n.nextAll(".option:not(.disabled)").first();i.length>0&&(s.find(".focus").removeClass("focus"),i.addClass("focus"))}else s.trigger("click");return!1}if(38==t.keyCode){if(s.hasClass("open")){var l=n.prevAll(".option:not(.disabled)").first();l.length>0&&(s.find(".focus").removeClass("focus"),l.addClass("focus"))}else s.trigger("click");return!1}if(27==t.keyCode)s.hasClass("open")&&s.trigger("click");else if(9==t.keyCode&&s.hasClass("open"))return!1});var n=document.createElement("a").style;return n.cssText="pointer-events:auto","auto"!==n.pointerEvents&&e("html").addClass("no-csspointerevents"),this}}(jQuery);
|
662
template/assets/js/jquery.waypoints.js
Normal file
662
template/assets/js/jquery.waypoints.js
Normal file
@ -0,0 +1,662 @@
|
||||
/*!
|
||||
Waypoints - 4.0.1
|
||||
Copyright © 2011-2016 Caleb Troughton
|
||||
Licensed under the MIT license.
|
||||
https://github.com/imakewebthings/waypoints/blob/master/licenses.txt
|
||||
*/
|
||||
(function() {
|
||||
'use strict'
|
||||
|
||||
var keyCounter = 0
|
||||
var allWaypoints = {}
|
||||
|
||||
/* http://imakewebthings.com/waypoints/api/waypoint */
|
||||
function Waypoint(options) {
|
||||
if (!options) {
|
||||
throw new Error('No options passed to Waypoint constructor')
|
||||
}
|
||||
if (!options.element) {
|
||||
throw new Error('No element option passed to Waypoint constructor')
|
||||
}
|
||||
if (!options.handler) {
|
||||
throw new Error('No handler option passed to Waypoint constructor')
|
||||
}
|
||||
|
||||
this.key = 'waypoint-' + keyCounter
|
||||
this.options = Waypoint.Adapter.extend({}, Waypoint.defaults, options)
|
||||
this.element = this.options.element
|
||||
this.adapter = new Waypoint.Adapter(this.element)
|
||||
this.callback = options.handler
|
||||
this.axis = this.options.horizontal ? 'horizontal' : 'vertical'
|
||||
this.enabled = this.options.enabled
|
||||
this.triggerPoint = null
|
||||
this.group = Waypoint.Group.findOrCreate({
|
||||
name: this.options.group,
|
||||
axis: this.axis
|
||||
})
|
||||
this.context = Waypoint.Context.findOrCreateByElement(this.options.context)
|
||||
|
||||
if (Waypoint.offsetAliases[this.options.offset]) {
|
||||
this.options.offset = Waypoint.offsetAliases[this.options.offset]
|
||||
}
|
||||
this.group.add(this)
|
||||
this.context.add(this)
|
||||
allWaypoints[this.key] = this
|
||||
keyCounter += 1
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Waypoint.prototype.queueTrigger = function(direction) {
|
||||
this.group.queueTrigger(this, direction)
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Waypoint.prototype.trigger = function(args) {
|
||||
if (!this.enabled) {
|
||||
return
|
||||
}
|
||||
if (this.callback) {
|
||||
this.callback.apply(this, args)
|
||||
}
|
||||
}
|
||||
|
||||
/* Public */
|
||||
/* http://imakewebthings.com/waypoints/api/destroy */
|
||||
Waypoint.prototype.destroy = function() {
|
||||
this.context.remove(this)
|
||||
this.group.remove(this)
|
||||
delete allWaypoints[this.key]
|
||||
}
|
||||
|
||||
/* Public */
|
||||
/* http://imakewebthings.com/waypoints/api/disable */
|
||||
Waypoint.prototype.disable = function() {
|
||||
this.enabled = false
|
||||
return this
|
||||
}
|
||||
|
||||
/* Public */
|
||||
/* http://imakewebthings.com/waypoints/api/enable */
|
||||
Waypoint.prototype.enable = function() {
|
||||
this.context.refresh()
|
||||
this.enabled = true
|
||||
return this
|
||||
}
|
||||
|
||||
/* Public */
|
||||
/* http://imakewebthings.com/waypoints/api/next */
|
||||
Waypoint.prototype.next = function() {
|
||||
return this.group.next(this)
|
||||
}
|
||||
|
||||
/* Public */
|
||||
/* http://imakewebthings.com/waypoints/api/previous */
|
||||
Waypoint.prototype.previous = function() {
|
||||
return this.group.previous(this)
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Waypoint.invokeAll = function(method) {
|
||||
var allWaypointsArray = []
|
||||
for (var waypointKey in allWaypoints) {
|
||||
allWaypointsArray.push(allWaypoints[waypointKey])
|
||||
}
|
||||
for (var i = 0, end = allWaypointsArray.length; i < end; i++) {
|
||||
allWaypointsArray[i][method]()
|
||||
}
|
||||
}
|
||||
|
||||
/* Public */
|
||||
/* http://imakewebthings.com/waypoints/api/destroy-all */
|
||||
Waypoint.destroyAll = function() {
|
||||
Waypoint.invokeAll('destroy')
|
||||
}
|
||||
|
||||
/* Public */
|
||||
/* http://imakewebthings.com/waypoints/api/disable-all */
|
||||
Waypoint.disableAll = function() {
|
||||
Waypoint.invokeAll('disable')
|
||||
}
|
||||
|
||||
/* Public */
|
||||
/* http://imakewebthings.com/waypoints/api/enable-all */
|
||||
Waypoint.enableAll = function() {
|
||||
Waypoint.Context.refreshAll()
|
||||
for (var waypointKey in allWaypoints) {
|
||||
allWaypoints[waypointKey].enabled = true
|
||||
}
|
||||
return this
|
||||
}
|
||||
|
||||
/* Public */
|
||||
/* http://imakewebthings.com/waypoints/api/refresh-all */
|
||||
Waypoint.refreshAll = function() {
|
||||
Waypoint.Context.refreshAll()
|
||||
}
|
||||
|
||||
/* Public */
|
||||
/* http://imakewebthings.com/waypoints/api/viewport-height */
|
||||
Waypoint.viewportHeight = function() {
|
||||
return window.innerHeight || document.documentElement.clientHeight
|
||||
}
|
||||
|
||||
/* Public */
|
||||
/* http://imakewebthings.com/waypoints/api/viewport-width */
|
||||
Waypoint.viewportWidth = function() {
|
||||
return document.documentElement.clientWidth
|
||||
}
|
||||
|
||||
Waypoint.adapters = []
|
||||
|
||||
Waypoint.defaults = {
|
||||
context: window,
|
||||
continuous: true,
|
||||
enabled: true,
|
||||
group: 'default',
|
||||
horizontal: false,
|
||||
offset: 0
|
||||
}
|
||||
|
||||
Waypoint.offsetAliases = {
|
||||
'bottom-in-view': function() {
|
||||
return this.context.innerHeight() - this.adapter.outerHeight()
|
||||
},
|
||||
'right-in-view': function() {
|
||||
return this.context.innerWidth() - this.adapter.outerWidth()
|
||||
}
|
||||
}
|
||||
|
||||
window.Waypoint = Waypoint
|
||||
}())
|
||||
;(function() {
|
||||
'use strict'
|
||||
|
||||
function requestAnimationFrameShim(callback) {
|
||||
window.setTimeout(callback, 1000 / 60)
|
||||
}
|
||||
|
||||
var keyCounter = 0
|
||||
var contexts = {}
|
||||
var Waypoint = window.Waypoint
|
||||
var oldWindowLoad = window.onload
|
||||
|
||||
/* http://imakewebthings.com/waypoints/api/context */
|
||||
function Context(element) {
|
||||
this.element = element
|
||||
this.Adapter = Waypoint.Adapter
|
||||
this.adapter = new this.Adapter(element)
|
||||
this.key = 'waypoint-context-' + keyCounter
|
||||
this.didScroll = false
|
||||
this.didResize = false
|
||||
this.oldScroll = {
|
||||
x: this.adapter.scrollLeft(),
|
||||
y: this.adapter.scrollTop()
|
||||
}
|
||||
this.waypoints = {
|
||||
vertical: {},
|
||||
horizontal: {}
|
||||
}
|
||||
|
||||
element.waypointContextKey = this.key
|
||||
contexts[element.waypointContextKey] = this
|
||||
keyCounter += 1
|
||||
if (!Waypoint.windowContext) {
|
||||
Waypoint.windowContext = true
|
||||
Waypoint.windowContext = new Context(window)
|
||||
}
|
||||
|
||||
this.createThrottledScrollHandler()
|
||||
this.createThrottledResizeHandler()
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Context.prototype.add = function(waypoint) {
|
||||
var axis = waypoint.options.horizontal ? 'horizontal' : 'vertical'
|
||||
this.waypoints[axis][waypoint.key] = waypoint
|
||||
this.refresh()
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Context.prototype.checkEmpty = function() {
|
||||
var horizontalEmpty = this.Adapter.isEmptyObject(this.waypoints.horizontal)
|
||||
var verticalEmpty = this.Adapter.isEmptyObject(this.waypoints.vertical)
|
||||
var isWindow = this.element == this.element.window
|
||||
if (horizontalEmpty && verticalEmpty && !isWindow) {
|
||||
this.adapter.off('.waypoints')
|
||||
delete contexts[this.key]
|
||||
}
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Context.prototype.createThrottledResizeHandler = function() {
|
||||
var self = this
|
||||
|
||||
function resizeHandler() {
|
||||
self.handleResize()
|
||||
self.didResize = false
|
||||
}
|
||||
|
||||
this.adapter.on('resize.waypoints', function() {
|
||||
if (!self.didResize) {
|
||||
self.didResize = true
|
||||
Waypoint.requestAnimationFrame(resizeHandler)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Context.prototype.createThrottledScrollHandler = function() {
|
||||
var self = this
|
||||
function scrollHandler() {
|
||||
self.handleScroll()
|
||||
self.didScroll = false
|
||||
}
|
||||
|
||||
this.adapter.on('scroll.waypoints', function() {
|
||||
if (!self.didScroll || Waypoint.isTouch) {
|
||||
self.didScroll = true
|
||||
Waypoint.requestAnimationFrame(scrollHandler)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Context.prototype.handleResize = function() {
|
||||
Waypoint.Context.refreshAll()
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Context.prototype.handleScroll = function() {
|
||||
var triggeredGroups = {}
|
||||
var axes = {
|
||||
horizontal: {
|
||||
newScroll: this.adapter.scrollLeft(),
|
||||
oldScroll: this.oldScroll.x,
|
||||
forward: 'right',
|
||||
backward: 'left'
|
||||
},
|
||||
vertical: {
|
||||
newScroll: this.adapter.scrollTop(),
|
||||
oldScroll: this.oldScroll.y,
|
||||
forward: 'down',
|
||||
backward: 'up'
|
||||
}
|
||||
}
|
||||
|
||||
for (var axisKey in axes) {
|
||||
var axis = axes[axisKey]
|
||||
var isForward = axis.newScroll > axis.oldScroll
|
||||
var direction = isForward ? axis.forward : axis.backward
|
||||
|
||||
for (var waypointKey in this.waypoints[axisKey]) {
|
||||
var waypoint = this.waypoints[axisKey][waypointKey]
|
||||
if (waypoint.triggerPoint === null) {
|
||||
continue
|
||||
}
|
||||
var wasBeforeTriggerPoint = axis.oldScroll < waypoint.triggerPoint
|
||||
var nowAfterTriggerPoint = axis.newScroll >= waypoint.triggerPoint
|
||||
var crossedForward = wasBeforeTriggerPoint && nowAfterTriggerPoint
|
||||
var crossedBackward = !wasBeforeTriggerPoint && !nowAfterTriggerPoint
|
||||
if (crossedForward || crossedBackward) {
|
||||
waypoint.queueTrigger(direction)
|
||||
triggeredGroups[waypoint.group.id] = waypoint.group
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (var groupKey in triggeredGroups) {
|
||||
triggeredGroups[groupKey].flushTriggers()
|
||||
}
|
||||
|
||||
this.oldScroll = {
|
||||
x: axes.horizontal.newScroll,
|
||||
y: axes.vertical.newScroll
|
||||
}
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Context.prototype.innerHeight = function() {
|
||||
/*eslint-disable eqeqeq */
|
||||
if (this.element == this.element.window) {
|
||||
return Waypoint.viewportHeight()
|
||||
}
|
||||
/*eslint-enable eqeqeq */
|
||||
return this.adapter.innerHeight()
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Context.prototype.remove = function(waypoint) {
|
||||
delete this.waypoints[waypoint.axis][waypoint.key]
|
||||
this.checkEmpty()
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Context.prototype.innerWidth = function() {
|
||||
/*eslint-disable eqeqeq */
|
||||
if (this.element == this.element.window) {
|
||||
return Waypoint.viewportWidth()
|
||||
}
|
||||
/*eslint-enable eqeqeq */
|
||||
return this.adapter.innerWidth()
|
||||
}
|
||||
|
||||
/* Public */
|
||||
/* http://imakewebthings.com/waypoints/api/context-destroy */
|
||||
Context.prototype.destroy = function() {
|
||||
var allWaypoints = []
|
||||
for (var axis in this.waypoints) {
|
||||
for (var waypointKey in this.waypoints[axis]) {
|
||||
allWaypoints.push(this.waypoints[axis][waypointKey])
|
||||
}
|
||||
}
|
||||
for (var i = 0, end = allWaypoints.length; i < end; i++) {
|
||||
allWaypoints[i].destroy()
|
||||
}
|
||||
}
|
||||
|
||||
/* Public */
|
||||
/* http://imakewebthings.com/waypoints/api/context-refresh */
|
||||
Context.prototype.refresh = function() {
|
||||
/*eslint-disable eqeqeq */
|
||||
var isWindow = this.element == this.element.window
|
||||
/*eslint-enable eqeqeq */
|
||||
var contextOffset = isWindow ? undefined : this.adapter.offset()
|
||||
var triggeredGroups = {}
|
||||
var axes
|
||||
|
||||
this.handleScroll()
|
||||
axes = {
|
||||
horizontal: {
|
||||
contextOffset: isWindow ? 0 : contextOffset.left,
|
||||
contextScroll: isWindow ? 0 : this.oldScroll.x,
|
||||
contextDimension: this.innerWidth(),
|
||||
oldScroll: this.oldScroll.x,
|
||||
forward: 'right',
|
||||
backward: 'left',
|
||||
offsetProp: 'left'
|
||||
},
|
||||
vertical: {
|
||||
contextOffset: isWindow ? 0 : contextOffset.top,
|
||||
contextScroll: isWindow ? 0 : this.oldScroll.y,
|
||||
contextDimension: this.innerHeight(),
|
||||
oldScroll: this.oldScroll.y,
|
||||
forward: 'down',
|
||||
backward: 'up',
|
||||
offsetProp: 'top'
|
||||
}
|
||||
}
|
||||
|
||||
for (var axisKey in axes) {
|
||||
var axis = axes[axisKey]
|
||||
for (var waypointKey in this.waypoints[axisKey]) {
|
||||
var waypoint = this.waypoints[axisKey][waypointKey]
|
||||
var adjustment = waypoint.options.offset
|
||||
var oldTriggerPoint = waypoint.triggerPoint
|
||||
var elementOffset = 0
|
||||
var freshWaypoint = oldTriggerPoint == null
|
||||
var contextModifier, wasBeforeScroll, nowAfterScroll
|
||||
var triggeredBackward, triggeredForward
|
||||
|
||||
if (waypoint.element !== waypoint.element.window) {
|
||||
elementOffset = waypoint.adapter.offset()[axis.offsetProp]
|
||||
}
|
||||
|
||||
if (typeof adjustment === 'function') {
|
||||
adjustment = adjustment.apply(waypoint)
|
||||
}
|
||||
else if (typeof adjustment === 'string') {
|
||||
adjustment = parseFloat(adjustment)
|
||||
if (waypoint.options.offset.indexOf('%') > - 1) {
|
||||
adjustment = Math.ceil(axis.contextDimension * adjustment / 100)
|
||||
}
|
||||
}
|
||||
|
||||
contextModifier = axis.contextScroll - axis.contextOffset
|
||||
waypoint.triggerPoint = Math.floor(elementOffset + contextModifier - adjustment)
|
||||
wasBeforeScroll = oldTriggerPoint < axis.oldScroll
|
||||
nowAfterScroll = waypoint.triggerPoint >= axis.oldScroll
|
||||
triggeredBackward = wasBeforeScroll && nowAfterScroll
|
||||
triggeredForward = !wasBeforeScroll && !nowAfterScroll
|
||||
|
||||
if (!freshWaypoint && triggeredBackward) {
|
||||
waypoint.queueTrigger(axis.backward)
|
||||
triggeredGroups[waypoint.group.id] = waypoint.group
|
||||
}
|
||||
else if (!freshWaypoint && triggeredForward) {
|
||||
waypoint.queueTrigger(axis.forward)
|
||||
triggeredGroups[waypoint.group.id] = waypoint.group
|
||||
}
|
||||
else if (freshWaypoint && axis.oldScroll >= waypoint.triggerPoint) {
|
||||
waypoint.queueTrigger(axis.forward)
|
||||
triggeredGroups[waypoint.group.id] = waypoint.group
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Waypoint.requestAnimationFrame(function() {
|
||||
for (var groupKey in triggeredGroups) {
|
||||
triggeredGroups[groupKey].flushTriggers()
|
||||
}
|
||||
})
|
||||
|
||||
return this
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Context.findOrCreateByElement = function(element) {
|
||||
return Context.findByElement(element) || new Context(element)
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Context.refreshAll = function() {
|
||||
for (var contextId in contexts) {
|
||||
contexts[contextId].refresh()
|
||||
}
|
||||
}
|
||||
|
||||
/* Public */
|
||||
/* http://imakewebthings.com/waypoints/api/context-find-by-element */
|
||||
Context.findByElement = function(element) {
|
||||
return contexts[element.waypointContextKey]
|
||||
}
|
||||
|
||||
window.onload = function() {
|
||||
if (oldWindowLoad) {
|
||||
oldWindowLoad()
|
||||
}
|
||||
Context.refreshAll()
|
||||
}
|
||||
|
||||
|
||||
Waypoint.requestAnimationFrame = function(callback) {
|
||||
var requestFn = window.requestAnimationFrame ||
|
||||
window.mozRequestAnimationFrame ||
|
||||
window.webkitRequestAnimationFrame ||
|
||||
requestAnimationFrameShim
|
||||
requestFn.call(window, callback)
|
||||
}
|
||||
Waypoint.Context = Context
|
||||
}())
|
||||
;(function() {
|
||||
'use strict'
|
||||
|
||||
function byTriggerPoint(a, b) {
|
||||
return a.triggerPoint - b.triggerPoint
|
||||
}
|
||||
|
||||
function byReverseTriggerPoint(a, b) {
|
||||
return b.triggerPoint - a.triggerPoint
|
||||
}
|
||||
|
||||
var groups = {
|
||||
vertical: {},
|
||||
horizontal: {}
|
||||
}
|
||||
var Waypoint = window.Waypoint
|
||||
|
||||
/* http://imakewebthings.com/waypoints/api/group */
|
||||
function Group(options) {
|
||||
this.name = options.name
|
||||
this.axis = options.axis
|
||||
this.id = this.name + '-' + this.axis
|
||||
this.waypoints = []
|
||||
this.clearTriggerQueues()
|
||||
groups[this.axis][this.name] = this
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Group.prototype.add = function(waypoint) {
|
||||
this.waypoints.push(waypoint)
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Group.prototype.clearTriggerQueues = function() {
|
||||
this.triggerQueues = {
|
||||
up: [],
|
||||
down: [],
|
||||
left: [],
|
||||
right: []
|
||||
}
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Group.prototype.flushTriggers = function() {
|
||||
for (var direction in this.triggerQueues) {
|
||||
var waypoints = this.triggerQueues[direction]
|
||||
var reverse = direction === 'up' || direction === 'left'
|
||||
waypoints.sort(reverse ? byReverseTriggerPoint : byTriggerPoint)
|
||||
for (var i = 0, end = waypoints.length; i < end; i += 1) {
|
||||
var waypoint = waypoints[i]
|
||||
if (waypoint.options.continuous || i === waypoints.length - 1) {
|
||||
waypoint.trigger([direction])
|
||||
}
|
||||
}
|
||||
}
|
||||
this.clearTriggerQueues()
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Group.prototype.next = function(waypoint) {
|
||||
this.waypoints.sort(byTriggerPoint)
|
||||
var index = Waypoint.Adapter.inArray(waypoint, this.waypoints)
|
||||
var isLast = index === this.waypoints.length - 1
|
||||
return isLast ? null : this.waypoints[index + 1]
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Group.prototype.previous = function(waypoint) {
|
||||
this.waypoints.sort(byTriggerPoint)
|
||||
var index = Waypoint.Adapter.inArray(waypoint, this.waypoints)
|
||||
return index ? this.waypoints[index - 1] : null
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Group.prototype.queueTrigger = function(waypoint, direction) {
|
||||
this.triggerQueues[direction].push(waypoint)
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Group.prototype.remove = function(waypoint) {
|
||||
var index = Waypoint.Adapter.inArray(waypoint, this.waypoints)
|
||||
if (index > -1) {
|
||||
this.waypoints.splice(index, 1)
|
||||
}
|
||||
}
|
||||
|
||||
/* Public */
|
||||
/* http://imakewebthings.com/waypoints/api/first */
|
||||
Group.prototype.first = function() {
|
||||
return this.waypoints[0]
|
||||
}
|
||||
|
||||
/* Public */
|
||||
/* http://imakewebthings.com/waypoints/api/last */
|
||||
Group.prototype.last = function() {
|
||||
return this.waypoints[this.waypoints.length - 1]
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Group.findOrCreate = function(options) {
|
||||
return groups[options.axis][options.name] || new Group(options)
|
||||
}
|
||||
|
||||
Waypoint.Group = Group
|
||||
}())
|
||||
;(function() {
|
||||
'use strict'
|
||||
|
||||
var $ = window.jQuery
|
||||
var Waypoint = window.Waypoint
|
||||
|
||||
function JQueryAdapter(element) {
|
||||
this.$element = $(element)
|
||||
}
|
||||
|
||||
$.each([
|
||||
'innerHeight',
|
||||
'innerWidth',
|
||||
'off',
|
||||
'offset',
|
||||
'on',
|
||||
'outerHeight',
|
||||
'outerWidth',
|
||||
'scrollLeft',
|
||||
'scrollTop'
|
||||
], function(i, method) {
|
||||
JQueryAdapter.prototype[method] = function() {
|
||||
var args = Array.prototype.slice.call(arguments)
|
||||
return this.$element[method].apply(this.$element, args)
|
||||
}
|
||||
})
|
||||
|
||||
$.each([
|
||||
'extend',
|
||||
'inArray',
|
||||
'isEmptyObject'
|
||||
], function(i, method) {
|
||||
JQueryAdapter[method] = $[method]
|
||||
})
|
||||
|
||||
Waypoint.adapters.push({
|
||||
name: 'jquery',
|
||||
Adapter: JQueryAdapter
|
||||
})
|
||||
Waypoint.Adapter = JQueryAdapter
|
||||
}())
|
||||
;(function() {
|
||||
'use strict'
|
||||
|
||||
var Waypoint = window.Waypoint
|
||||
|
||||
function createExtension(framework) {
|
||||
return function() {
|
||||
var waypoints = []
|
||||
var overrides = arguments[0]
|
||||
|
||||
if (framework.isFunction(arguments[0])) {
|
||||
overrides = framework.extend({}, arguments[1])
|
||||
overrides.handler = arguments[0]
|
||||
}
|
||||
|
||||
this.each(function() {
|
||||
var options = framework.extend({}, overrides, {
|
||||
element: this
|
||||
})
|
||||
if (typeof options.context === 'string') {
|
||||
options.context = framework(this).closest(options.context)[0]
|
||||
}
|
||||
waypoints.push(new Waypoint(options))
|
||||
})
|
||||
|
||||
return waypoints
|
||||
}
|
||||
}
|
||||
|
||||
if (window.jQuery) {
|
||||
window.jQuery.fn.waypoint = createExtension(window.jQuery)
|
||||
}
|
||||
if (window.Zepto) {
|
||||
window.Zepto.fn.waypoint = createExtension(window.Zepto)
|
||||
}
|
||||
}())
|
||||
;
|
549
template/assets/js/main.js
Normal file
549
template/assets/js/main.js
Normal file
@ -0,0 +1,549 @@
|
||||
/*-----------------------------------------------------------------
|
||||
|
||||
Template Name: Remons - Booking Rental HTML Template<
|
||||
Author: Pixydrops
|
||||
Author URI: https://themeforest.net/user/pixydrops/portfolio
|
||||
Version: 1.0.0
|
||||
Description: Remons - Booking Rental HTML Template<
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Js TABLE OF CONTENTS
|
||||
-------------------------------------------------------------------
|
||||
|
||||
01. header
|
||||
02. animated text with swiper slider
|
||||
03. magnificPopup
|
||||
04. counter up
|
||||
05. wow animation
|
||||
06. nice select
|
||||
07. swiper slider
|
||||
08. search popup
|
||||
09. preloader
|
||||
10. Gsap
|
||||
|
||||
------------------------------------------------------------------*/
|
||||
|
||||
(function($) {
|
||||
"use strict";
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
//>> Mobile Menu Js Start <<//
|
||||
$('#mobile-menu').meanmenu({
|
||||
meanMenuContainer: '.mobile-menu',
|
||||
meanScreenWidth: "1199",
|
||||
meanExpand: ['<i class="far fa-plus"></i>'],
|
||||
});
|
||||
|
||||
//>> Sidebar Toggle Js Start <<//
|
||||
$(".offcanvas__close,.offcanvas__overlay").on("click", function() {
|
||||
$(".offcanvas__info").removeClass("info-open");
|
||||
$(".offcanvas__overlay").removeClass("overlay-open");
|
||||
});
|
||||
$(".sidebar__toggle").on("click", function() {
|
||||
$(".offcanvas__info").addClass("info-open");
|
||||
$(".offcanvas__overlay").addClass("overlay-open");
|
||||
});
|
||||
|
||||
//>> Body Overlay Js Start <<//
|
||||
$(".body-overlay").on("click", function() {
|
||||
$(".offcanvas__area").removeClass("offcanvas-opened");
|
||||
$(".df-search-area").removeClass("opened");;
|
||||
$(".body-overlay").removeClass("opened");
|
||||
});
|
||||
|
||||
//>> Sticky Header Js Start <<//
|
||||
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 250) {
|
||||
$("#header-sticky").addClass("sticky");
|
||||
} else {
|
||||
$("#header-sticky").removeClass("sticky");
|
||||
}
|
||||
});
|
||||
|
||||
//>> Hero Slider 1 Start <<//
|
||||
const sliderActive2 = ".hero-slider";
|
||||
const sliderInit2 = new Swiper(sliderActive2, {
|
||||
loop: true,
|
||||
slidesPerView: 1,
|
||||
effect: "fade",
|
||||
speed: 3000,
|
||||
autoplay: {
|
||||
delay: 6000,
|
||||
disableOnInteraction: false,
|
||||
},
|
||||
navigation: {
|
||||
nextEl: ".image-array-left",
|
||||
prevEl: ".image-array-right",
|
||||
},
|
||||
});
|
||||
|
||||
function animated_swiper(selector, init) {
|
||||
const animated = function animated() {
|
||||
$(selector + " [data-animation]").each(function () {
|
||||
let anim = $(this).data("animation");
|
||||
let delay = $(this).data("delay");
|
||||
let duration = $(this).data("duration");
|
||||
$(this)
|
||||
.removeClass("anim" + anim)
|
||||
.addClass(anim + " animated")
|
||||
.css({
|
||||
webkitAnimationDelay: delay,
|
||||
animationDelay: delay,
|
||||
webkitAnimationDuration: duration,
|
||||
animationDuration: duration,
|
||||
})
|
||||
.one("animationend", function () {
|
||||
$(this).removeClass(anim + " animated");
|
||||
});
|
||||
});
|
||||
};
|
||||
animated();
|
||||
init.on("slideChange", function () {
|
||||
$(sliderActive2 + " [data-animation]").removeClass("animated");
|
||||
});
|
||||
init.on("slideChange", animated);
|
||||
}
|
||||
animated_swiper(sliderActive2, sliderInit2);
|
||||
|
||||
//>> Hero Slider 2 Start <<//
|
||||
const sliderActive1 = ".hero-slider-2";
|
||||
const sliderInit1 = new Swiper(sliderActive1, {
|
||||
loop: true,
|
||||
slidesPerView: 1,
|
||||
effect: "fade",
|
||||
speed: 2000,
|
||||
autoplay: {
|
||||
delay: 5000,
|
||||
disableOnInteraction: false,
|
||||
},
|
||||
navigation: {
|
||||
nextEl: ".image-array-left",
|
||||
prevEl: ".image-array-right",
|
||||
},
|
||||
|
||||
});
|
||||
// content animation when active start here
|
||||
function animated_swiper(selector, init) {
|
||||
let animated = function animated() {
|
||||
$(selector + " [data-animation]").each(function () {
|
||||
let anim = $(this).data("animation");
|
||||
let delay = $(this).data("delay");
|
||||
let duration = $(this).data("duration");
|
||||
$(this)
|
||||
.removeClass("anim" + anim)
|
||||
.addClass(anim + " animated")
|
||||
.css({
|
||||
webkitAnimationDelay: delay,
|
||||
animationDelay: delay,
|
||||
webkitAnimationDuration: duration,
|
||||
animationDuration: duration,
|
||||
})
|
||||
.one("animationend", function () {
|
||||
$(this).removeClass(anim + " animated");
|
||||
});
|
||||
});
|
||||
};
|
||||
animated();
|
||||
init.on("slideChange", function () {
|
||||
$(sliderActive1 + " [data-animation]").removeClass("animated");
|
||||
});
|
||||
init.on("slideChange", animated);
|
||||
}
|
||||
animated_swiper(sliderActive1, sliderInit1);
|
||||
//>> Hero Slider End <<//
|
||||
|
||||
//>> Hero Slider 1 Start <<//
|
||||
const sliderActive3 = ".hero-slider-3";
|
||||
const sliderInit3 = new Swiper(sliderActive3, {
|
||||
loop: true,
|
||||
slidesPerView: 1,
|
||||
effect: "fade",
|
||||
speed: 3000,
|
||||
autoplay: {
|
||||
delay: 5000,
|
||||
disableOnInteraction: false,
|
||||
},
|
||||
navigation: {
|
||||
nextEl: ".image-array-left",
|
||||
prevEl: ".image-array-right",
|
||||
},
|
||||
});
|
||||
|
||||
function animated_swiper(selector, init) {
|
||||
const animated = function animated() {
|
||||
$(selector + " [data-animation]").each(function () {
|
||||
let anim = $(this).data("animation");
|
||||
let delay = $(this).data("delay");
|
||||
let duration = $(this).data("duration");
|
||||
$(this)
|
||||
.removeClass("anim" + anim)
|
||||
.addClass(anim + " animated")
|
||||
.css({
|
||||
webkitAnimationDelay: delay,
|
||||
animationDelay: delay,
|
||||
webkitAnimationDuration: duration,
|
||||
animationDuration: duration,
|
||||
})
|
||||
.one("animationend", function () {
|
||||
$(this).removeClass(anim + " animated");
|
||||
});
|
||||
});
|
||||
};
|
||||
animated();
|
||||
init.on("slideChange", function () {
|
||||
$(sliderActive3 + " [data-animation]").removeClass("animated");
|
||||
});
|
||||
init.on("slideChange", animated);
|
||||
}
|
||||
animated_swiper(sliderActive3, sliderInit3);
|
||||
|
||||
//>> Video Popup Start <<//
|
||||
$(".img-popup").magnificPopup({
|
||||
type: "image",
|
||||
gallery: {
|
||||
enabled: true,
|
||||
},
|
||||
});
|
||||
|
||||
$(".img-popup-2").magnificPopup({
|
||||
type: "image",
|
||||
gallery: {
|
||||
enabled: true,
|
||||
},
|
||||
});
|
||||
|
||||
$('.video-popup').magnificPopup({
|
||||
type: 'iframe',
|
||||
callbacks: {
|
||||
}
|
||||
});
|
||||
|
||||
//>> Counterup Start <<//
|
||||
$(".count").counterUp({
|
||||
delay: 15,
|
||||
time: 4000,
|
||||
});
|
||||
|
||||
//>> Wow Animation Start <<//
|
||||
new WOW().init();
|
||||
|
||||
//>> Nice Select Start <<//
|
||||
$('select').niceSelect();
|
||||
|
||||
//>> Car Rentals Slider Start <<//
|
||||
if($('.car-rentals-slider').length > 0) {
|
||||
const carRentalsSlider = new Swiper(".car-rentals-slider", {
|
||||
spaceBetween: 30,
|
||||
speed: 1000,
|
||||
loop: true,
|
||||
|
||||
navigation: {
|
||||
nextEl: ".array-prev",
|
||||
prevEl: ".array-next",
|
||||
},
|
||||
breakpoints: {
|
||||
1599: {
|
||||
slidesPerView: 4,
|
||||
},
|
||||
1199: {
|
||||
slidesPerView: 3,
|
||||
},
|
||||
991: {
|
||||
slidesPerView: 2,
|
||||
},
|
||||
767: {
|
||||
slidesPerView: 2,
|
||||
},
|
||||
575: {
|
||||
slidesPerView: 1,
|
||||
},
|
||||
0: {
|
||||
slidesPerView: 1,
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
if($('.car-rentals-slider-2').length > 0) {
|
||||
const carRentalsSlider2 = new Swiper(".car-rentals-slider-2", {
|
||||
spaceBetween: 30,
|
||||
speed: 1000,
|
||||
loop: true,
|
||||
navigation: {
|
||||
nextEl: ".array-prev",
|
||||
prevEl: ".array-next",
|
||||
},
|
||||
breakpoints: {
|
||||
1199: {
|
||||
slidesPerView: 3,
|
||||
},
|
||||
991: {
|
||||
slidesPerView: 2,
|
||||
},
|
||||
767: {
|
||||
slidesPerView: 2,
|
||||
},
|
||||
575: {
|
||||
slidesPerView: 1,
|
||||
},
|
||||
0: {
|
||||
slidesPerView: 1,
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
//>> Brand Rentals Slider Start <<//
|
||||
if($('.brand-slider').length > 0) {
|
||||
const brandSlider = new Swiper(".brand-slider", {
|
||||
spaceBetween: 30,
|
||||
speed: 2000,
|
||||
loop: true,
|
||||
autoplay: {
|
||||
delay: 2000,
|
||||
disableOnInteraction: false,
|
||||
},
|
||||
navigation: {
|
||||
nextEl: ".array-prev-2",
|
||||
prevEl: ".array-next-2",
|
||||
},
|
||||
breakpoints: {
|
||||
1399: {
|
||||
slidesPerView: 6,
|
||||
},
|
||||
1199: {
|
||||
slidesPerView: 5,
|
||||
},
|
||||
991: {
|
||||
slidesPerView: 4,
|
||||
},
|
||||
767: {
|
||||
slidesPerView: 3,
|
||||
},
|
||||
575: {
|
||||
slidesPerView: 1,
|
||||
},
|
||||
0: {
|
||||
slidesPerView: 1,
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
//>> Testimonial Slider Start <<//
|
||||
if($('.testimonial-slider').length > 0) {
|
||||
const testimonialSlider = new Swiper(".testimonial-slider", {
|
||||
spaceBetween: 30,
|
||||
speed: 2000,
|
||||
loop: true,
|
||||
autoplay: {
|
||||
delay: 2000,
|
||||
disableOnInteraction: false,
|
||||
},
|
||||
pagination: {
|
||||
el: ".dot",
|
||||
clickable: true,
|
||||
},
|
||||
breakpoints: {
|
||||
1199: {
|
||||
slidesPerView: 3,
|
||||
},
|
||||
991: {
|
||||
slidesPerView: 2,
|
||||
},
|
||||
767: {
|
||||
slidesPerView: 2,
|
||||
},
|
||||
575: {
|
||||
slidesPerView: 1,
|
||||
},
|
||||
0: {
|
||||
slidesPerView: 1,
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
if($('.testimonial-slider-2').length > 0) {
|
||||
const testimonialSlider2 = new Swiper(".testimonial-slider-2", {
|
||||
spaceBetween: 30,
|
||||
speed: 2000,
|
||||
loop: true,
|
||||
autoplay: {
|
||||
delay: 2000,
|
||||
disableOnInteraction: false,
|
||||
},
|
||||
navigation: {
|
||||
nextEl: ".array-prev",
|
||||
prevEl: ".array-next",
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
if($('.testimonial-slider-3').length > 0) {
|
||||
const testimonialSlider3 = new Swiper(".testimonial-slider-3", {
|
||||
spaceBetween: 30,
|
||||
speed: 2000,
|
||||
loop: true,
|
||||
autoplay: {
|
||||
delay: 2000,
|
||||
disableOnInteraction: false,
|
||||
},
|
||||
|
||||
navigation: {
|
||||
nextEl: ".array-prev",
|
||||
prevEl: ".array-next",
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
//>> Car Slider Slider Start <<//
|
||||
if($('.car-slider').length > 0) {
|
||||
const carSlider = new Swiper(".car-slider", {
|
||||
spaceBetween: 20,
|
||||
speed: 2000,
|
||||
loop: true,
|
||||
autoplay: {
|
||||
delay: 1000,
|
||||
disableOnInteraction: false,
|
||||
},
|
||||
breakpoints: {
|
||||
1399: {
|
||||
slidesPerView: 6,
|
||||
},
|
||||
1199: {
|
||||
slidesPerView: 5,
|
||||
},
|
||||
991: {
|
||||
slidesPerView: 4,
|
||||
},
|
||||
767: {
|
||||
slidesPerView: 3,
|
||||
},
|
||||
575: {
|
||||
slidesPerView: 1,
|
||||
},
|
||||
0: {
|
||||
slidesPerView: 1,
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
//>> Scroll Js Start <<//
|
||||
const scrollPath = document.querySelector(".scroll-up path");
|
||||
const pathLength = scrollPath.getTotalLength();
|
||||
scrollPath.style.transition = scrollPath.style.WebkitTransition = "none";
|
||||
scrollPath.style.strokeDasharray = pathLength + " " + pathLength;
|
||||
scrollPath.style.strokeDashoffset = pathLength;
|
||||
scrollPath.getBoundingClientRect();
|
||||
scrollPath.style.transition = scrollPath.style.WebkitTransition = "stroke-dashoffset 10ms linear";
|
||||
|
||||
const updatescroll = function() {
|
||||
let scrolltotal = $(window).scrollTop();
|
||||
let height = $(document).height() - $(window).height();
|
||||
let scrolltotalheight = pathLength - (scrolltotal * pathLength) / height;
|
||||
scrollPath.style.strokeDashoffset = scrolltotalheight;
|
||||
};
|
||||
updatescroll();
|
||||
|
||||
$(window).scroll(updatescroll);
|
||||
const offset = 50;
|
||||
const duration = 950;
|
||||
|
||||
$(window).on("scroll", function() {
|
||||
if (jQuery(this).scrollTop() > offset) {
|
||||
jQuery(".scroll-up").addClass("active-scroll");
|
||||
} else {
|
||||
jQuery(".scroll-up").removeClass("active-scroll");
|
||||
}
|
||||
});
|
||||
|
||||
$(".scroll-up").on("click", function(event) {
|
||||
event.preventDefault();
|
||||
jQuery("html, body").animate({
|
||||
scrollTop: 0,
|
||||
},
|
||||
duration
|
||||
);
|
||||
return false;
|
||||
});
|
||||
|
||||
//>> Search Popup Start <<//
|
||||
const $searchWrap = $(".search-wrap");
|
||||
const $navSearch = $(".nav-search");
|
||||
const $searchClose = $("#search-close");
|
||||
|
||||
$(".search-trigger").on("click", function (e) {
|
||||
e.preventDefault();
|
||||
$searchWrap.animate({ opacity: "toggle" }, 500);
|
||||
$navSearch.add($searchClose).addClass("open");
|
||||
});
|
||||
|
||||
$(".search-close").on("click", function (e) {
|
||||
e.preventDefault();
|
||||
$searchWrap.animate({ opacity: "toggle" }, 500);
|
||||
$navSearch.add($searchClose).removeClass("open");
|
||||
});
|
||||
|
||||
function closeSearch() {
|
||||
$searchWrap.fadeOut(200);
|
||||
$navSearch.add($searchClose).removeClass("open");
|
||||
}
|
||||
|
||||
$(document.body).on("click", function (e) {
|
||||
closeSearch();
|
||||
});
|
||||
|
||||
$(".search-trigger, .main-search-input").on("click", function (e) {
|
||||
e.stopPropagation();
|
||||
});
|
||||
|
||||
//>> Gsap Start <<//
|
||||
|
||||
if($('.car-sale-wrapper').length > 0) {
|
||||
const car = gsap.timeline({
|
||||
scrollTrigger: {
|
||||
trigger: ".car-sale-wrapper",
|
||||
scrub: 1,
|
||||
end: "+=1000",
|
||||
}
|
||||
});
|
||||
car.to(".car-shape", {xPercent: 20, ease: "none",});
|
||||
}
|
||||
|
||||
if($('.cta-car-booking-items').length > 0) {
|
||||
const car = gsap.timeline({
|
||||
scrollTrigger: {
|
||||
trigger: ".cta-car-booking-items",
|
||||
scrub: 1,
|
||||
end: "+=1000",
|
||||
}
|
||||
});
|
||||
car.to(".car-image", {xPercent: -20, ease: "none",});
|
||||
}
|
||||
|
||||
$(function() {
|
||||
$("#datepicker, #datepicker2, #datepicker3, #datepicker4, #datepicker5, #datepicker6, #datepicker7, #datepicker8, #datepicker9, #datepicker10, #datepicker11").datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true
|
||||
});
|
||||
});
|
||||
|
||||
}); // End Document Ready Function
|
||||
|
||||
function loader() {
|
||||
$(window).on('load', function() {
|
||||
// Animate loader off screen
|
||||
$(".preloader").addClass('loaded');
|
||||
$(".preloader").delay(600).fadeOut();
|
||||
});
|
||||
}
|
||||
|
||||
loader();
|
||||
|
||||
|
||||
})(jQuery); // End jQuery
|
||||
|
14
template/assets/js/swiper-bundle.min.js
vendored
Normal file
14
template/assets/js/swiper-bundle.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
71
template/assets/js/viewport.jquery.js
Normal file
71
template/assets/js/viewport.jquery.js
Normal file
@ -0,0 +1,71 @@
|
||||
/* ====================================================
|
||||
* jQuery Is In Viewport.
|
||||
* https://github.com/frontid/jQueryIsInViewport
|
||||
* Marcelo Iván Tosco (capynet)
|
||||
* Inspired on https://stackoverflow.com/a/40658647/1413049
|
||||
* ==================================================== */
|
||||
!function ($) {
|
||||
'use strict'
|
||||
|
||||
var Class = function (el, cb) {
|
||||
this.$el = $(el);
|
||||
this.cb = cb;
|
||||
this.watch();
|
||||
return this;
|
||||
};
|
||||
|
||||
Class.prototype = {
|
||||
|
||||
/**
|
||||
* Checks if the element is in.
|
||||
*
|
||||
* @returns {boolean}
|
||||
*/
|
||||
isIn: function isIn() {
|
||||
var _self = this;
|
||||
var $win = $(window);
|
||||
var elementTop = _self.$el.offset().top;
|
||||
var elementBottom = elementTop + _self.$el.outerHeight();
|
||||
var viewportTop = $win.scrollTop();
|
||||
var viewportBottom = viewportTop + $win.height();
|
||||
return elementBottom > viewportTop && elementTop < viewportBottom;
|
||||
},
|
||||
|
||||
/**
|
||||
* Launch a callback indicating when the element is in and when is out.
|
||||
*/
|
||||
watch: function () {
|
||||
var _self = this;
|
||||
var _isIn = false;
|
||||
|
||||
$(window).on('resize scroll', function () {
|
||||
|
||||
if (_self.isIn() && _isIn === false) {
|
||||
_self.cb.call(_self.$el, 'entered');
|
||||
_isIn = true;
|
||||
}
|
||||
|
||||
if (_isIn === true && !_self.isIn()) {
|
||||
_self.cb.call(_self.$el, 'leaved');
|
||||
_isIn = false;
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
// jQuery plugin.
|
||||
//-----------------------------------------------------------
|
||||
$.fn.isInViewport = function (cb) {
|
||||
return this.each(function () {
|
||||
var $element = $(this);
|
||||
var data = $element.data('isInViewport');
|
||||
if (!data) {
|
||||
$element.data('isInViewport', (new Class(this, cb)));
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}(window.jQuery);
|
3
template/assets/js/wow.min.js
vendored
Normal file
3
template/assets/js/wow.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user