-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmenu.js
34 lines (29 loc) · 936 Bytes
/
menu.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
$(document).ready(function () {
$("#onePlayerBtn").click(function () {
window.location.href = "index.html?mode=onePlayer";
});
$("#computerVScomputerBtn").click(function () {
window.location.href = "index.html?mode=playerVsPlayer";
});
$("#playerVsPlayerBtn").click(function () {
window.location.href = "index.html?mode=computerVScomputer";
});
});
// Handle the modal functionality
// Function to open the modal
function openModal() {
const modal = document.getElementById("instructionsModal");
modal.style.display = "block";
}
// Function to close the modal
function closeModal() {
const modal = document.getElementById("instructionsModal");
modal.style.display = "none";
}
// Close the modal if the user clicks outside of it
window.onclick = function (event) {
const modal = document.getElementById("instructionsModal");
if (event.target === modal) {
modal.style.display = "none";
}
};