-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
102 lines (99 loc) · 3.3 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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Frogger 3D</title>
<style>
@font-face {
font-family: 'font';
src: url('font.ttf') format('truetype');
}
body {
margin: 0;
overflow: hidden;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
background: url('background.jpg') center/cover no-repeat;
}
#canvas-container {
position: relative;
width: 512px; /* Width of the canvas */
height: 512px; /* Height of the canvas */
}
canvas {
position: absolute;
top: 0;
left: 0;
border: 5px solid black;
}
.modal {
/* display: none; Hidden by default */
position: fixed; /* Stay in place */
z-index: 100; /* Sit on top */
left: 0;
top: 0;
width: 100%; /* Full width */
height: 100%; /* Full height */
overflow: auto; /* Enable scroll if needed */
background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}
.modal-content {
background-color: #fefefe;
margin: 15% auto; /* 15% from the top and centered */
padding: 20px;
border: 1px solid #888;
width: 30%; /* Could be more or less, depending on screen size */
font-family: 'font', sans-serif;
font-size: larger;
}
.hidden {
display: none;
}
#speedInputDiv {
font-family: 'font', sans-serif;
font-size: larger;
position: fixed;
top: 10px;
left: 35%;
background-color: white;
padding: 10px;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}
</style>
</style>
<script type="text/javascript" src="gl-matrix.js"></script>
<script type="text/javascript" src="rasterize2.js"></script>
</head>
<body onload="main();">
<div id="speedInputDiv" class="hidden">
<label for="speedMultiplier">Speed Multiplier:</label>
<input type="number" id="speedMultiplier" min="1" value="1">
<button onclick="setSpeedMultiplier()">Set</button>
</div>
<div id="scoreDiv" style="font-family: 'font', sans-serif; position: fixed; top: 115px; margin-left: 1030px; font-size: larger;">
<h3>Score: 0</h3>
</div>
<div id="livesDiv" style="font-family: 'font', sans-serif; position: fixed; top: 145px; margin-left: 1030px; font-size: larger;">
<h3>Lives: 3</h3>
</div>
<div style="font-family: 'font', sans-serif; position: fixed; bottom: 15px; left: 11%; font-size: large;">
<p>• Use arrow keys to move.</p>
<p>• Jump the 5 frogs directly into their 5 houses on top to win!</p>
<p>• You only get three lives!</p>
<p>• Press "!" to change the difficulty and test your skills!</p>
</div>
<div id="gameModal" class="modal hidden">
<div class="modal-content">
<p id="gameMessage"></p>
<button onclick="closeModal()">OK</button>
</div>
</div>
<div id="canvas-container">
<canvas id="myWebGLCanvas" width="512" height="512"></canvas>
</div>
</body>
</html>