-
Notifications
You must be signed in to change notification settings - Fork 1
/
play.html
240 lines (220 loc) · 6.28 KB
/
play.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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="Asciidoctor 2.0.17">
<link rel="icon" type="image/png" href="images/favicon.png">
<title>Obsidian Level Generator</title>
<style>
@import "css/asciidoctor.css";
@import "fonts/source-sans-3.css";
.edge {
border: 0;
overflow: hidden;
display: inline;
width: 320px;
height: 240px;
}
@media screen and (min-width: 700px) and (min-height: 530px) {
.edge {
width: 640px;
height: 480px;
}
}
@media screen and (min-width: 1366px) and (min-height: 770px) {
.edge {
width: 1280px;
height: 720px;
}
}
#content {
max-width: none;
}
.sect1 {
padding-left: 5%;
padding-right: 5%;
padding-top: 50px;
}
.navbar {
width: 100%;
height: 50px;
background-color: #282827;
top:0;
position: fixed;
overflow: hidden;
}
.logo {
display: inline-block;
vertical-align: middle;
}
.navbar > a {
display: inline-block;
vertical-align: top;
margin-right: 5px;
margin-left: 5px;
height: 50px;
line-height: 50px;
text-decoration: none;
}
a {
color: #E8E8E8;
}
a:active,
a:hover,
a:focus {
color: #F0DEA3;
outline: 0;
}
body {
background: #282827;
color: #E8E8E8;
font-family: "Source Sans 3";
font-weight: 400;
font-style: normal;
}
.admonitionblock > table td.content {
padding-left: 1.125em;
padding-right: 1.25em;
border-left: 1px solid #E8E8E8;
color: #E8E8E8;
font-family: "Source Sans 3";
font-weight: 400;
font-style: normal;
word-wrap: anywhere;
}
.admonitionblock > table td.icon .title {
color: #E8E8E8;
font-family: "Source Sans 3";
font-weight: 700;
font-style: normal;
text-transform: uppercase;
}
.subheader,
.admonitionblock td.content > .title,
.audioblock > .title,
.exampleblock > .title,
.imageblock > .title,
.listingblock > .title,
.literalblock > .title,
.stemblock > .title,
.openblock > .title,
.paragraph > .title,
.quoteblock > .title,
table.tableblock > .title,
.verseblock > .title,
.videoblock > .title,
.dlist > .title,
.olist > .title,
.ulist > .title,
.qlist > .title,
.hdlist > .title {
line-height: 1.45;
color: #F0DEA3;
font-family: "Source Sans 3";
font-weight: 600;
font-style: italic;
margin-top: 0;
margin-bottom: 0.25em;
}
h1,
h2,
h3,
#toctitle,
.sidebarblock > .content > .title,
h4,
h5,
h6 {
color: #F0DEA3;
font-family: "Source Sans 3";
font-weight: 700;
font-style: normal;
}
</style>
</head>
<body class="article">
<div id="header">
</div>
<div id="content">
<div class="navbar">
<a href="index.html"><img class="logo" src="images/home.png" style="height:25px"></a>
<a href="downloads.html"><img class="logo" src="images/download.png" style="height:25px"></a>
<a href="addons.html"><img class="logo" src="images/addons.png" style="height:25px"></a>
<a href="credits.html"><img class="logo" src="images/credits.png" style="height:25px"></a>
<a href="play.html"><img class="logo" src="images/play.png" style="height:25px"></a>
<a href="https://discord.gg/dfqCt9v"><img class="logo" src="images/discord.png" style="height:25px"></a>
<a href="https://github.com/obsidian-level-maker/Obsidian"><img class="logo" src="images/github.png" style="height:25px"></a>
</div>
<div class="sect1">
<h2 id="_demo">Demo</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Try a level generated by Obsidian from the comfort of your browser, powered by <a href="https://freedoom.github.io">Freedoom</a> and <a href="https://edge-classic.github.io">EDGE-Classic</a>. If this is your first time playing the demo, startup will take a little bit longer as you fetch and cache Freedoom 2 and the map. Click inside the play window to capture the cursor; press Escape to release it. If you resize the browser and the display does not appear right, you may need to refresh the page.</p>
</div>
<div style="width: 100%; text-align: center">
<canvas class="edge" id="canvas" oncontextmenu="event.preventDefault()"></canvas>
</div>
<script type="importmap">
{
"imports": {
"edge-classic": "./edge-classic.js"
}
}
</script>
<script type="module">
import createEdgeModule from "edge-classic";
const args = ["-home", "/edge-classic-webplayer", "-iwad", "/freedoom2.wad", "-file", "/obsidian-demo.wad"];
createEdgeModule({
edgePostInit: () => {
Module._I_WebOpenGameMenu(1);
},
onFullscreen: () => {
},
preEdgeSyncFS: () => {
},
postEdgeSyncFS: () => {
},
arguments: args,
preInit: () => {
},
preRun: [],
postRun: [],
print: (function () {
return function (text) {
text = Array.prototype.slice.call(arguments).join(' ');
console.log(text);
};
})(),
printErr: function (text) {
text = Array.prototype.slice.call(arguments).join(' ');
console.error(text);
},
canvas: (function () {
var canvas = document.getElementById('canvas');
canvas.onclick = async (ev) => {
const lock = canvas === document.pointerLockElement;
if (!lock) {
try {
await canvas.requestPointerLock();
} catch (err) {
console.error(err);
}
}
}
args.push(...["-windowed", "-width", canvas.offsetWidth.toString(), "-height", canvas.offsetHeight.toString()]);
canvas.addEventListener("webglcontextlost", function (e) { alert('FIXME: WebGL context lost, please reload the page'); e.preventDefault(); }, false);
return canvas;
})(),
setStatus: function (text) { console.log("status", text) },
monitorRunDependencies: function (left) { console.log(left) },
}).then(module => {
globalThis.Module = module;
module.canvas = canvas;
});
</script>
</div>
</div>
</div>
</body>
</html>