forked from UKSOURCE/hailearning.edu.vn
Initial commit
This commit is contained in:
10
public/assets/js/ScrollTrigger.min.js
vendored
Normal file
10
public/assets/js/ScrollTrigger.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
11
public/assets/js/SplitText.min.js
vendored
Normal file
11
public/assets/js/SplitText.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
48
public/assets/js/ajax-mail.js
Normal file
48
public/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.');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
7
public/assets/js/bootstrap.bundle.min.js
vendored
Normal file
7
public/assets/js/bootstrap.bundle.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
215
public/assets/js/circle-progress.js
Normal file
215
public/assets/js/circle-progress.js
Normal file
@@ -0,0 +1,215 @@
|
||||
/*
|
||||
* jquery-circle-progress - jQuery Plugin to draw animated circular progress bars
|
||||
*
|
||||
* @author https://github.com/kottenator
|
||||
* @version 0.6.0
|
||||
*/
|
||||
|
||||
$.circleProgress = {
|
||||
// Default options (you may override them)
|
||||
defaults: {
|
||||
/**
|
||||
* This is the only required option. It should be from 0.0 to 1.0
|
||||
* @type {float}
|
||||
*/
|
||||
value: 0,
|
||||
|
||||
/**
|
||||
* Size of the circle / canvas in pixels
|
||||
* @type {int}
|
||||
*/
|
||||
size: 100,
|
||||
|
||||
/**
|
||||
* Initial angle for 0.0 value in radians
|
||||
* @type {float}
|
||||
*/
|
||||
startAngle: -Math.PI,
|
||||
|
||||
/**
|
||||
* Width of the arc. By default it's calculated as 1/14 of size, but you may set it explicitly in pixels
|
||||
* type {int|'auto'}
|
||||
*/
|
||||
thickness: 'auto',
|
||||
|
||||
/**
|
||||
* Fill of the arc. You may set it to:
|
||||
* - solid color:
|
||||
* - { color: '#3aeabb' }
|
||||
* - { color: 'rgba(255, 255, 255, .3)' }
|
||||
* - linear gradient (left to right):
|
||||
* - { gradient: ['#3aeabb', '#fdd250'] }
|
||||
* - { gradient: ['red', 'green', 'blue'] }
|
||||
* - image:
|
||||
* - { image: 'http://i.imgur.com/pT0i89v.png' }
|
||||
* - { color: 'lime', image: 'http://i.imgur.com/pT0i89v.png' } - color displayed until the image is loaded
|
||||
*/
|
||||
fill: {
|
||||
gradient: ['#3aeabb', '#fdd250']
|
||||
},
|
||||
|
||||
/**
|
||||
* Color of the "empty" arc. Only a color fill supported by now
|
||||
* @type {string}
|
||||
*/
|
||||
emptyFill: 'rgba(0, 0, 0, .1)',
|
||||
|
||||
/**
|
||||
* Animation config (see jQuery animations: http://api.jquery.com/animate/)
|
||||
*/
|
||||
animation: {
|
||||
duration: 1200,
|
||||
easing: 'circleProgressEasing'
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Renamed ease-in-out-cubic
|
||||
$.easing.circleProgressEasing = function(x, t, b, c, d) {
|
||||
if ((t /= d / 2) < 1)
|
||||
return c / 2 * t * t * t + b;
|
||||
return c / 2 * ((t -= 2) * t * t + 2) + b;
|
||||
};
|
||||
|
||||
/**
|
||||
* Draw animated circular progress bar.
|
||||
*
|
||||
* Appends <canvas> to the element or updates already appended one.
|
||||
*
|
||||
* If animated, throws 3 events:
|
||||
*
|
||||
* - circle-animation-start(jqEvent)
|
||||
* - circle-animation-progress(jqEvent, animationProgress, stepValue) - multiple event;
|
||||
* animationProgress: from 0.0 to 1.0;
|
||||
* stepValue: from 0.0 to value
|
||||
* - circle-animation-end(jqEvent)
|
||||
*
|
||||
* @param options Example: { value: 0.75, size: 50, animation: false };
|
||||
* you may set any of default options (see above);
|
||||
* `animation` may be set to false;
|
||||
* you may also use .circleProgress('widget') to get the canvas
|
||||
*/
|
||||
$.fn.circleProgress = function(options) {
|
||||
if (options == 'widget')
|
||||
return this.data('circle-progress');
|
||||
|
||||
options = $.extend({}, $.circleProgress.defaults, options);
|
||||
|
||||
return this.each(function() {
|
||||
var el = $(this),
|
||||
size = options.size,
|
||||
radius = size / 2,
|
||||
thickness = size / 14,
|
||||
value = options.value,
|
||||
startAngle = options.startAngle,
|
||||
emptyArcFill = options.emptyFill,
|
||||
arcFill;
|
||||
|
||||
if ($.isNumeric(options.thickness))
|
||||
thickness = options.thickness;
|
||||
|
||||
// Prepare canvas
|
||||
var canvas = el.data('circle-progress');
|
||||
|
||||
if (!canvas) {
|
||||
canvas = $('<canvas>').prependTo(el)[0];
|
||||
el.data('circle-progress', canvas);
|
||||
}
|
||||
|
||||
canvas.width = size;
|
||||
canvas.height = size;
|
||||
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
if (!options.fill)
|
||||
throw Error("The fill is not specified!");
|
||||
|
||||
if (options.fill.color)
|
||||
arcFill = options.fill.color;
|
||||
|
||||
if (options.fill.gradient) {
|
||||
var gr = options.fill.gradient;
|
||||
if (gr.length == 1) {
|
||||
arcFill = gr[0];
|
||||
} else if (gr.length > 1) {
|
||||
var lg = ctx.createLinearGradient(0, 0, size, 0);
|
||||
for (var i = 0; i < gr.length; i++)
|
||||
lg.addColorStop(i / (gr.length - 1), gr[i]);
|
||||
arcFill = lg;
|
||||
}
|
||||
}
|
||||
|
||||
if (options.fill.image) {
|
||||
var img = new Image();
|
||||
img.src = options.fill.image;
|
||||
img.onload = function() {
|
||||
var bg = $('<canvas>')[0];
|
||||
bg.width = size;
|
||||
bg.height = size;
|
||||
bg.getContext('2d').drawImage(img, 0, 0, size, size);
|
||||
arcFill = ctx.createPattern(bg, 'no-repeat');
|
||||
|
||||
// we need to redraw static value
|
||||
if (!options.animation)
|
||||
draw(value);
|
||||
}
|
||||
}
|
||||
|
||||
if (options.animation)
|
||||
drawAnimated(value);
|
||||
else
|
||||
draw(value);
|
||||
|
||||
function draw(v) {
|
||||
ctx.clearRect(0, 0, size, size);
|
||||
drawArc(v);
|
||||
drawEmptyArc(v);
|
||||
}
|
||||
|
||||
function drawArc(v) {
|
||||
ctx.save();
|
||||
ctx.beginPath();
|
||||
ctx.arc(radius, radius, radius - thickness / 2, startAngle, startAngle + Math.PI * 2 * v);
|
||||
ctx.lineWidth = thickness;
|
||||
ctx.strokeStyle = arcFill;
|
||||
ctx.stroke();
|
||||
ctx.restore();
|
||||
}
|
||||
|
||||
function drawEmptyArc(v) {
|
||||
ctx.save();
|
||||
if (v < 1) {
|
||||
ctx.beginPath();
|
||||
if (v <= 0)
|
||||
ctx.arc(radius, radius, radius - thickness / 2, 0, Math.PI * 2);
|
||||
else
|
||||
ctx.arc(radius, radius, radius - thickness / 2, startAngle + Math.PI * 2 * v, startAngle);
|
||||
ctx.lineWidth = thickness;
|
||||
ctx.strokeStyle = emptyArcFill;
|
||||
ctx.stroke();
|
||||
}
|
||||
ctx.restore();
|
||||
}
|
||||
|
||||
function drawAnimated(v) {
|
||||
el.trigger('circle-animation-start');
|
||||
|
||||
$(canvas).css({
|
||||
progress: 0
|
||||
}).animate({
|
||||
progress: v
|
||||
},
|
||||
$.extend({}, options.animation, {
|
||||
step: function(p) {
|
||||
draw(p);
|
||||
el.trigger('circle-animation-progress', [p / v, p]);
|
||||
},
|
||||
|
||||
complete: function() {
|
||||
el.trigger('circle-animation-end');
|
||||
}
|
||||
})
|
||||
);
|
||||
}
|
||||
});
|
||||
};
|
||||
48
public/assets/js/countdowncustom.js
Normal file
48
public/assets/js/countdowncustom.js
Normal file
@@ -0,0 +1,48 @@
|
||||
// Set the date we're counting down to
|
||||
(function () {
|
||||
const second = 1000,
|
||||
minute = second * 60,
|
||||
hour = minute * 60,
|
||||
day = hour * 24;
|
||||
let today = new Date(),
|
||||
dd = String(today.getDate()).padStart(2, "0"),
|
||||
mm = String(today.getMonth() + 1).padStart(2, "0"),
|
||||
yyyy = today.getFullYear(),
|
||||
nextYear = yyyy + 1,
|
||||
dayMonth = "10/20/",
|
||||
birthday = dayMonth + yyyy;
|
||||
|
||||
today = mm + "/" + dd + "/" + yyyy;
|
||||
if (today > birthday) {
|
||||
birthday = dayMonth + nextYear;
|
||||
}
|
||||
//end
|
||||
|
||||
const countDown = new Date(birthday).getTime(),
|
||||
x = setInterval(function () {
|
||||
const now = new Date().getTime(),
|
||||
distance = countDown - now;
|
||||
|
||||
(document.getElementById("day").innerText = Math.floor(
|
||||
distance / day
|
||||
)),
|
||||
(document.getElementById("Hours").innerText = Math.floor(
|
||||
(distance % day) / hour
|
||||
)),
|
||||
(document.getElementById("Minutes").innerText = Math.floor(
|
||||
(distance % hour) / minute
|
||||
)),
|
||||
(document.getElementById("Seconds").innerText = Math.floor(
|
||||
(distance % minute) / second
|
||||
));
|
||||
|
||||
//do something later when date is reached
|
||||
if (distance < 0) {
|
||||
document.getElementById("headline").innerText = "It's my birthday!";
|
||||
document.getElementById("countdown").style.display = "none";
|
||||
document.getElementById("content").style.display = "block";
|
||||
clearInterval(x);
|
||||
}
|
||||
//seconds
|
||||
}, 0);
|
||||
})();
|
||||
10
public/assets/js/gsap.js
Normal file
10
public/assets/js/gsap.js
Normal file
File diff suppressed because one or more lines are too long
2
public/assets/js/jquery-3.7.1.min.js
vendored
Normal file
2
public/assets/js/jquery-3.7.1.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
public/assets/js/jquery.counterup.min.js
vendored
Normal file
1
public/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
public/assets/js/jquery.magnific-popup.min.js
vendored
Normal file
4
public/assets/js/jquery.magnific-popup.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
90
public/assets/js/jquery.meanmenu.min.js
vendored
Normal file
90
public/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
public/assets/js/jquery.nice-select.min.js
vendored
Normal file
4
public/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
public/assets/js/jquery.waypoints.js
Normal file
662
public/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)
|
||||
}
|
||||
}())
|
||||
;
|
||||
1
public/assets/js/lenis.min.js
vendored
Normal file
1
public/assets/js/lenis.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
793
public/assets/js/main.js
Normal file
793
public/assets/js/main.js
Normal file
@@ -0,0 +1,793 @@
|
||||
(function($) {
|
||||
"use strict";
|
||||
|
||||
const $documentOn = $(document);
|
||||
const $windowOn = $(window);
|
||||
|
||||
$documentOn.ready( function() {
|
||||
|
||||
//>> Mobile Menu Js Start <<//
|
||||
$('#mobile-menu').meanmenu({
|
||||
meanMenuContainer: '.mobile-menu',
|
||||
meanScreenWidth: "1199",
|
||||
meanExpand: ['<i class="far fa-plus"></i>'],
|
||||
});
|
||||
|
||||
$('#mobile-menus').meanmenu({
|
||||
meanMenuContainer: '.mobile-menus',
|
||||
meanScreenWidth: "1920",
|
||||
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");
|
||||
});
|
||||
|
||||
|
||||
/* ================================
|
||||
Back To Top Button Js Start
|
||||
================================ */
|
||||
|
||||
// Function to toggle back-to-top button visibility
|
||||
function toggleBackTop() {
|
||||
if ($(window).scrollTop() + $(window).height() >= $(document).height()) {
|
||||
$("#back-top").addClass("show");
|
||||
} else {
|
||||
$("#back-top").removeClass("show");
|
||||
}
|
||||
}
|
||||
|
||||
// On scroll
|
||||
$windowOn.on('scroll', function() {
|
||||
toggleBackTop();
|
||||
});
|
||||
|
||||
// On document ready, force hide the button
|
||||
$(document).ready(function() {
|
||||
$("#back-top").removeClass("show");
|
||||
});
|
||||
|
||||
// On click
|
||||
$documentOn.on('click', '#back-top', function() {
|
||||
$('html, body').animate({ scrollTop: 0 }, 800);
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
//>> Sticky Header Js Start <<//
|
||||
|
||||
$windowOn.on("scroll", function () {
|
||||
if ($(this).scrollTop() > 250) {
|
||||
$("#header-sticky").addClass("sticky");
|
||||
} else {
|
||||
$("#header-sticky").removeClass("sticky");
|
||||
}
|
||||
});
|
||||
|
||||
//>> Video Popup Start <<//
|
||||
$(".img-popup").magnificPopup({
|
||||
type: "image",
|
||||
gallery: {
|
||||
enabled: true,
|
||||
},
|
||||
});
|
||||
|
||||
$(".img-popup2").magnificPopup({
|
||||
type: "image",
|
||||
gallery: {
|
||||
enabled: true,
|
||||
},
|
||||
});
|
||||
|
||||
$(".video-popup").magnificPopup({
|
||||
type: "iframe",
|
||||
callbacks: {},
|
||||
});
|
||||
|
||||
|
||||
//>> Wow Animation Start <<//
|
||||
new WOW().init();
|
||||
|
||||
//>> Nice Select Start <<//
|
||||
$('select').niceSelect();
|
||||
|
||||
// circle-progress
|
||||
if ($(".circle-bar").length) {
|
||||
$(".circle-bar").each(function () {
|
||||
let $this = $(this);
|
||||
let value = $this.data("percent") || 0.99;
|
||||
|
||||
$this.circleProgress({
|
||||
value: value,
|
||||
size: 150,
|
||||
thickness: 10,
|
||||
fill: { color: "#fff" },
|
||||
emptyFill: "rgba(255,255,255,0.2)"
|
||||
}).on("circle-animation-progress", function (event, progress, stepValue) {
|
||||
$(this).find("strong").html(Math.round(stepValue * 100) + "%");
|
||||
});
|
||||
|
||||
$this.append("<strong></strong>");
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
//>> Hero Slider Start <<//
|
||||
var swiper = new Swiper(".hero-slider", {
|
||||
loop: true,
|
||||
autoplay: {
|
||||
delay: 4000,
|
||||
disableOnInteraction: false,
|
||||
},
|
||||
speed: 800,
|
||||
effect: "slide", // left theke asbe
|
||||
navigation: {
|
||||
nextEl: ".swiper-button-next",
|
||||
prevEl: ".swiper-button-prev",
|
||||
},
|
||||
pagination: {
|
||||
el: ".dot-number",
|
||||
clickable: true,
|
||||
renderBullet: function(index, className) {
|
||||
const dotContent = document.querySelectorAll(
|
||||
".dot-number .dot-num"
|
||||
);
|
||||
return `
|
||||
<span class="${className}">
|
||||
${dotContent[index]?.outerHTML || ""}
|
||||
</span>
|
||||
`;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
//>> Image Slider Start <<//
|
||||
var swiper = new Swiper(".image-slider", {
|
||||
loop: true,
|
||||
autoplay: {
|
||||
delay: 4000,
|
||||
disableOnInteraction: false,
|
||||
},
|
||||
pagination: {
|
||||
el: ".dot-number",
|
||||
clickable: true,
|
||||
renderBullet: function(index, className) {
|
||||
const dotContent = document.querySelectorAll(
|
||||
".dot-number .dot-num"
|
||||
);
|
||||
return `
|
||||
<span class="${className}">
|
||||
${dotContent[index]?.outerHTML || ""}
|
||||
</span>
|
||||
`;
|
||||
},
|
||||
},
|
||||
speed: 800,
|
||||
effect: "slide",
|
||||
on: {
|
||||
slideChangeTransitionStart: function () {
|
||||
document.querySelectorAll('.hero-image img').forEach(img => {
|
||||
img.classList.remove('animate__fadeInUp');
|
||||
});
|
||||
},
|
||||
slideChangeTransitionEnd: function () {
|
||||
let activeImg = document.querySelector('.swiper-slide-active .hero-image img');
|
||||
if(activeImg){
|
||||
activeImg.classList.add('animate__animated', 'animate__fadeInUp');
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//>>Testimonial Slider Start <<//
|
||||
if($('.testimonial-slider').length > 0) {
|
||||
const TestimonialSlider = new Swiper(".testimonial-slider", {
|
||||
spaceBetween: 30,
|
||||
speed: 1300,
|
||||
loop: true,
|
||||
autoplay: {
|
||||
delay: 2000,
|
||||
disableOnInteraction: false,
|
||||
},
|
||||
breakpoints: {
|
||||
1199: {
|
||||
slidesPerView: 2,
|
||||
},
|
||||
991: {
|
||||
slidesPerView: 2,
|
||||
},
|
||||
767: {
|
||||
slidesPerView: 1,
|
||||
},
|
||||
575: {
|
||||
slidesPerView: 1,
|
||||
},
|
||||
0: {
|
||||
slidesPerView: 1,
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
// Create mask divs for each wrapper
|
||||
|
||||
document.querySelectorAll(".tp-clip-anim").forEach(wrapper => {
|
||||
const img = wrapper.querySelector(".tp-anim-img[data-animate='true']");
|
||||
if (!img) return;
|
||||
const url = img.src;
|
||||
|
||||
// ensure wrapper position relative
|
||||
wrapper.style.position = "relative";
|
||||
|
||||
// IntersectionObserver
|
||||
const observer = new IntersectionObserver((entries, obs) => {
|
||||
entries.forEach(entry => {
|
||||
if (entry.isIntersecting) {
|
||||
wrapper.querySelectorAll(".mask").forEach(m => m.remove());
|
||||
|
||||
// Create 9 masks
|
||||
for (let i = 0; i < 9; i++) {
|
||||
const mask = document.createElement("div");
|
||||
mask.className = `mask mask-${i + 1}`;
|
||||
Object.assign(mask.style, {
|
||||
backgroundImage: `url(${url})`,
|
||||
backgroundSize: "cover",
|
||||
backgroundPosition: "center",
|
||||
position: "absolute",
|
||||
inset: "0"
|
||||
});
|
||||
wrapper.appendChild(mask);
|
||||
}
|
||||
|
||||
// observer stop
|
||||
obs.unobserve(entry.target);
|
||||
}
|
||||
});
|
||||
}, { threshold: 0.2 });
|
||||
|
||||
observer.observe(wrapper);
|
||||
});
|
||||
|
||||
//>> Gt Brand Slider Start <<//
|
||||
if($('.brand-slider').length > 0) {
|
||||
const BrandSlider = new Swiper(".brand-slider", {
|
||||
spaceBetween: 30,
|
||||
speed: 1300,
|
||||
loop: true,
|
||||
centeredSlides: true,
|
||||
autoplay: {
|
||||
delay: 2000,
|
||||
disableOnInteraction: false,
|
||||
},
|
||||
|
||||
breakpoints: {
|
||||
1199: {
|
||||
slidesPerView: 5,
|
||||
},
|
||||
991: {
|
||||
slidesPerView: 4,
|
||||
},
|
||||
767: {
|
||||
slidesPerView: 3,
|
||||
},
|
||||
575: {
|
||||
slidesPerView: 2,
|
||||
},
|
||||
0: {
|
||||
slidesPerView: 1,
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
//>> Service Slider Start <<//
|
||||
if($('.service-slider').length > 0) {
|
||||
const ServiceSlider = new Swiper(".service-slider", {
|
||||
spaceBetween: 0,
|
||||
speed: 1300,
|
||||
loop: true,
|
||||
autoplay: {
|
||||
delay: 2000,
|
||||
disableOnInteraction: false,
|
||||
},
|
||||
navigation: {
|
||||
nextEl: ".array-prev",
|
||||
prevEl: ".array-next",
|
||||
},
|
||||
pagination: {
|
||||
el: ".service-dot",
|
||||
},
|
||||
breakpoints: {
|
||||
1199: {
|
||||
slidesPerView: 4,
|
||||
},
|
||||
991: {
|
||||
slidesPerView: 3,
|
||||
},
|
||||
767: {
|
||||
slidesPerView: 2,
|
||||
},
|
||||
575: {
|
||||
slidesPerView: 1,
|
||||
},
|
||||
0: {
|
||||
slidesPerView: 1,
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
//>> Testimonial Slider Start <<//
|
||||
if($('.testimonial-slider-2').length > 0) {
|
||||
const TestimonialSlider2 = new Swiper(".testimonial-slider-2", {
|
||||
spaceBetween: 30,
|
||||
speed: 1300,
|
||||
loop: true,
|
||||
autoplay: {
|
||||
delay: 2000,
|
||||
disableOnInteraction: false,
|
||||
},
|
||||
|
||||
breakpoints: {
|
||||
1199: {
|
||||
slidesPerView: 1,
|
||||
},
|
||||
991: {
|
||||
slidesPerView: 1,
|
||||
},
|
||||
767: {
|
||||
slidesPerView: 1,
|
||||
},
|
||||
575: {
|
||||
slidesPerView: 1,
|
||||
},
|
||||
0: {
|
||||
slidesPerView: 1,
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
//>> Test Slider Start <<//
|
||||
if($('.test-slider').length > 0) {
|
||||
const TestSlider = new Swiper(".test-slider", {
|
||||
direction: "vertical",
|
||||
spaceBetween: 30,
|
||||
speed: 1300,
|
||||
loop: true,
|
||||
autoplay: {
|
||||
delay: 2000,
|
||||
disableOnInteraction: false,
|
||||
},
|
||||
|
||||
breakpoints: {
|
||||
1199: {
|
||||
slidesPerView: 3,
|
||||
},
|
||||
991: {
|
||||
slidesPerView: 2,
|
||||
},
|
||||
767: {
|
||||
slidesPerView: 1,
|
||||
},
|
||||
575: {
|
||||
slidesPerView: 1,
|
||||
},
|
||||
0: {
|
||||
slidesPerView: 1,
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
//>> Visa Slider Start <<//
|
||||
if($('.visa-slider').length > 0) {
|
||||
const VisaSlider = new Swiper(".visa-slider", {
|
||||
spaceBetween: 30,
|
||||
speed: 1300,
|
||||
loop: true,
|
||||
autoplay: {
|
||||
delay: 2000,
|
||||
disableOnInteraction: false,
|
||||
},
|
||||
|
||||
navigation: {
|
||||
nextEl: ".array-prev",
|
||||
prevEl: ".array-next",
|
||||
},
|
||||
breakpoints: {
|
||||
1199: {
|
||||
slidesPerView: 4,
|
||||
},
|
||||
991: {
|
||||
slidesPerView: 3,
|
||||
},
|
||||
767: {
|
||||
slidesPerView: 2,
|
||||
},
|
||||
575: {
|
||||
slidesPerView: 1,
|
||||
},
|
||||
0: {
|
||||
slidesPerView: 1,
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
//>> Visa Slider Start <<//
|
||||
if($('.testimonial-slider-3').length > 0) {
|
||||
const TestimonialSlider3 = new Swiper(".testimonial-slider-3", {
|
||||
spaceBetween: 30,
|
||||
speed: 1300,
|
||||
loop: true,
|
||||
autoplay: {
|
||||
delay: 2000,
|
||||
disableOnInteraction: false,
|
||||
},
|
||||
|
||||
navigation: {
|
||||
nextEl: ".array-prev",
|
||||
prevEl: ".array-next",
|
||||
},
|
||||
breakpoints: {
|
||||
1199: {
|
||||
slidesPerView: 1,
|
||||
},
|
||||
991: {
|
||||
slidesPerView: 1,
|
||||
},
|
||||
767: {
|
||||
slidesPerView: 1,
|
||||
},
|
||||
575: {
|
||||
slidesPerView: 1,
|
||||
},
|
||||
0: {
|
||||
slidesPerView: 1,
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
//>> Service-item Hover Image Show Slider Start <<//
|
||||
const serviceItems = document.querySelectorAll(".service-item");
|
||||
serviceItems.forEach((item) => {
|
||||
const imageHover = item.querySelector(".image-hover");
|
||||
|
||||
item.addEventListener("mousemove", (event) => {
|
||||
const rect = item.getBoundingClientRect();
|
||||
const dx = event.clientX - rect.left;
|
||||
const dy = event.clientY - rect.top;
|
||||
imageHover.style.transform = `translate(${dx}px, ${dy}px) translate(-50%, -50%)`;
|
||||
// imageHover.style.transform = `translate(${dx}px, ${dy}px) rotate(28.57deg)`;
|
||||
imageHover.style.opacity = "1";
|
||||
imageHover.style.visibility = "visible";
|
||||
});
|
||||
|
||||
item.addEventListener("mouseleave", () => {
|
||||
imageHover.style.opacity = "0";
|
||||
imageHover.style.visibility = "hidden";
|
||||
});
|
||||
});
|
||||
|
||||
/* ================================
|
||||
Custom Accordion Js Start
|
||||
================================ */
|
||||
$(".accordion-single .header-area").on("click", function () {
|
||||
if ($(this).closest(".accordion-single").hasClass("active")) {
|
||||
$(this).closest(".accordion-single").removeClass("active");
|
||||
$(this).next(".content-area").slideUp();
|
||||
} else {
|
||||
$(".accordion-single").removeClass("active");
|
||||
$(this).closest(".accordion-single").addClass("active");
|
||||
$(".content-area").not($(this).next(".content-area")).slideUp();
|
||||
$(this).next(".content-area").slideToggle();
|
||||
}
|
||||
});
|
||||
|
||||
//>> Counter Js Start <<//
|
||||
$(window).on("scroll", function () {
|
||||
$(".odometer").each(function () {
|
||||
var el = $(this);
|
||||
if (el.offset().top < $(window).scrollTop() + $(window).height()) {
|
||||
if (!el.hasClass("counted")) {
|
||||
el.addClass("counted");
|
||||
el.html(el.attr("data-count"));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
/* ==================================================
|
||||
Image Scale
|
||||
================================================== */
|
||||
var width = $(window).width();
|
||||
if (width > 1023) {
|
||||
if (document.querySelectorAll(".image-scale-animation").length > 0) {
|
||||
|
||||
// plugin register করতে হবে একবার শুরুতেই
|
||||
gsap.registerPlugin(ScrollTrigger);
|
||||
|
||||
var step1 = gsap.timeline({
|
||||
scrollTrigger: {
|
||||
trigger: ".image-scale-animation",
|
||||
scrub: 4,
|
||||
start: "top 100%",
|
||||
end: "bottom 70%",
|
||||
},
|
||||
});
|
||||
|
||||
step1.from(".image-scale-animation .image-scale-animation-item", {
|
||||
scale: 0.1,
|
||||
duration: 2, // অতিরিক্ত বড় duration দরকার নেই
|
||||
});
|
||||
step1.to(".image-scale-animation .image-scale-animation-item", {
|
||||
scale: 1,
|
||||
duration: 1.5,
|
||||
transformOrigin: "center bottom",
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/* ==================================================
|
||||
GSAP Image Reveal
|
||||
================================================== */
|
||||
|
||||
/* ==================================================
|
||||
GSAP Fade Up
|
||||
================================================== */
|
||||
let fadeArray_items = document.querySelectorAll(".fade-up-anim");
|
||||
if (fadeArray_items.length > 0) {
|
||||
gsap.registerPlugin(ScrollTrigger);
|
||||
|
||||
const fadeArray = gsap.utils.toArray(".fade-up-anim");
|
||||
fadeArray.forEach((item) => {
|
||||
let fade_direction = item.getAttribute("data-direction") || "bottom";
|
||||
let fade_offset = parseInt(item.getAttribute("data-offset")) || 50;
|
||||
let duration_value = parseFloat(item.getAttribute("data-duration")) || 1.15;
|
||||
let delay_value = parseFloat(item.getAttribute("data-delay")) || 0.15;
|
||||
let ease_value = item.getAttribute("data-ease") || "power2.out";
|
||||
let onscroll_value = item.getAttribute("data-on-scroll") || 1;
|
||||
|
||||
let animation_settings = {
|
||||
opacity: 0,
|
||||
ease: ease_value,
|
||||
duration: duration_value,
|
||||
delay: delay_value,
|
||||
};
|
||||
|
||||
if (fade_direction === "top") animation_settings['y'] = -fade_offset;
|
||||
if (fade_direction === "left") animation_settings['x'] = -fade_offset;
|
||||
if (fade_direction === "bottom") animation_settings['y'] = fade_offset;
|
||||
if (fade_direction === "right") animation_settings['x'] = fade_offset;
|
||||
|
||||
if (onscroll_value == 1) {
|
||||
animation_settings['scrollTrigger'] = {
|
||||
trigger: item,
|
||||
start: 'top 85%',
|
||||
};
|
||||
}
|
||||
|
||||
gsap.from(item, animation_settings);
|
||||
});
|
||||
}
|
||||
|
||||
/* ==================================================
|
||||
Smooth Scroll (Lenis)
|
||||
================================================== */
|
||||
// Check if gsap and SplitText exist
|
||||
if (typeof gsap !== "undefined" && typeof SplitText !== "undefined") {
|
||||
const splitTextEl = document.querySelector(".split-text-right");
|
||||
|
||||
if (splitTextEl) { // শুধুমাত্র এলিমেন্ট থাকলে
|
||||
gsap.registerPlugin(SplitText, ScrollTrigger);
|
||||
|
||||
let split = new SplitText(splitTextEl, { type: "chars,words" });
|
||||
|
||||
gsap.from(split.chars, {
|
||||
opacity: 0,
|
||||
y: 50,
|
||||
stagger: 0.05,
|
||||
duration: 1,
|
||||
ease: "power3.out",
|
||||
scrollTrigger: {
|
||||
trigger: splitTextEl,
|
||||
start: "top 80%",
|
||||
toggleActions: "play none none reverse"
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* ==================================================
|
||||
Smooth Scroll
|
||||
================================================== */
|
||||
const header = document.querySelector('.sticky');
|
||||
const headerHeight = header ? header.offsetHeight : 0;
|
||||
|
||||
document.querySelectorAll('a[href^="#"]:not([data-bs-toggle="tab"])').forEach((el) => {
|
||||
el.addEventListener('click', (e) => {
|
||||
e.preventDefault();
|
||||
const id = el.getAttribute('href')?.slice(1);
|
||||
if (!id) return;
|
||||
const target = document.getElementById(id);
|
||||
if (target) {
|
||||
const offsetTop = target.offsetTop - headerHeight;
|
||||
lenis.scrollTo(offsetTop, { duration: 1.2 });
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
/* ==================================================
|
||||
Mounth Year
|
||||
================================================== */
|
||||
const monthYear = document.getElementById("month-year");
|
||||
const datesContainer = document.getElementById("dates");
|
||||
const prevBtn = document.getElementById("prev");
|
||||
const nextBtn = document.getElementById("next");
|
||||
|
||||
let currentDate = new Date(2025, 7);
|
||||
let selectedDateDiv = null; //
|
||||
|
||||
function renderCalendar(date) {
|
||||
if (!monthYear || !datesContainer) return;
|
||||
|
||||
const year = date.getFullYear();
|
||||
const month = date.getMonth();
|
||||
|
||||
const monthNames = [
|
||||
"January", "February", "March", "April", "May", "June",
|
||||
"July", "August", "September", "October", "November", "December"
|
||||
];
|
||||
monthYear.textContent = `${monthNames[month]} ${year}`;
|
||||
|
||||
datesContainer.innerHTML = "";
|
||||
|
||||
const firstDay = new Date(year, month, 1).getDay();
|
||||
const daysInMonth = new Date(year, month + 1, 0).getDate();
|
||||
|
||||
let blanks = firstDay === 0 ? 6 : firstDay - 1;
|
||||
for (let i = 0; i < blanks; i++) {
|
||||
const emptyDiv = document.createElement("div");
|
||||
datesContainer.appendChild(emptyDiv);
|
||||
}
|
||||
|
||||
for (let d = 1; d <= daysInMonth; d++) {
|
||||
const dayDiv = document.createElement("div");
|
||||
dayDiv.textContent = d;
|
||||
|
||||
// Highlight specific dates (example)
|
||||
if (year === 2025 && month === 7 && [25,26,27].includes(d)) {
|
||||
dayDiv.classList.add("highlight");
|
||||
}
|
||||
|
||||
// ✅ Click event for selecting date
|
||||
dayDiv.addEventListener("click", () => {
|
||||
// Remove previous active
|
||||
if (selectedDateDiv) {
|
||||
selectedDateDiv.classList.remove("active-date");
|
||||
}
|
||||
// Add active to current
|
||||
dayDiv.classList.add("active-date");
|
||||
selectedDateDiv = dayDiv;
|
||||
});
|
||||
|
||||
datesContainer.appendChild(dayDiv);
|
||||
}
|
||||
}
|
||||
|
||||
// Navigation buttons
|
||||
if (prevBtn) {
|
||||
prevBtn.addEventListener("click", () => {
|
||||
currentDate.setMonth(currentDate.getMonth() - 1);
|
||||
renderCalendar(currentDate);
|
||||
selectedDateDiv = null; // reset selection on month change
|
||||
});
|
||||
}
|
||||
|
||||
if (nextBtn) {
|
||||
nextBtn.addEventListener("click", () => {
|
||||
currentDate.setMonth(currentDate.getMonth() + 1);
|
||||
renderCalendar(currentDate);
|
||||
selectedDateDiv = null; // reset selection on month change
|
||||
});
|
||||
}
|
||||
|
||||
// First render
|
||||
if (monthYear && datesContainer) {
|
||||
renderCalendar(currentDate);
|
||||
}
|
||||
|
||||
|
||||
}); // End Document Ready Function
|
||||
|
||||
//>> Counterup Start <<//
|
||||
|
||||
|
||||
|
||||
//>> Search Start <<//
|
||||
if ($(".search-toggler").length) {
|
||||
$(".search-toggler").on("click", function(e) {
|
||||
e.preventDefault();
|
||||
$(".search-popup").toggleClass("active");
|
||||
$("body").toggleClass("locked");
|
||||
});
|
||||
}
|
||||
|
||||
//>> MouseCursor Start <<//
|
||||
if ($(".mouseCursor").length > 0) {
|
||||
function itCursor() {
|
||||
var myCursor = jQuery(".mouseCursor");
|
||||
if (myCursor.length) {
|
||||
if ($("body")) {
|
||||
const e = document.querySelector(".cursor-inner"),
|
||||
t = document.querySelector(".cursor-outer");
|
||||
let n,
|
||||
i = 0,
|
||||
o = !1;
|
||||
(window.onmousemove = function(s) {
|
||||
o ||
|
||||
(t.style.transform =
|
||||
"translate(" + s.clientX + "px, " + s.clientY + "px)"),
|
||||
(e.style.transform =
|
||||
"translate(" + s.clientX + "px, " + s.clientY + "px)"),
|
||||
(n = s.clientY),
|
||||
(i = s.clientX);
|
||||
}),
|
||||
$("body").on(
|
||||
"mouseenter",
|
||||
"button, a, .cursor-pointer",
|
||||
function() {
|
||||
e.classList.add("cursor-hover"),
|
||||
t.classList.add("cursor-hover");
|
||||
}
|
||||
),
|
||||
$("body").on(
|
||||
"mouseleave",
|
||||
"button, a, .cursor-pointer",
|
||||
function() {
|
||||
($(this).is("a", "button") &&
|
||||
$(this).closest(".cursor-pointer").length) ||
|
||||
(e.classList.remove("cursor-hover"),
|
||||
t.classList.remove("cursor-hover"));
|
||||
}
|
||||
),
|
||||
(e.style.visibility = "visible"),
|
||||
(t.style.visibility = "visible");
|
||||
}
|
||||
}
|
||||
}
|
||||
itCursor();
|
||||
}
|
||||
|
||||
function loader() {
|
||||
$windowOn.on('load', function() {
|
||||
// Animate loader off screen
|
||||
$(".preloader").addClass('loaded');
|
||||
$(".preloader").delay(200).fadeOut();
|
||||
});
|
||||
}
|
||||
|
||||
loader();
|
||||
|
||||
|
||||
})(jQuery); // End jQuery
|
||||
2
public/assets/js/odometer.min.js
vendored
Normal file
2
public/assets/js/odometer.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
14
public/assets/js/swiper-bundle.min.js
vendored
Normal file
14
public/assets/js/swiper-bundle.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
71
public/assets/js/viewport.jquery.js
Normal file
71
public/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
public/assets/js/wow.min.js
vendored
Normal file
3
public/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