main.js
1.19 KB
(function () {
const o = document.createElement("link").relList;
if (o && o.supports && o.supports("modulepreload")) return;
for (const e of document.querySelectorAll('link[rel="modulepreload"]')) s(e);
new MutationObserver((e) => {
for (const t of e)
if (t.type === "childList")
for (const n of t.addedNodes)
n.tagName === "LINK" && n.rel === "modulepreload" && s(n);
}).observe(document, { childList: !0, subtree: !0 });
function i(e) {
const t = {};
return (
e.integrity && (t.integrity = e.integrity),
e.referrerPolicy && (t.referrerPolicy = e.referrerPolicy),
e.crossOrigin === "use-credentials"
? (t.credentials = "include")
: e.crossOrigin === "anonymous"
? (t.credentials = "omit")
: (t.credentials = "same-origin"),
t
);
}
function s(e) {
if (e.ep) return;
e.ep = !0;
const t = i(e);
fetch(e.href, t);
}
})();
document.addEventListener("scroll", () => {
const r = document.getElementById("navbar");
window.scrollY > 50
? (r.classList.add("bg-white"), r.classList.remove("bg-transparent"))
: (r.classList.add("bg-transparent"), r.classList.remove("bg-white"));
});