-
Notifications
You must be signed in to change notification settings - Fork 44
/
index.html
56 lines (49 loc) · 1.48 KB
/
index.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
<html>
<head>
<link rel="stylesheet" type="text/css" href="stylesmenu.css">
<script type="text/javascript" src="lib/keyboard.js"></script>
<script>
function openNewGameMenu() {
var menu = document.getElementById("newGameMenu");
var menuHeight = screen.height / 2;
var menuWidth = screen.width / 4.2;
menu.style.height = menuHeight + "px";
menu.style.width = menuWidth + "px";
menu.style.marginTop = "-" + (menuHeight/2).toString() + "px";
menu.style.marginLeft = "-" + (menuWidth/2).toString() + "px";
menu.style.visibility = "visible";
}
function closeGameMenu() {
var menu = document.getElementById("newGameMenu");
console.log(menu);
menu.style.visibility = "hidden";
}
function startGame() {
var e = document.getElementById("map");
var map = e.options[e.selectedIndex].value;
window.location = "game.html#" + map;
}
</script>
</head>
<body>
<table id="menu">
<tr>
<td><a href="#" onClick="openNewGameMenu()">New Game</a></td>
</tr>
<tr>
<td><a href="#">Find Servers</a></td>
</tr>
</table>
<div id="newGameMenu" style="visibility:hidden;">
Map
<select id="map">
<option value="">< Random Map ></option>
<option value="cs_assault.bsp">cs_assault</option>
<option value="cs_italy.bsp">cs_italy</option>
</select>
<hr />
<button id="menuStartButton" onclick="startGame()">Start</button>
<button id="menuCancelButton" onclick="closeGameMenu()">Cancel</button>
</div>
</body>
</html>