fix: remove dead main.js, fix lobby footer link, clean up game.js

This commit is contained in:
pengniklas 2026-05-22 16:22:50 +02:00
parent 5a94f26d0c
commit 6d854eb4a7
3 changed files with 1 additions and 38 deletions

View File

@ -99,7 +99,7 @@
</div>
<div class="footer__center">
<a href="html" class="footer__brand">GeoDraw</a>
<a href="index.html" class="footer__brand">GeoDraw</a>
<p class="footer__sub">Browser geography game</p>
</div>

View File

@ -17,7 +17,6 @@ const elTimerNum = document.getElementById("timer-num");
const elTimerBar = document.getElementById("timer-bar");
const elBtnClear = document.getElementById("btn-clear");
const elBtnSubmit = document.getElementById("btn-submit");
const elCanvas = document.getElementById("draw-canvas");
// ── Init
async function initGame() {

View File

@ -1,36 +0,0 @@
// main.js — index.html
document.addEventListener("DOMContentLoaded", () => {
// Smooth scroll for nav links
document.querySelectorAll('a[href^="#"]').forEach(link => {
link.addEventListener("click", e => {
const id = link.getAttribute("href").slice(1);
const target = document.getElementById(id);
if (!target) return;
e.preventDefault();
const headerH = document.querySelector(".header")?.offsetHeight || 0;
const top = target.getBoundingClientRect().top + window.scrollY - headerH - 16;
window.scrollTo({ top, behavior: "smooth" });
});
});
// Register button stub
const regBtn = document.getElementById("reg-btn");
if (regBtn) {
regBtn.addEventListener("click", () => {
alert("Frontend skeleton only. Backend will be connected later.");
});
}
// Scroll reveal
const reveals = document.querySelectorAll(".reveal");
const io = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
entry.target.classList.add("visible");
io.unobserve(entry.target);
}
});
}, { threshold: 0.12 });
reveals.forEach(el => io.observe(el));
});