Update index footer

This commit is contained in:
Moe Poi ~ 2021-11-10 12:03:24 +07:00
parent 3924c0b2ef
commit feb97924ff

View file

@ -553,214 +553,7 @@
</div>
</div>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"
integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous">
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"
integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous">
</script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"
integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous">
</script>
<script>
feather.replace()
</script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/js/bootstrap.min.js"
integrity="sha384-+YQ4JLhjyBLPDQt//I+STsc9iw4uQqACwlvpslubQzn4u2UU2UFM80nGisd026JF" crossorigin="anonymous">
</script>
<script src="js/plugins/Isotope/isotope.pkgd.min.js"></script>
<script src="js/plugins/OwlCarousel2-2.2.1/owl.carousel.js"></script>
<script>
jQuery(document).ready(function ($) {
"user strict";
var mainSlider = $('.main.slider');
var hamburger = $('.hamburger_container');
var menu = $('.hamburger_menu');
var menuActive = false;
var hamburgerClose = $('.hamburger_close');
var fsOverlay = $('.fs_menu_overlay');
initMenu();
initFavorite();
initIsotopeFiltering();
initTimer();
initSlider();
function initMenu() {
if (hamburger.length) {
hamburger.on('click', function () {
if (!menuActive) {
openMenu();
}
});
}
if (fsOverlay.length) {
fsOverlay.on('click', function () {
if (menuActive) {
closeMenu();
}
});
}
if (hamburgerClose.length) {
hamburgerClose.on('click', function () {
if (menuActive) {
closeMenu();
}
});
}
if ($('.menu_item'), length) {
var items = document.getElementsByClassName('menu_item');
var i;
for (i = 0; i < items.length; i++) {
if (items[i].classList.contains("has-children")) {
items[i].onclick = function () {
this.classList.toggle("active");
var panel = this.children[1];
if (panel.style.maxHeight) {
panel.style.maxHeight = null;
} else {
panel.style.maxHeight = panel.scrollHeight + "px";
}
}
}
}
}
}
function openMenu() {
menu.addClass('active');
fsOverlay.css('pointer-events', "auto");
menuActive = true;
}
function closeMenu() {
menu.removeClass('active');
fsOverlay.css('pointer-events', "none");
menuActive = false;
}
function initTimer() {
if ($('.timer').length) {
var target_date = new Date("August 31, 2021").getTime();
var days, hours, minutes, seconds;
var d = $('#day');
var h = $('#hour');
var m = $('#minute');
var s = $('#second');
setInterval(function () {
var current_date = new Date().getTime();
var seconds_left = (target_date - current_date) / 1000;
days = parseInt(seconds_left / 86400);
seconds_left = seconds_left % 86400;
hours = parseInt(seconds_left / 3600);
seconds_left = seconds_left % 3600;
minutes = parseInt(seconds_left / 60);
seconds = parseInt(seconds_left % 60);
d.text(days);
h.text(hours);
m.text(minutes);
s.text(seconds);
}, 1000)
}
}
function initFavorite() {
if ($('.favorite').length) {
var favs = $('.favorite');
favs.each(function () {
var fav = $(this);
var active = false;
if (fav.hasClass('active')) {
active = true;
}
fav.on('click', function () {
if (active) {
fav.removeClass('active');
active = false;
} else {
fav.addClass('active');
active = true;
}
})
});
}
}
function initIsotopeFiltering() {
if ($('.grid_sorting_button').length) {
$('.grid_sorting_button').click(function () {
$('.grid_sorting_button.active').removeClass('active');
$(this).addClass('active');
var selector = $(this).attr('data-filter');
$('.product-grid').isotope({
filter: selector,
animationOptions: {
duration: 750,
easing: 'linear',
queue: false,
}
});
return false
});
}
}
function initSlider() {
if ($('.product_slider').length) {
var slider1 = $('.product_slider');
slider1.owlCarousel({
loop: false,
dots: false,
nav: false,
responsive: {
0: {
items: 1
},
480: {
items: 2
},
768: {
items: 3
},
991: {
items: 4
},
1280: {
items: 5
},
1440: {
items: 5
},
}
});
if ($('.product_slider_nav_left').length) {
$('.product_slider_nav_left').on('click', function () {
slider1.trigger('prev.owl.carousel');
})
}
if ($('.product_slider_nav_right').length) {
$('.product_slider_nav_right').on('click', function () {
slider1.trigger('next.owl.carousel');
})
}
}
}
})
</script>
<%- include('../layouts/footer.ejs', {state: 'index'}); %>
</body>
</html>