-
Notifications
You must be signed in to change notification settings - Fork 12
/
index.html
59 lines (55 loc) · 1.51 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300" rel="stylesheet">
<title>OpenGL ImageViewer using WebAssembly</title>
<style>
html, body {
padding: 0;
margin: 0;
text-align: center;
font-family: 'Open Sans', sans-serif;
font-size: 100%;
font-weight: 300;
}
h1 {
font-size: 1.2rem;
}
p {
font-size: 1rem;
}
.container {
margin: 0 auto 0 auto;
border: 1px solid black;
width: 600px;
height: 600px;
}
</style>
</head>
<body>
<h1>OpenGL Image Viewer: Emscripten + WebAssembly</h1>
<div id="container" class="container">
<canvas id="canvas" class="canvas"></canvas>
</div>
<p>
Drag and drop a JPEG image onto the canvas above.<br>
Use your scroll wheel to zoom in and out.
</p>
<script type="text/javascript">
const canvas = document.getElementById('canvas');
const container = document.getElementById('container');
canvas.width = container.clientWidth;
canvas.height = container.clientHeight;
var Module = {};
Module.canvas = canvas;
Module.onRuntimeInitialized = () => {
ImageViewer.run(container, canvas);
};
</script>
<script type="text/javascript" src="renderer.js"></script>
<script type="text/javascript" src="main.js"></script>
</body>
</html>