pint/public/pint-newinstall/assets/js/script.min.js
2022-08-03 04:29:35 +00:00

56 lines
1.7 KiB
JavaScript

!(function () {
"use strict";
var e = document.querySelector("#mainNav");
if (e) {
var n = function () {
(void 0 !== window.pageYOffset
? window.pageYOffset
: (
document.documentElement ||
document.body.parentNode ||
document.body
).scrollTop) > 100
? e.classList.add("navbar-shrink")
: e.classList.remove("navbar-shrink");
};
n(), document.addEventListener("scroll", n);
}
document.getElementsByClassName("popup-gallery").length > 0 &&
baguetteBox.run(".popup-gallery", { animation: "slideIn" }),
(function () {
if (
"requestAnimationFrame" in window &&
!/Mobile|Android/.test(navigator.userAgent)
) {
var e = document.querySelectorAll("[data-bss-parallax]");
if (e.length) {
var n,
t = [];
window.addEventListener("scroll", a),
window.addEventListener("resize", a),
a();
}
}
function a() {
t.length = 0;
for (var a = 0; a < e.length; a++) {
var r = e[a].getBoundingClientRect(),
i =
parseFloat(e[a].getAttribute("data-bss-parallax-speed"), 10) ||
0.5;
r.bottom > 0 &&
r.top < window.innerHeight &&
t.push({ speed: i, node: e[a] });
}
cancelAnimationFrame(n), t.length && (n = requestAnimationFrame(o));
}
function o() {
for (var e = 0; e < t.length; e++) {
var n = t[e].node,
a = t[e].speed;
n.style.transform =
"translate3d(0, " + -window.scrollY * a + "px, 0)";
}
}
})();
})();