This repository was archived by the owner on Jun 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
75 lines (75 loc) · 1.44 KB
/
index.html
File metadata and controls
75 lines (75 loc) · 1.44 KB
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
<!DOCTYPE html>
<html>
<head>
<title>Placeholder: The Game</title>
<style>
body {
margin: 0;
}
#window{
width:100vw;
height:50vw;
}
.game {
width:45%;
height:90%;
float:left;
border:1px solid black;
overflow:hidden;
}
canvas {
width:100%;
height:100%;
}
</style>
</head>
<body>
<script id="vert" type="notjs">
//in
attribute vec2 pos;
attribute vec2 uvcoord;
uniform vec2 ures;
//out
varying vec2 uv;
void main() {
vec2 clip = pos/ures*2.0 - 1.0;
gl_Position = vec4(clip,0,1);
uv = uvcoord;
}
</script>
<script id="frag" type="notjs">
precision mediump float;
uniform vec3 col;
varying vec2 uv;
uniform sampler2D _tex;
void main() {
gl_FragColor = vec4(col, 1)*texture2D(_tex, uv);
}
</script>
<script id="snakevert" type="notjs">
//in
attribute vec2 pos;
uniform vec2 ures;
void main() {
vec2 clip = pos/ures*2.0 - 1.0;
gl_Position = vec4(clip,0,1);
}
</script>
<script id="snakefrag" type="notjs">
precision mediump float;
uniform vec3 col;
void main() {
gl_FragColor = vec4(col, 1);
}
</script>
<div id="window">
<div class="game">
<canvas id="canv"></canvas>
</div>
<div class="game">
<canvas id="snake"></canvas>
</div>
</div>
<script src="placeholder.js" id="game"></script>
</body>
</html>