forked from confluentinc/demo-scene
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
51 lines (42 loc) · 1.34 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
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no" />
</head>
<style>
input {
max-width: 200px;
border-radius: 8px;
padding: 0 0.5em;
font-size: 20px;
}
</style>
<script>
function checkName() {
if (window.name != null | window.name.length > 0) {
document.getElementById("user").value = window.name;
}
}
function enter(e) {
if (event.which == 13 || event.keyCode == 13) {
play();
}
}
function play() {
var user = document.getElementById("user").value;
if (user == '') {
alert('You need to provide a name.');
return;
}
window.name = user;
window.location.href = "start.html";
}
</script>
<body bgcolor="black" onload="checkName()">
<center>
<img src="game/img/pac-man-logo.png" width="300" height="200" />
<h3 style="color:white;">Enter your Name:</h3>
<input type="text" id="user" value="" onkeydown="enter(event)" />
<input type="button" value="Play" onclick="play()" />
</center>
</body>
</html>