-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathheader.js
More file actions
59 lines (51 loc) · 1.9 KB
/
Copy pathheader.js
File metadata and controls
59 lines (51 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
document.getElementById("header").innerHTML = `
<header class="site-header">
<div class="container nav">
<div class="brand">
<a href="/Home" class="logo" aria-label="Hexoria Netzwerk">
<img src="/images/icon/logo.png" alt="Hexoria Logo">
</a>
</div>
<nav>
<a href="/Home" class="nav-link">Home</a>
<a href="/News" class="nav-link">News</a>
<a href="/Ranks" class="nav-link">Ränge</a>
</nav>
</div>
</header>
`;
(function () {
const parts = window.location.pathname.split("/").filter(Boolean);
const current = "/" + (parts[0] || "Home");
document.querySelectorAll(".nav-link").forEach(function (link) {
if (link.getAttribute("href") === current) {
link.classList.add("active");
}
});
})();
(function () {
if (sessionStorage.getItem("maint-dismissed")) return;
const overlay = document.createElement("div");
overlay.id = "maintenance-overlay";
overlay.innerHTML = `
<div id="maintenance-box">
<button id="maintenance-close" aria-label="Schließen">×</button>
<div class="maint-badge">Wartungshinweis</div>
<div class="maint-icon">🚧</div>
<h2>Diese Seite ist veraltet</h2>
<p>Wir arbeiten gerade an einem komplett neuen Webauftritt für Hexoria.<br>
Die neue Seite kommt bald — bleib gespannt!</p>
</div>
`;
document.body.appendChild(overlay);
document.getElementById("maintenance-close").addEventListener("click", function () {
overlay.classList.add("hidden");
sessionStorage.setItem("maint-dismissed", "1");
});
overlay.addEventListener("click", function (e) {
if (e.target === overlay) {
overlay.classList.add("hidden");
sessionStorage.setItem("maint-dismissed", "1");
}
});
})();