html
html
1
2
3
4
5
6
7
8
9
10
11
12
13
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<div class="container">
<div id="screen">
</div>
</div>
</body>
</html>
Enter to Rename, Shift+Enter to Preview
css
css
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
body {
}
#screen {
width:100%;
height:100%;
background-color: green;
position:relative;
}
.container{
position: fixed;
width: 100%;
height: 600px;
left: 0;
top: 0;
background-color: blue;
text-align:center;
}
.homeBtn{
width:200px;
height:80px;
border:5px solid yellow;
border-radius:10px;
background-color: black;
color: yellow;
font-size:40px;
Enter to Rename, Shift+Enter to Preview
js
js
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
window.onload = function() {
screenTypes=["home", "play", "help", "credits"];
screenType=screenTypes[0];
changeScreen(display(0));
}
function changeScreen(display) {
var screen = document.getElementById("screen");
screen.innerHTML = display;
}
function display(i) {
switch(i) {
case 0:
return "<div class='heading'>Spike Dodge</div> <button id='playBtn' class='homeBtn 1' onClick='playB()'>Play</button><br /> <button id='helpBtn' class='homeBtn 2' onClick='helpB()'>Help</button><br /> <button id='creditsBtn' class='homeBtn 3' onClick='creditsB()'>Credits</button>";
break;
case 1:
return "boop <button id='menuBtn' class='homeBtn 1' onClick='menuB()'>Menu</button> ";
break;
case 2:
return "yeet";
break;
case 3:
return "pong";
break;
}
return "t";
}
function playB() {
changeScreen(display(1));
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Run