- 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
28 lines
655 B
JavaScript
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);
|
|
});
|