niklas #2
@ -99,7 +99,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="footer__center">
|
<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>
|
<p class="footer__sub">Browser geography game</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@ -17,7 +17,6 @@ const elTimerNum = document.getElementById("timer-num");
|
|||||||
const elTimerBar = document.getElementById("timer-bar");
|
const elTimerBar = document.getElementById("timer-bar");
|
||||||
const elBtnClear = document.getElementById("btn-clear");
|
const elBtnClear = document.getElementById("btn-clear");
|
||||||
const elBtnSubmit = document.getElementById("btn-submit");
|
const elBtnSubmit = document.getElementById("btn-submit");
|
||||||
const elCanvas = document.getElementById("draw-canvas");
|
|
||||||
|
|
||||||
// ── Init
|
// ── Init
|
||||||
async function initGame() {
|
async function initGame() {
|
||||||
|
|||||||
@ -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));
|
|
||||||
});
|
|
||||||
Loading…
x
Reference in New Issue
Block a user