14/09/2023
This commit is contained in:
564
Viccos/js/library_hura8.js
Normal file
564
Viccos/js/library_hura8.js
Normal file
File diff suppressed because one or more lines are too long
364
Viccos/js/main_pc.js
Normal file
364
Viccos/js/main_pc.js
Normal file
@@ -0,0 +1,364 @@
|
||||
$(document).ready(function () {
|
||||
// GLOBAL CALL
|
||||
globalHandler();
|
||||
|
||||
// PAGE CALL
|
||||
homepageHandler();
|
||||
categoryHandler();
|
||||
productDetailHandler();
|
||||
articleHandler();
|
||||
});
|
||||
|
||||
// GLOBAL HANDLER
|
||||
function globalHandler() {
|
||||
// Hura.UI.loadGroup(lazy_load_group);
|
||||
runLazyImageLoad();
|
||||
viewMoreHandler('.js-vm-block');
|
||||
searchHandler('#js-search-bar', 'search');
|
||||
closeWhenClickOutside();
|
||||
|
||||
checkLanguageSelected();
|
||||
|
||||
AOS.init({
|
||||
easing: 'ease-in-out',
|
||||
duration: 600,
|
||||
once: true,
|
||||
delay: 0,
|
||||
});
|
||||
}
|
||||
|
||||
// CHECK LANGUAGE SELECTED
|
||||
function checkLanguageSelected() {
|
||||
const lang_check = `{{ global.user_settings.product_display_type }}`;
|
||||
if (lang_check === 'vi|en') $('.language-current option[value="vi|en"]').attr('selected', 'selected');
|
||||
}
|
||||
|
||||
// TOGGLE DISPLAY MENU MOBILE
|
||||
function toggleMenu() {
|
||||
$("#js-global-menu").toggleClass("active");
|
||||
$("body").toggleClass("overflow-hidden");
|
||||
}
|
||||
|
||||
// TOGGLE SLIDE MENU ITEM
|
||||
function slideMenuItem(_this, type) {
|
||||
$(_this).toggleClass("active");
|
||||
|
||||
switch (type) {
|
||||
case "sub-menu":
|
||||
$("#js-sub-menu").slideToggle();
|
||||
break;
|
||||
case "sub-item":
|
||||
$(_this)
|
||||
.closest(".sub-item")
|
||||
.find(".cat-child")
|
||||
.first()
|
||||
.slideToggle();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// ARCCODION HANDLER
|
||||
function arccodionMBHandler(_this) {
|
||||
if (window.screen.availWidth > 768) return;
|
||||
|
||||
const arccodionItem = $(_this).closest(".accordion");
|
||||
const arccodionIcon = arccodionItem.find(".accordion-icon");
|
||||
const arccodionContent = arccodionItem.find(".accordion-content");
|
||||
|
||||
arccodionContent.slideToggle();
|
||||
if (arccodionIcon) arccodionIcon.toggleClass('rotate');
|
||||
}
|
||||
|
||||
// HOMEPAGE HANDLER
|
||||
function homepageHandler() {
|
||||
swiperHomepageHandler();
|
||||
checkSliderFeaturesBtn();
|
||||
}
|
||||
|
||||
// CHECK SLIDER FEATURES BUTTON
|
||||
function checkSliderFeaturesBtn() {
|
||||
if (window.screen.availWidth < 576 && 1 < 2) return;
|
||||
if ($('.swiper-homepage-features .swiper-slide').length < 5 && window.screen.availWidth > 768) $('#js-f-slider-group').hide();
|
||||
}
|
||||
|
||||
// SWIPER HOMEPAGE HANDLER
|
||||
function swiperHomepageHandler() {
|
||||
swiperSectionHero();
|
||||
swiperHomepageCertificate();
|
||||
swiperProductFeatured();
|
||||
swiperHomepageFeatures();
|
||||
swiperArticleFeatured()
|
||||
swiperSectionCustomer();
|
||||
}
|
||||
|
||||
function swiperSectionHero() {
|
||||
new Swiper(".swiper-section-hero", {
|
||||
slidesPerView: 1,
|
||||
spaceBetween: 10,
|
||||
rewind: true,
|
||||
speed: 1000,
|
||||
autoplay: {
|
||||
delay: 3500,
|
||||
disableOnInteraction: false,
|
||||
pauseOnMouseEnter: "true",
|
||||
},
|
||||
pagination: {
|
||||
el: ".swiper-pagination",
|
||||
},
|
||||
breakpoints: {
|
||||
769: {
|
||||
pagination: {
|
||||
clickable: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function swiperHomepageCertificate() {
|
||||
new Swiper(".swiper-homepage-certificate", {
|
||||
slidesPerView: 1,
|
||||
spaceBetween: 10,
|
||||
rewind: true,
|
||||
speed: 1000,
|
||||
navigation: {
|
||||
nextEl: ".swiper-button-next",
|
||||
prevEl: ".swiper-button-prev",
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function swiperProductFeatured() {
|
||||
new Swiper(".swiper-category-featured", {
|
||||
slidesPerView: 1.5,
|
||||
spaceBetween: 10,
|
||||
rewind: true,
|
||||
speed: 1000,
|
||||
navigation: {
|
||||
nextEl: ".swiper-button-next",
|
||||
prevEl: ".swiper-button-prev",
|
||||
},
|
||||
breakpoints: {
|
||||
577: {
|
||||
slidesPerView: 2,
|
||||
spaceBetween: 20,
|
||||
},
|
||||
769: {
|
||||
slidesPerView: 3,
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function swiperHomepageFeatures() {
|
||||
new Swiper(".swiper-homepage-features", {
|
||||
slidesPerView: 1.5,
|
||||
spaceBetween: 10,
|
||||
rewind: true,
|
||||
speed: 1000,
|
||||
autoplay: {
|
||||
delay: 3500,
|
||||
disableOnInteraction: false,
|
||||
pauseOnMouseEnter: "true",
|
||||
},
|
||||
breakpoints: {
|
||||
577: {
|
||||
slidesPerView: 3,
|
||||
spaceBetween: 12,
|
||||
},
|
||||
769: {
|
||||
slidesPerView: 4,
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function swiperArticleFeatured() {
|
||||
new Swiper(".swiper-article-featured", {
|
||||
slidesPerView: 1,
|
||||
spaceBetween: 10,
|
||||
rewind: true,
|
||||
speed: 1000,
|
||||
navigation: {
|
||||
nextEl: ".swiper-button-next",
|
||||
prevEl: ".swiper-button-prev",
|
||||
},
|
||||
breakpoints: {
|
||||
577: {
|
||||
slidesPerView: 2,
|
||||
spaceBetween: 12,
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function swiperSectionCustomer() {
|
||||
new Swiper(".swiper-section-customer", {
|
||||
slidesPerView: 1.5,
|
||||
spaceBetween: 10,
|
||||
rewind: true,
|
||||
speed: 1000,
|
||||
pagination: {
|
||||
el: ".swiper-pagination",
|
||||
clickable: false,
|
||||
},
|
||||
breakpoints: {
|
||||
577: {
|
||||
slidesPerView: 2,
|
||||
spaceBetween: 20,
|
||||
},
|
||||
769: {
|
||||
slidesPerView: 3,
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
//
|
||||
function categoryHandler() {
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
function productDetailHandler() {
|
||||
viewMoreHandler('.js-vm-block');
|
||||
swiperThumbsHandler();
|
||||
swiperSectionProHistory();
|
||||
}
|
||||
|
||||
function swiperThumbsHandler() {
|
||||
let galleryThumbs = new Swiper(".gallery-thumbs", {
|
||||
spaceBetween: 10,
|
||||
slidesPerView: 4,
|
||||
slideToClickedSlide: true,
|
||||
freeMode: true,
|
||||
watchSlidesProgress: true,
|
||||
centerInsufficientSlides: true,
|
||||
navigation: {
|
||||
nextEl: ".swiper-button-next",
|
||||
prevEl: ".swiper-button-prev",
|
||||
},
|
||||
breakpoints: {
|
||||
768: {
|
||||
spaceBetween: 12,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
let galleryTop = new Swiper(".gallery-top", {
|
||||
spaceBetween: 10,
|
||||
slidesPerView: 1,
|
||||
initialSlide: 1,
|
||||
speed: 1000,
|
||||
// autoplay: {
|
||||
// delay: 2500,
|
||||
// disableOnInteraction: false,
|
||||
// pauseOnMouseEnter: "true",
|
||||
// },
|
||||
navigation: {
|
||||
nextEl: ".swiper-button-next",
|
||||
prevEl: ".swiper-button-prev",
|
||||
},
|
||||
breakpoints: {
|
||||
768: {
|
||||
spaceBetween: 12,
|
||||
},
|
||||
},
|
||||
thumbs: {
|
||||
swiper: galleryThumbs,
|
||||
},
|
||||
// AUTO SILDED AT FISRT AND END
|
||||
on: {
|
||||
slideChange: function () {
|
||||
let activeIndex = this.activeIndex + 1;
|
||||
|
||||
let activeSlide = document.querySelector(
|
||||
`.gallery-thumbs .swiper-slide:nth-child(${activeIndex})`
|
||||
);
|
||||
let nextSlide = document.querySelector(
|
||||
`.gallery-thumbs .swiper-slide:nth-child(${activeIndex + 1})`
|
||||
);
|
||||
let prevSlide = document.querySelector(
|
||||
`.gallery-thumbs .swiper-slide:nth-child(${activeIndex - 1})`
|
||||
);
|
||||
|
||||
if (
|
||||
nextSlide &&
|
||||
!nextSlide.classList.contains("swiper-slide-visible")
|
||||
) {
|
||||
this.thumbs.swiper.slideNext();
|
||||
} else if (
|
||||
prevSlide &&
|
||||
!prevSlide.classList.contains("swiper-slide-visible")
|
||||
) {
|
||||
this.thumbs.swiper.slidePrev();
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function swiperSectionProHistory() {
|
||||
new Swiper(".swiper-section-pro-history", {
|
||||
slidesPerView: 2,
|
||||
spaceBetween: 10,
|
||||
rewind: true,
|
||||
speed: 1000,
|
||||
navigation: {
|
||||
nextEl: ".swiper-button-next",
|
||||
prevEl: ".swiper-button-prev",
|
||||
},
|
||||
breakpoints: {
|
||||
569: {
|
||||
slidesPerView: 3,
|
||||
spaceBetween: 12,
|
||||
},
|
||||
769: {
|
||||
slidesPerView: 4,
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
//
|
||||
function articleHandler() {
|
||||
swiperArticleHomeShowcase();
|
||||
swiperArticleHomeCategory();
|
||||
}
|
||||
|
||||
function swiperArticleHomeShowcase() {
|
||||
new Swiper(".swiper-article-home-showcase", {
|
||||
slidesPerView: 1,
|
||||
spaceBetween: 12,
|
||||
rewind: true,
|
||||
speed: 1000,
|
||||
navigation: {
|
||||
nextEl: ".swiper-button-next",
|
||||
prevEl: ".swiper-button-prev",
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function swiperArticleHomeCategory() {
|
||||
new Swiper(".swiper-article-home-category", {
|
||||
slidesPerView: 1.5,
|
||||
spaceBetween: 10,
|
||||
rewind: true,
|
||||
speed: 1000,
|
||||
navigation: {
|
||||
nextEl: ".swiper-button-next",
|
||||
prevEl: ".swiper-button-prev",
|
||||
},
|
||||
breakpoints: {
|
||||
569: {
|
||||
slidesPerView: 2,
|
||||
spaceBetween: 12,
|
||||
},
|
||||
769: {
|
||||
slidesPerView: 3,
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
3
Viccos/js/translate_language.js
Normal file
3
Viccos/js/translate_language.js
Normal file
@@ -0,0 +1,3 @@
|
||||
//<![CDATA[
|
||||
eval(function (p, a, c, k, e, r) { e = function (c) { return (c < a ? '' : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36)) }; if (!''.replace(/^/, String)) { while (c--) r[e(c)] = k[c] || e(c); k = [function (e) { return r[e] }]; e = function () { return '\\w+' }; c = 1 }; while (c--) if (k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]); return p }('6 7(a,b){n{4(2.9){3 c=2.9("o");c.p(b,f,f);a.q(c)}g{3 c=2.r();a.s(\'t\'+b,c)}}u(e){}}6 h(a){4(a.8)a=a.8;4(a==\'\')v;3 b=a.w(\'|\')[1];3 c;3 d=2.x(\'y\');z(3 i=0;i<d.5;i++)4(d[i].A==\'B-C-D\')c=d[i];4(2.j(\'k\')==E||2.j(\'k\').l.5==0||c.5==0||c.l.5==0){F(6(){h(a)},G)}g{c.8=b;7(c,\'m\');7(c,\'m\')}}', 43, 43, '||document|var|if|length|function|GTranslateFireEvent|value|createEvent||||||true|else|doGTranslate||getElementById|google_translate_element2|innerHTML|change|try|HTMLEvents|initEvent|dispatchEvent|createEventObject|fireEvent|on|catch|return|split|getElementsByTagName|select|for|className|goog|te|combo|null|setTimeout|500'.split('|'), 0, {}))
|
||||
//]]>
|
||||
Reference in New Issue
Block a user