-
Notifications
You must be signed in to change notification settings - Fork 197
/
index.html
64 lines (59 loc) · 1.67 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
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<!--
Copyright (C) 2012 id Software LLC, a ZeniMax Media company.
This file is part of the WOLF3D Browser Version GPL Source Code.
-->
<meta charset="UTF-8">
<title>Test Page</title>
<style>
body {
background-color : black;
text-align : center;
}
#wolf3d {
margin-top : 100px;
border : none;
width : 640px;
height : 400px;
}
</style>
</head>
<body>
<iframe id="wolf3d" src="wolf3d.html" mozallowfullscreen="true" webkitallowfullscreen="true">
</iframe>
<script>
window.onfocus = function() {
var game = window.frames[0];
if (game) {
game.focus();
}
};
window.oncontextmenu = function(e) {
if (e.preventDefault) {
e.preventDefault();
}
var game = window.frames[0];
if (game && game.Wolf && game.Wolf.Input) {
if (game.Wolf.Input.rightMouseDown()) {
game.Wolf.Input.resetMouse();
}
}
return false;
}
window.onmouseup = function(e) {
var game = window.frames[0];
if (game && game.Wolf && game.Wolf.Input) {
if (game.Wolf.Input.rightMouseDown() || game.Wolf.Input.leftMouseDown()) {
game.Wolf.Input.resetMouse();
if (e.preventDefault) {
e.preventDefault();
}
return false;
}
}
}
</script>
</body>
</html>