JusTalk / static /menu.js
rein0421's picture
Upload 10 files
8b37e01 verified
// Show user registration page
function showUserRegister() {
fetch("/reset");
window.location.href = "userregister";
}
// メンバー選択画面表示
function showUserSelect() {
window.location.href = "/userselect";
}
// Show recorder page
function showRecorder() {
window.location.href = "index";
}
// Show results page
function showResults() {
window.location.href = "feedback";
}
// Show talk detail page
function showTalkDetail() {
window.location.href = "talk_detail";
}
// Reset action page
function resetAction() {
window.location.href = "reset_html";
}
// Toggle hamburger menu visibility
function toggleMenu(event) {
event.stopPropagation(); // Prevents click event from propagating to the document
const menu = document.getElementById("menu");
menu.classList.toggle("open");
}
// Close the menu if clicked outside
function closeMenu(event) {
const menu = document.getElementById("menu");
if (
menu.classList.contains("open") &&
!menu.contains(event.target) &&
!event.target.closest("#menuButton")
) {
menu.classList.remove("open");
}
}
// Add event listener for closing the menu when clicking outside
document.addEventListener("click", closeMenu);
// Show recorder page 名前に気を付けて!
document.getElementById("add-btn").addEventListener("click", showRecorder);