Szabo Ivan c168da359e implement complete frontend:
- add lobby, game, leaderboard, results pages
- add scripts: storage, lobby, game, drawing, scoring, countries
- add styles: main, lobby, game
- unify header/footer across all pages
- show lobby name in lobby view
- remove clear board from leaderboard
2026-05-05 13:01:14 +02:00

28 lines
655 B
JavaScript

document.getElementById("reg-btn")?.addEventListener("click", () => {
const lobbyInput = document.getElementById("username");
const lobbyName = lobbyInput ? lobbyInput.value.trim() : "";
if (lobbyName) {
Storage.saveLobbyName(lobbyName);
window.location.href = "lobby.html";
} else {
lobbyInput?.focus();
}
});
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);
});