"use strict";
(function ($) {
"use strict"; // searching & expand menu popup
var searchtoggle = $(".search-toggle"),
closea = $(".scale"),
closeb = $(".searching button"),
cbody = $("body"),
closescale = closea.add(closeb);
if (searchtoggle.length > 0) {
searchtoggle.on("click", function () {
cbody.toggleclass("open");
return false;
});
}
if (closescale.length > 0) {
closescale.on("click", function () {
cbody.removeclass("open");
return false;
});
}
$(".close").on("click", function () {
$("body").removeclass("open");
}); // commons variables
var $window = $(window),
$body = $("body"); // sticky menu
$($window).on("scroll", function () {
var scroll = $($window).scrolltop();
if (scroll < 150) {
$("#sticky").removeclass("is-isticky");
} else {
$("#sticky").addclass("is-isticky");
}
}); // off canvas toggler function
var $offcanvastoggle = $(".offcanvas-toggle"),
$offcanvas = $(".offcanvas"),
$offcanvasoverlay = $(".offcanvas-overlay"),
$mobilemenutoggle = $(".mobile-menu-toggle");
$offcanvastoggle.on("click", function (e) {
e.preventdefault();
var $this = $(this),
$target = $this.attr("href");
$body.addclass("offcanvas-open");
$($target).addclass("offcanvas-open");
$offcanvasoverlay.fadein();
if ($this.parent().hasclass("mobile-menu-toggle")) {
$this.addclass("close");
}
});
$(".offcanvas-close, .offcanvas-overlay").on("click", function (e) {
e.preventdefault();
$body.removeclass("offcanvas-open");
$offcanvas.removeclass("offcanvas-open");
$offcanvasoverlay.fadeout();
$mobilemenutoggle.find("a").removeclass("close");
}); // off canvas menu
function mobileoffcanvasmenu() {
var $offcanvasnav = $(".offcanvas-menu, .overlay-menu"),
$offcanvasnavsubmenu = $offcanvasnav.find(".offcanvas-submenu"); // add toggle button with off canvas sub menu
$offcanvasnavsubmenu.parent().prepend(''); // category sub menu toggle
$offcanvasnav.on("click", "li a, .menu-expand", function (e) {
var $this = $(this);
if ($this.attr("href") === "#" || $this.hasclass("menu-expand")) {
e.preventdefault();
if ($this.siblings("ul:visible").length) {
$this.parent("li").removeclass("active");
$this.siblings("ul").slideup();
$this.parent("li").find("li").removeclass("active");
$this.parent("li").find("ul:visible").slideup();
} else {
$this.parent("li").addclass("active");
$this.closest("li").siblings("li").removeclass("active").find("li").removeclass("active");
$this.closest("li").siblings("li").find("ul:visible").slideup();
$this.siblings("ul").slidedown();
}
}
});
}
mobileoffcanvasmenu();
var $offcanvasmenu2 = $("#offcanvas-menu2 li a");
$offcanvasmenu2.on("click", function (e) {
// e.preventdefault();
$(this).closest("li").toggleclass("active");
$(this).closest("li").siblings().removeclass("active");
$(this).closest("li").siblings().children(".category-sub-menu").slideup();
$(this).closest("li").siblings().children(".category-sub-menu").children("li").toggleclass("active");
$(this).closest("li").siblings().children(".category-sub-menu").children("li").removeclass("active");
$(this).parent().children(".category-sub-menu").slidetoggle();
}); // menu-content
var $btnmenu = $(".menu-btn");
var $vmenucontent = $(".vmenu-content");
$btnmenu.on("click", function (event) {
$vmenucontent.slidetoggle(500);
});
$vmenucontent.each(function () {
var $ul = $(this),
$lis = $ul.find(".menu-item:gt(7)"),
isexpanded = $ul.hasclass("expanded");
$lis[isexpanded ? "show" : "hide"]();
if ($lis.length > 0) {
$ul.append($('
' + (isexpanded ? 'close categories' : 'more categories') + "").on("click", function (event) {
var isexpanded = $ul.hasclass("expanded");
event.preventdefault();
$(this).html(isexpanded ? 'more categories' : 'close categories');
$ul.toggleclass("expanded");
$lis.toggle(300);
}));
}
}); // main slider active
var $timer = 6000;
var $mainslider = $(".main-slider");
$mainslider.slick({
autoplay: true,
autoplayspeed: 6000,
speed: 800,
slidestoshow: 1,
slidestoscroll: 1,
dots: true,
fade: true,
arrows: false,
prevarrow: '',
nextarrow: '',
responsive: [{
breakpoint: 767,
settings: {
dots: false,
arrows: false
}
}]
}).slickanimation();
function progressbar() {
$(".slick-progress").find("span").removeattr("style");
$(".slick-progress").find("span").removeclass("active");
settimeout(function () {
$(".slick-progress").find("span").css("transition-duration", $timer / 1000 + "s").addclass("active");
}, 100);
}
progressbar();
$mainslider.on("beforechange", function (e, slick) {
progressbar();
});
// product slider init
var $productsliderinit = $(".product-slider-init");
$productsliderinit.slick({
autoplay: false,
autoplayspeed: 10000,
dots: false,
infinite: true,
arrows: true,
speed: 1000,
slidestoshow: 4,
slidestoscroll: 1,
prevarrow: '',
nextarrow: '',
responsive: [{
breakpoint: 1280,
settings: {
slidestoshow: 4,
slidestoscroll: 1,
infinite: true,
dots: false
}
}, {
breakpoint: 1024,
settings: {
slidestoshow: 3,
slidestoscroll: 1,
arrows: true,
autoplay: true
}
}, {
breakpoint: 768,
settings: {
slidestoshow: 2,
slidestoscroll: 1,
arrows: false,
autoplay: true
}
}, {
breakpoint: 576,
settings: {
slidestoshow: 1,
slidestoscroll: 1,
arrows: false,
autoplay: true
}
} // you can unslick at a given breakpoint now by adding:
// settings: "unslick"
// instead of a settings object
]
}); // product slider 2 init
var $productslider2init = $(".product-slider2-init");
$productslider2init.slick({
autoplay: false,
autoplayspeed: 10000,
dots: false,
infinite: false,
arrows: true,
speed: 1000,
slidestoshow: 4,
slidestoscroll: 1,
prevarrow: '',
nextarrow: '',
responsive: [{
breakpoint: 1499,
settings: {
slidestoshow: 3,
slidestoscroll: 1,
infinite: true,
dots: false
}
}, {
breakpoint: 1024,
settings: {
slidestoshow: 2,
slidestoscroll: 1,
infinite: true,
dots: false
}
}, {
breakpoint: 991,
settings: {
slidestoshow: 3,
slidestoscroll: 1,
arrows: true,
autoplay: true
}
}, {
breakpoint: 768,
settings: {
slidestoshow: 2,
slidestoscroll: 1,
arrows: false,
autoplay: true
}
}, {
breakpoint: 480,
settings: {
slidestoshow: 1,
slidestoscroll: 1,
arrows: false,
autoplay: true
}
} // you can unslick at a given breakpoint now by adding:
// settings: "unslick"
// instead of a settings object
]
}); // popular-slider-init
var $popularslider = $(".popular-slider-init");
$popularslider.slick({
autoplay: false,
autoplayspeed: 10000,
dots: false,
infinite: false,
arrows: true,
speed: 1000,
slidestoshow: 5,
slidestoscroll: 1,
prevarrow: '',
nextarrow: '',
responsive: [{
breakpoint: 1280,
settings: {
slidestoshow: 4,
slidestoscroll: 1,
infinite: false,
dots: false
}
}, {
breakpoint: 991,
settings: {
slidestoshow: 3,
slidestoscroll: 1,
autoplay: true
}
}, {
breakpoint: 768,
settings: {
slidestoshow: 2,
slidestoscroll: 1,
autoplay: true
}
}, {
breakpoint: 480,
settings: {
slidestoshow: 1,
slidestoscroll: 1,
arrows: false,
autoplay: true
}
} // you can unslick at a given breakpoint now by adding:
// settings: "unslick"
// instead of a settings object
]
}); // popular-slider-init2
var $popularslider2 = $(".popular-slider-init2");
$popularslider2.slick({
autoplay: false,
autoplayspeed: 10000,
dots: false,
infinite: false,
arrows: true,
speed: 1000,
slidestoshow: 5,
slidestoscroll: 1,
prevarrow: '',
nextarrow: '',
responsive: [{
breakpoint: 1600,
settings: {
slidestoshow: 4,
slidestoscroll: 1,
infinite: false,
dots: false
}
}, {
breakpoint: 991,
settings: {
slidestoshow: 3,
slidestoscroll: 1,
autoplay: true
}
}, {
breakpoint: 768,
settings: {
slidestoshow: 2,
slidestoscroll: 1,
autoplay: true
}
}, {
breakpoint: 480,
settings: {
slidestoshow: 1,
slidestoscroll: 1,
arrows: false,
autoplay: true
}
} // you can unslick at a given breakpoint now by adding:
// settings: "unslick"
// instead of a settings object
]
}); // testimonial-init
var $testimonial = $(".testimonial-init");
$testimonial.slick({
autoplay: false,
autoplayspeed: 10000,
dots: true,
infinite: false,
arrows: false,
speed: 1000,
slidestoshow: 1,
slidestoscroll: 1,
prevarrow: '',
nextarrow: '',
responsive: [{
breakpoint: 1280,
settings: {
slidestoshow: 1,
slidestoscroll: 1,
infinite: false,
dots: true
}
}, {
breakpoint: 991,
settings: {
slidestoshow: 1,
slidestoscroll: 1,
arrows: false,
autoplay: true
}
}, {
breakpoint: 768,
settings: {
slidestoshow: 1,
slidestoscroll: 1,
arrows: false,
autoplay: true
}
}, {
breakpoint: 480,
settings: {
slidestoshow: 1,
slidestoscroll: 1,
arrows: false,
autoplay: true
}
} // you can unslick at a given breakpoint now by adding:
// settings: "unslick"
// instead of a settings object
]
}); // featured-init
var $featuredslider = $(".featured-init");
$featuredslider.slick({
autoplay: false,
autoplayspeed: 10000,
dots: false,
infinite: false,
arrows: true,
speed: 1000,
slidestoshow: 4,
slidestoscroll: 1,
prevarrow: '',
nextarrow: '',
responsive: [{
breakpoint: 1280,
settings: {
slidestoshow: 3,
slidestoscroll: 1,
infinite: false,
dots: false
}
}, {
breakpoint: 991,
settings: {
slidestoshow: 2,
slidestoscroll: 1,
arrows: true,
autoplay: true
}
}, {
breakpoint: 768,
settings: {
slidestoshow: 2,
slidestoscroll: 1,
arrows: true,
autoplay: true
}
}, {
breakpoint: 480,
settings: {
slidestoshow: 1,
slidestoscroll: 1,
arrows: false,
autoplay: true
}
} // you can unslick at a given breakpoint now by adding:
// settings: "unslick"
// instead of a settings object
]
}); // featured-init2
var $featuredslider2 = $(".featured-init2");
$featuredslider2.slick({
autoplay: false,
autoplayspeed: 10000,
dots: false,
infinite: false,
arrows: true,
speed: 1000,
slidestoshow: 1,
slidestoscroll: 1,
prevarrow: '',
nextarrow: '',
responsive: [{
breakpoint: 1280,
settings: {
slidestoshow: 1,
slidestoscroll: 1,
infinite: false,
dots: false
}
}, {
breakpoint: 991,
settings: {
slidestoshow: 2,
slidestoscroll: 1,
arrows: true,
autoplay: true
}
}, {
breakpoint: 768,
settings: {
slidestoshow: 1,
slidestoscroll: 1,
arrows: true,
autoplay: true
}
}, {
breakpoint: 480,
settings: {
slidestoshow: 1,
slidestoscroll: 1,
arrows: false,
autoplay: true
}
} // you can unslick at a given breakpoint now by adding:
// settings: "unslick"
// instead of a settings object
]
}); // product ctry slider init
var $productctry = $(".product-ctry-init");
$productctry.slick({
autoplay: false,
autoplayspeed: 10000,
dots: false,
infinite: false,
arrows: true,
speed: 1000,
slidestoshow: 1,
slidestoscroll: 1,
prevarrow: '',
nextarrow: '',
responsive: [{
breakpoint: 1024,
settings: {
slidestoshow: 1,
slidestoscroll: 1,
infinite: true,
dots: false
}
}, {
breakpoint: 992,
settings: {
slidestoshow: 2,
slidestoscroll: 1,
arrows: true,
autoplay: true
}
}, {
breakpoint: 767,
settings: {
slidestoshow: 1,
slidestoscroll: 1,
arrows: false,
autoplay: true
}
} // you can unslick at a given breakpoint now by adding:
// settings: "unslick"
// instead of a settings object
]
}); // blog slider init
var $bloginit = $(".blog-init");
$bloginit.slick({
autoplay: false,
autoplayspeed: 10000,
dots: false,
infinite: false,
arrows: true,
speed: 1000,
slidestoshow: 3,
slidestoscroll: 1,
prevarrow: '',
nextarrow: '',
responsive: [{
breakpoint: 1024,
settings: {
slidestoshow: 3,
slidestoscroll: 1,
infinite: true,
dots: false
}
}, {
breakpoint: 991,
settings: {
slidestoshow: 2,
slidestoscroll: 1,
arrows: true,
autoplay: true
}
}, {
breakpoint: 767,
settings: {
slidestoshow: 1,
slidestoscroll: 1,
arrows: false,
autoplay: true
}
}, {
breakpoint: 575,
settings: {
slidestoshow: 1,
slidestoscroll: 1,
arrows: false,
autoplay: true
}
} // you can unslick at a given breakpoint now by adding:
// settings: "unslick"
// instead of a settings object
]
}); // product-syncing
$(".product-sync-init").slick({
slidestoshow: 1,
slidestoscroll: 1,
infinite: true,
draggable: false,
arrows: false,
dots: false,
fade: true,
asnavfor: ".product-sync-nav"
});
$(".product-sync-nav").slick({
dots: false,
arrows: true,
infinite: true,
prevarrow: '',
nextarrow: '',
slidestoshow: 4,
slidestoscroll: 1,
asnavfor: ".product-sync-init",
focusonselect: true,
draggable: false
}); // product-syncing 2
$(".product-sync-init2").slick({
slidestoshow: 1,
slidestoscroll: 1,
infinite: true,
draggable: false,
arrows: false,
dots: false,
fade: true,
asnavfor: ".product-sync-nav2"
});
$(".product-sync-nav2").slick({
dots: false,
arrows: true,
infinite: true,
prevarrow: '',
nextarrow: '',
slidestoshow: 4,
slidestoscroll: 1,
asnavfor: ".product-sync-init2",
focusonselect: true,
draggable: false
}); // tooltip
$('[data-toggle="tooltip"]').tooltip(); // slider-range
$("#slider-range").slider({
range: true,
min: 0,
max: 100,
values: [0, 100],
slide: function slide(event, ui) {
$("#amount").val("€" + ui.values[0] + " - €" + ui.values[1]);
}
});
$("#amount").val("€" + $("#slider-range").slider("values", 0) + " - €" + $("#slider-range").slider("values", 1)); // slider-range end
// bs tab
$('a[data-toggle="pill"]').on("shown.bs.tab", function (e) {
e.target;
e.relatedtarget;
$(".slick-slider").slick("setposition");
}); // bs modal
$(".modal").on("shown.bs.modal", function (e) {
$(".slick-slider").slick("setposition");
}); // comment scroll down
$("#write-comment").on("click", function (e) {
e.preventdefault();
$("html, body").animate({
scrolltop: $(".theme-btn--dark3").offset().top + 750
}, 500, "linear");
}); // counter
$(".count").each(function () {
var count = $(this),
input = count.find('input[type="number"]'),
increament = count.find(".increment"),
decreament = count.find(".decrement"),
minvalue = input.attr("min"),
maxvalue = input.attr("max");
increament.on("click", function () {
var oldvalue = parsefloat(input.val());
if (oldvalue >= maxvalue) {
var newval = oldvalue;
} else {
var newval = oldvalue + 1;
}
count.find("input").val(newval);
count.find("input").trigger("change");
});
decreament.on("click", function () {
var oldvalue = parsefloat(input.val());
if (oldvalue <= minvalue) {
var newval = oldvalue;
} else {
var newval = oldvalue - 1;
}
count.find("input").val(newval);
count.find("input").trigger("change");
});
}); // sscrollup
$.scrollup({
scrollname: "scrollup",
// element id
scrolldistance: 400,
// distance from top/bottom before showing element (px)
scrollfrom: "top",
// 'top' or 'bottom'
scrollspeed: 800,
// speed back to top (ms)
easingtype: "linear",
// scroll to top easing (see http://easings.net/)
animation: "fade",
// fade, slide, none
animationspeed: 400,
// animation speed (ms)
scrolltrigger: false,
// set a custom triggering element. can be an html string or jquery object
scrolltarget: false,
// set a custom target element for scrolling to. can be element or number
scrolltext: '',
// text for element, can contain html
scrolltitle: false,
// set a custom title if required.
scrollimg: false,
// set true to use image
activeoverlay: false,
// set css color to display scrollup active point, e.g '#00ffff'
zindex: 214 // z-index for the overlay
});
})(jquery);