-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmenu.html
64 lines (60 loc) · 2.31 KB
/
menu.html
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Irish+Grover&family=Italiana&family=Urbanist:ital,wght@0,100..900;1,100..900&display=swap" rel="stylesheet">
<link rel="stylesheet" href="./menuPage.css" >
<title>Chain Reaction</title>
</head>
<body>
<div id="Container">
<div id="logoBox">
<p>CHAIN REACTI</p>
<img id="ballImg" src="./redBall.png" />
<p>N</p>
</div>
<div id="menuBox">
<p>Number Of Players</p>
<div id="numberBoxContainer">
<div class="numBox">1</div>
<div class="numBox">2</div>
<div class="numBox">3</div>
<div class="numBox">4</div>
<div class="numBox">5</div>
<div class="numBox">6</div>
<div class="numBox">7</div>
<div class="numBox">8</div>
</div>
<div id="GridSizeBox">
<p>Grid Size</p>
<input id="gBox" type="number" min="6" max="15" placeholder="Enter Grid Size" >
</div>
</div>
<div id="lastBox">
<button class="btn" onclick="nextPage()">Start</button>
<p id="BlinkingText">Customise Names</p>
</div>
</div>
<footer>
</footer>
<script>
const ColorArray = ["FF8989","BFFF6E","88C6FF","FF85B8","FFEBB5","C8AEFF","FF8C5C","FFE8E8"]
let numBoxArray = document.querySelectorAll(".numBox");
let n;
numBoxArray.forEach((box,index)=>{
box.style.backgroundColor = "#"+ColorArray[index];
box.addEventListener("click",()=>{
n = index+1;
});
});
function nextPage(){
localStorage.setItem("count",n);
localStorage.setItem("gridSize",document.getElementById("gBox").value);
window.location.href = "./game.html";
}
</script>
</body>
</html>