-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmaze.html
More file actions
80 lines (80 loc) · 3.58 KB
/
maze.html
File metadata and controls
80 lines (80 loc) · 3.58 KB
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>V-Day</title>
<link rel="stylesheet" type="text/css" href="styles.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
<link href="https://fonts.googleapis.com/css?family=Calligraffitti|Kalam|Satisfy" rel="stylesheet">
<script type="text/javascript">
function NextInput(x) {
if (x.value.length >= 1) {
// console.log(parseInt(x.id) + 1);
document.getElementById(parseInt(x.id) + 1).select();
}
}
function DeletePress(x) {
var key = event.keyCode;
if (key == 8) {
if (x.value.length < 1) {
previous = document.getElementById(parseInt(x.id) - 1);
previous.focus();
}
}
}
function SubmitKey() {
var key = "";
var i = 1;
while (i < 8) {
key += document.getElementById(i).value;
i++;
}
if (key.toUpperCase() === 'GIRASOL') {
var maze = document.getElementById('maze');
var center = document.getElementById('center');
var info = document.getElementById('info');
maze.style.visibility = "hidden";
maze.style.opacity = "0";
center.style.visibility = "visible";
center.style.opacity = "1";
info.style.visibility = "visible";
info.style.opacity = "1";
}
else {
alert('Wrong!');
}
}
</script>
</head>
<body>
<div class="maze" id="maze">
<form>
<input type="text" name="1" id="1" maxlength="1" onclick="this.select()" oninput="NextInput(this)" autofocus>
<input type="text" name="2" id="2" maxlength="1" onclick="this.select()" oninput="NextInput(this)" onkeydown="DeletePress(this)">
<input type="text" name="3" id="3" maxlength="1" onclick="this.select()" oninput="NextInput(this)" onkeydown="DeletePress(this)">
<input type="text" name="4" id="4" maxlength="1" onclick="this.select()" oninput="NextInput(this)" onkeydown="DeletePress(this)">
<input type="text" name="5" id="5" maxlength="1" onclick="this.select()" oninput="NextInput(this)" onkeydown="DeletePress(this)">
<input type="text" name="6" id="6" maxlength="1" onclick="this.select()" oninput="NextInput(this)" onkeydown="DeletePress(this)">
<input type="text" name="7" id="7" maxlength="1" onclick="this.select()" onkeydown="DeletePress(this)">
</form>
<div class="button" onclick="SubmitKey()">Submit</div>
<h6>hint: the key to the maze is a flower</h6>
</div>
<div class="center" id="center">
<div class="info" id="info">
<div class="title">
<i class="fa fa-check-circle fa-2x" aria-hidden="true"></i> <h2>Reservation Confirmed</h2>
</div>
<h3>Girasol</h3>
<img src="prize.jpg" class="prize">
<h4>Table for 2</h4>
<h4>Friday, March 3, 2017 at 8:00 pm</h4>
<h4>11334 Moorpark St., Studio City, CA</h4>
<img src="heart.png" class="heart">
<a href="http://girasolrestaurant.com/">girasolrestaurant.com</a>
</div>
</div>
</body>
</html>