-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
112 lines (108 loc) · 4.62 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
<head>
<title>Multiplayer space game</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="lib/1.0.6_material.min.js"></script>
<link rel="stylesheet" href="lib/1.1.3_material.indigo-pink.min.css">
<style>
.demo-card-wide.mdl-card {
width: 512px;
}
.demo-card-wide > .mdl-card__title {
color: #fff;
height: 176px;
background: url('res/html/welcome_card.jpg') center / cover;
}
.demo-card-wide > .mdl-card__menu {
color: #fff;
}
body {
background-image:url('res/html/darkPurple.png')
}
.centered{
position: fixed;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}
</style>
</head>
<body>
<div class="demo-card-wide mdl-card mdl-shadow--2dp centered">
<div class="mdl-card__title">
<h2 class="mdl-card__title-text">Multiplayer Space Game</h2>
</div>
<div class="mdl-card__supporting-text">
You need to set the multiplayer parameters before starting
</div>
<div class="mdl-card__actions">
<form>
<label class="mdl-radio mdl-js-radio mdl-js-ripple-effect" for="option-sp">
<input type="radio" id="option-sp" class="mdl-radio__button" name="options" value="1" checked>
<span class="mdl-radio__label">Single player</span>
</label>
<label class="mdl-radio mdl-js-radio mdl-js-ripple-effect" for="option-server">
<input type="radio" id="option-server" class="mdl-radio__button" name="options" value="2">
<span class="mdl-radio__label">Server</span>
</label>
<label class="mdl-radio mdl-js-radio mdl-js-ripple-effect" for="option-client">
<input type="radio" id="option-client" class="mdl-radio__button" name="options" value="3">
<span class="mdl-radio__label">Client</span>
</label>
</form>
<form action="#">
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<input class="mdl-textfield__input" type="text" id="textName">
<label class="mdl-textfield__label" for="textName">Match name</label>
</div>
</form>
</div>
<div class="mdl-card__actions">
Audio volume
<input id="volume-slider" class="mdl-slider mdl-js-slider" type="range" min="0" max="100" value="100" tabindex="0">
</div>
<div class="mdl-card__actions mdl-card--border">
<a class="mdl-button mdl-button--colored mdl-js-button mdl-js-ripple-effect" onclick="onPlayClick();">
Play
</a>
</div>
</div>
<script>
function onPlayClick(){
var spRadioButton = document.getElementById("option-sp");
var serverRadioButton = document.getElementById("option-server");
var nameTextInput = document.getElementById("textName");
var volumeInput = document.getElementById("volume-slider");
var urlParameters = {};
if (spRadioButton.checked)
{
urlParameters.type = "sp";
}
else if (serverRadioButton.checked)
{
urlParameters.type = "server";
}
else
{
urlParameters.type = "client";
}
var name = nameTextInput.value;
if (name === "")
{
name = "empty";
}
urlParameters.name = name;
urlParameters.volume = volumeInput.value;
window.location.href = "game.html?" + JSON.stringify(urlParameters);
}
</script>
</body>
</html>