nL +D 550 H ? M x ,D"v ] q v ;6 * Z qn )ZP 0 !1 A "#a$2Qr
// scroll up
let scrollPercentage = () => {
let scrollProgress = document.getElementById("progress");
let progressValue = document.getElementById("progress-value");
let pos = document.documentElement.scrollTop;
let calcHeight =
document.documentElement.scrollHeight -
document.documentElement.clientHeight;
let scrollValue = Math.round((pos * 100) / calcHeight);
scrollProgress.style.background = `conic-gradient(#937a4b ${scrollValue}%, #c0c0ff ${scrollValue}%)`;
progressValue.textContent = `${scrollValue}%`;
if (pos > 20) {
scrollProgress.classList.remove("hide");
scrollProgress.classList.add("show");
} else {
scrollProgress.classList.remove("show");
scrollProgress.classList.add("hide");
}
scrollProgress.addEventListener("click", () => {
window.scrollTo({ top: 0, behavior: "smooth" });
});
};
window.onscroll = scrollPercentage;
window.onload = scrollPercentage;
/*======================================
27. Smooth Scroll
========================================*/
if ($("#smooth-wrapper").length > 0) {
let smoother = ScrollSmoother.create({
wrapper: "#smooth-wrapper",
content: "#smooth-content",
ignoreMobileResize: true,
//preventDefault: true,
smooth: 0.8,
ease: "Power3.easeOut",
effects: true,
onUpdate: (self) => {
progress = self.progress;
},
});
}
//======< Custom Tab >======
$('.tab ul.tabs').addClass('active').find('> li:eq(0)').addClass('current');
$(".tab ul.tabs li a").on("click", function (g) {
var tab = $(this).closest('.tab'),
index = $(this).closest('li').index();
tab.find('ul.tabs > li').removeClass('current');
$(this).closest('li').addClass('current');
tab.find('.tab_content').find('div.tabs_item').not('div.tabs_item:eq(' + index + ')').slideUp();
tab.find('.tab_content').find('div.tabs_item:eq(' + index + ')').slideDown();
g.preventDefault();
});
/*======================================
05. Data Background
========================================*/
$("[data-background]").each(function () {
$(this).css(
"background-image",
"url( " + $(this).attr("data-background") + " )"
);
});
// 22. Video Modal
var v_cursor = document.getElementById("video_cursor");
var video_icon = document.querySelector(".video__area a");
if (video_icon) {
video_icon.addEventListener("mousemove", (e) => {
let x = e.clientX;
let y = e.clientY;
v_cursor.style.top = y + "px";
v_cursor.style.left = x + "px";
v_cursor.style.transform = "translate(-50%, -50%) scale(1)";
});
video_icon.addEventListener("mouseout", (e) => {
v_cursor.style.transform = "translate(-50%, -50%) scale(0)";
});
}
// testimonial Active
$('.testi_list').owlCarousel({
loop: true,
autoplay: false,
smartSpeed: 1500,
autoplayTimeout: 2800,
dots:true,
nav: false,
margin: 30,
navText: ["<i class='bi bi-chevron-left''></i>", "<i class='bi bi-chevron-right''></i>"],
responsive: {
320: {
items: 1
},
480: {
items:1
},
600: {
items: 1
},
768: {
items: 1
},
992: {
items: 2
},
1000: {
items: 2
},
1920: {
items: 2
}
}
})
// testimonial Active
$('.portfolio_active').owlCarousel({
loop: true,
autoplay: false,
smartSpeed: 1500,
autoplayTimeout: 2800,
dots:true,
nav: true,
margin: 30,
navText: ['<i class="fa-solid fa-arrow-left"></i>', '<i class="fa-solid fa-arrow-right"></i>'],
responsive: {
320: {
items: 1
},
480: {
items:1
},
600: {
items: 1
},
768: {
items: 1
},
992: {
items: 2
},
1000: {
items: 3
},
1920: {
items: 3
}
}
})
// Case Study Active
$('.brand-list').owlCarousel({
loop: true,
autoplay:true,
smartSpeed: 1500,
autoplayTimeout: 1500,
dots:false,
nav: false,
margin:30,
navText: ["<i class='bi bi-arrow-left''></i>", "<i class='bi bi-arrow-right''></i>"],
responsive: {
0: {
items: 1
},
600: {
items: 2
},
768: {
items: 3
},
992: {
items: 4
},
1200: {
items: 4
},
1920: {
items:5
}
}
})