forked from pjnovas/invaders404
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
144 lines (130 loc) · 4.85 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>FernetJS Invaders</title>
<!--
<script type="text/javascript" src="scripts/classes/class.js"></script>
<script type="text/javascript" src="scripts/classes/static.js"></script>
<script type="text/javascript" src="scripts/classes/imageMapper.js"></script>
<script type="text/javascript" src="scripts/classes/imageCreator.js"></script>
<script type="text/javascript" src="scripts/classes/drawableElement.js"></script>
<script type="text/javascript" src="scripts/classes/shoot.js"></script>
<script type="text/javascript" src="scripts/classes/ship.js"></script>
<script type="text/javascript" src="scripts/classes/invasion.js"></script>
<script type="text/javascript" src="scripts/classes/alien.js"></script>
<script type="text/javascript" src="scripts/classes/brick.js"></script>
<script type="text/javascript" src="scripts/classes/shieldBrick.js"></script>
<script type="text/javascript" src="scripts/classes/shield.js"></script>
<script type="text/javascript" src="scripts/classes/invaders.js"></script>
-->
<script type="text/javascript" src="invaders404.min.js"></script>
<script type="text/javascript">
var invaders;
window.addEventListener('load', function(){
initInvaders404();
});
document.documentElement.addEventListener('keypress', function(ev){
var keycd = ev.which || ev.keyCode;
if(ev.ctrlKey && [10, 13].indexOf(keycd) !== -1 && invaders){
invaders.goFullscreen();
}
});
function play (){
var splash = document.getElementById('splash');
splash.style.display = "none";
splash.style.opacity = 0;
invaders.start();
}
function showSplash(){
invaders.drawSplash(function (){
var splash = document.getElementById('splash');
splash.style.display = "block";
setInterval(function(){
var opa = parseFloat(splash.style.opacity) || 0;
if (opa < 1){
splash.style.opacity = opa + 0.2;
}
}, 200);
});
}
function initInvaders404(){
invaders = new Invaders404({
onLoose: function(){
showSplash();
window.invaders.exitFullscreen();
},
onWin: function(){
showSplash();
}
});
invaders.start();
}
</script>
<style type="text/css">
.ctn {
width: 600px;
height: 400px;
position: relative;
}
#splash {
position: absolute;
width: 600px;
height: 400px;
top: 0;
left:0;
background-image: url('fernetjs-invaders.png');
opacity: 0;
display:none;
z-index: 2;
text-align: right;
float: right;
}
#splash a {
font-family: Verdana;
font-size: 12pt;
text-decoration: none;
color: #323330;
margin: 40px;
line-height: 4;
}
#canvas404 {
border-radius: 10px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border: 1px solid silver;
background-color:#000;
}
#canvas404:fullscreen {
width: 100% !important;
height: 100% !important;
display: block;
}
#canvas404:-webkit-full-screen {
width: 100% !important;
height: 100% !important;
display: block;
}
#canvas404:-moz-full-screen {
width: 100% !important;
height: 100% !important;
display: block;
}
</style>
</head>
<body>
<h1>FernetJS Invaders 404</h1>
<div class="ctn">
<canvas id="canvas404" width="600" height="400">
FernetJS Invaders 404 - Not Found
</canvas>
<div id="splash">
<a href="#" onclick="play();" style="font-size: 26px;">Jugar!</a>
<br/>
<a href="https://github.com/pjnovas/invaders404" target="_blank">[código fuente]</a>
</div>
</div>
<span id="fps"></span>
</body>
</html>