TanchoToplineCargo/public/topCargo/assets/js/scripts.min.js
2024-05-05 10:32:49 +05:45

122 lines
7.7 KiB
JavaScript

var cargohub = cargohub || {};
! function(e) {
"use strict";
e(function() {
var a = e("body"),
t = e(window),
i = e("#masthead"),
s = e("#primary-mobile-nav"),
n = e(".header-transparent .site-header"),
o = e(".post-type-archive-project .content-area .list-project");
t.scroll(function() {
e(window).scrollTop() > e(window).height() ? e("#scroll-top").addClass("show-scroll") : e("#scroll-top").removeClass("show-scroll")
}), e("#scroll-top").on("click", function(a) {
a.preventDefault(), e("html, body").stop().animate({
scrollTop: 0
}, 1200)
}), e(".gallery").each(function() {
var a = e(this);
a.find(".gallery-item a").attr("rel", a.attr("id")).addClass("fancybox")
}), e(".fancybox").fancybox({
openEffect: "none",
closeEffect: "none"
}), t.on("resize", function() {
var s, o, l;
o = t.width() < 1200 && a.hasClass("hide-topbar-mobile") ? 0 : e(".topbar").outerHeight(!0), a.hasClass("admin-bar") ? (n.css({
top: o + 32
}), e(".header-v4 .site-header").css({
top: o + 32
})) : (n.css({
top: o
}), e(".header-v4 .site-header").css({
top: o
})), t.on("scroll", function() {
o = t.width() < 1200 && a.hasClass("hide-topbar-mobile") ? 0 : e(".topbar").outerHeight(!0), l = o, (a.hasClass("header-v4") || a.hasClass("header-v3")) && (l = o + e(".site-contact").outerHeight(!0)), t.scrollTop() > l ? (i.addClass("minimized"), e("#fh-header-minimized").addClass("minimized")) : (i.removeClass("minimized"), e("#fh-header-minimized").removeClass("minimized"))
}), s = a.hasClass("header-v3") && t.width() > 1199 ? e(".site-menu").outerHeight(!0) : i.outerHeight(!0), a.hasClass("header-sticky") && e("#fh-header-minimized").height(s)
}).trigger("resize"), e(window).load(function() {
e(".fh-latest-project").find(".list-project").isotope({
itemSelector: ".project",
layoutMode: "fitRows"
}), e("ul.filter li.active").trigger("click")
}), e("ul.filter").on("click", "li", function(a) {
a.preventDefault();
var t = e(this),
i = t.attr("data-option-value");
t.hasClass("active") || (t.closest(".filters-dropdown").next(".list-project").isotope({
filter: i
}), t.addClass("active").siblings(".active").removeClass("active"))
})/*, o.imagesLoaded(function() {
var e = {
itemSelector: ".project-wrapper",
percentPosition: !0
};
a.hasClass("project-mansony") && (e.masonry = {
columnWidth: ".project-sizer"
}), o.isotope(e)
})*/, a.on("click", ".quantity .increase, .quantity .decrease", function(a) {
a.preventDefault();
var t = e(this),
i = t.siblings(".qty"),
s = parseInt(i.val(), 10),
n = parseInt(i.attr("min"), 10),
o = parseInt(i.attr("max"), 10);
o = o || s + 1, t.hasClass("decrease") && s > n && (i.val(s - 1), i.trigger("change")), t.hasClass("increase") && s < o && (i.val(s + 1), i.trigger("change"))
}), e(".project-carousel").owlCarousel({
items: 1,
loop: !0,
navSpeed: 800,
nav: !1,
dots: !0,
autoPlay: !0,
dotsSpeed: 1e3,
navText: ['<i class="fa fa-chevron-left" aria-hidden="true"></i>', '<i class="fa fa-chevron-right" aria-hidden="true"></i>']
});
/*for (var l = e(".page-header .header-title"), r = 0; r < l.length; r++) e(l[r]).parallax("50%", .6);
e(".post-type-archive-project").find(".numeric-navigation").on("click", ".page-numbers.next", function(t) {
if (t.preventDefault(), !e(this).data("requestRunning")) {
e(this).data("requestRunning", !0), e(this).addClass("loading");
var i = e(this).parents(".numeric-navigation").prev(".list-project"),
s = e(this).parents(".numeric-navigation");
e.get(e(this).attr("href"), function(t) {
var n = e(t).find(".list-project").html(),
o = e(t).find(".numeric-navigation").html(),
l = e(n);
s.html(o), a.hasClass("project-nav-ajax") ? l.imagesLoaded(function() {
i.isotope("insert", l), s.find(".page-numbers.next").removeClass("loading")
}) : (i.append(l), s.find(".page-numbers.next").removeClass("loading")), s.find(".page-numbers.next").data("requestRunning", !1)
})
}
}),*/ e("#off-canvas-layer").on("click", function(e) {
e.preventDefault(), a.removeClass("display-mobile-menu")
}), a.on("click", ".navbar-toggle", function(t) {
t.preventDefault(), e(this).toggleClass("selected-mobile"), a.toggleClass("display-mobile-menu")
}), e("ul.menu li.menu-item-has-children a").addClass("dropdown-toggle"), a.on("click", "#toggle-search", function(a) {
a.preventDefault(), e(this).parents(".topbar-search").toggleClass("display-search")
}), a.on("click", ".menu-item-search .toggle-search", function(a) {
a.preventDefault(), e(this).parents(".menu-item-search").toggleClass("display-search")
}), s.find(".menu .menu-item-has-children").prepend('<span class="toggle-children "><i class="fa fa-angle-right" aria-hidden="true"></i></span>'), s.find(".menu .menu-item-has-children").each(function() {
var a = "";
e(this).children("a").hasClass("dropdown-toggle") && (a = e(this).children(".dropdown-toggle").html()), e(this).children("ul").prepend('<li class="menu-parent-items">' + a + "</li>"), e(this).children("ul").prepend('<li class="menu-back">' + cargohub.cargohub_back + "</li>")
}), s.find(".menu .menu-item-has-children").on("click", ".toggle-children", function(a) {
a.preventDefault(), e(this).parent("li").addClass("over-menu"), e(this).parents(".menu").addClass("over-submenu")
}), s.find(".menu .menu-item-has-children").on("click", ".menu-back", function(a) {
a.preventDefault(), e(this).closest("ul").closest("li").removeClass("over-menu"), s.find(".menu .menu-item-has-children").hasClass("over-menu") || s.find(".menu").removeClass("over-submenu")
}), s.on("click", ".close-canvas-mobile-panel", function(e) {
e.preventDefault(), a.toggleClass("display-mobile-menu")
}),
function() {
var a = e(".office-location .office-switcher ul li"),
t = a.filter(":first"),
i = e(".office-location .office-switcher a"),
s = e(".office-location .topbar-office");
t.addClass("active"), s.filter(":first").addClass("active"), i.html(t.html()), i.on("click", function(a) {
var t = e(this);
a.preventDefault(), t.parent().toggleClass("show-office")
}), a.on("click", function() {
var t = e(this),
n = t.attr("data-tab");
t.hasClass("active") || (i.html(t.html()), i.parent().toggleClass("show-office"), a.removeClass("active"), s.removeClass("active"), t.addClass("active"), e("#" + n).addClass("active"))
})
}()
})
}(jQuery);