-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
146 lines (137 loc) · 5.62 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
145
146
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Webcam-pong</title>
<style media="screen">
body {background-color: grey;}
canvas {background-color: white;}
video {
width: 100%;
position: relative;
}
.roomSelection {margin: 3px;}
#chat {
overflow: auto;
background-color: white;
height: 250px;
border: 1px solid gray;
}
#redBar .ui-slider-range { background: #ef2929; }
#redBar .ui-slider-handle { border-color: #ef2929; }
#greenBar .ui-slider-range { background: #8ae234; }
#greenBar .ui-slider-handle { border-color: #8ae234; }
#blueBar .ui-slider-range { background: #729fcf; }
#blueBar .ui-slider-handle { border-color: #729fcf; }
#redBar, #greenBar, #blueBar {
float: left;
clear: left;
margin: 15px;
width: 100%;
}
#score, #timeLeft {
text-align: center;
background-color: grey;
color: white;
}
.score-red {
background-color: red;
color: black;
}
</style>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-1.12.3.min.js"></script>
<script src="gl-matrix-min.js"></script>
<script id="shader-vs" type="x-shader/x-vertex">
attribute vec3 aVertexPosition;
attribute vec3 aVertexColor;
varying highp vec4 vColor;
uniform mat4 uMVMatrix;
uniform mat4 uPMatrix;
uniform vec3 uColor;
void main(void) {
gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0);
vColor = vec4(uColor * aVertexColor, 1.0);
}
</script>
<script id="shader-fs" type="x-shader/x-fragment">
varying highp vec4 vColor;
void main(void) {
gl_FragColor = vColor;
}
</script>
<script src="pong.js"></script>
</head>
<body onload="initWebGL()">
<div id="roomSelection" class="container well">
<form class="form-inline">
<label>Room: </label>
<input type="text" class="form-control" id="roomName">
<button type="button" class="btn btn-info" id="joinButton">Join</button>
<button type="button" class="btn btn-info" id="stopButton" disabled="">Stop</button>
</form>
</div>
<div class="container well">
<div class="row">
<div class="col-xs-6 col-md-3">
<video id="videoLocal" autoplay></video>
</div>
<div class="col-xs-6 col-md-3 col-md-push-6">
<video id="videoRemote" autoplay></video>
</div>
<div class="col-xs-12 col-md-6 col-md-pull-3">
<canvas id="my-canvas" width="500" height="300">
Your browser does not support the HTML5 canvas element.
</canvas>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-4 col-md-push-4">
<label for="comment">Score:</label>
<h2 id="score"><span id="localScore">0</span> - <span id="remoteScore">0</span></h2>
<h2 id="timeLeft">Wait ...</h2>
</div>
<div class="col-xs-12 col-md-4 col-md-pull-4">
<label for="comment">Choose bar color:</label>
<div id="redBar"></div>
<div id="greenBar"></div>
<div id="blueBar"></div>
</div>
<div class="col-xs-12 col-md-4">
<label for="comment">Choose camera view:</label>
<br>
<div class="btn-group" role="group" aria-label="...">
<button type="button" class="btn btn-default" onclick="changeCamera('2d')">semi-2D</button>
<button type="button" class="btn btn-default" onclick="changeCamera('3d side')">3D side</button>
<button type="button" class="btn btn-default" onclick="changeCamera('3d back')">3D back</button>
</div>
</div>
</div>
</div>
<div class="chatZone container well">
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label for="comment">Write a message:</label>
<textarea class="form-control" rows="9" cols="40" id="localText"></textarea>
<button type="button" class="btn btn-info" id="sendText">SEND</button>
</div>
</div>
<div class="col-sm-6">
<div id="chat"></div>
</div>
</div>
</div>
</body>
<script src="https://code.jquery.com/jquery-1.12.3.min.js"></script>
<script src="https://cdn.socket.io/socket.io-1.4.5.js"></script>
<script src="adapter.js"></script>
<script src="webcamHandler2.js" charset="utf-8"></script>
<script src="socketHandler2.js" charset="utf-8"></script>
<!-- Latest compiled and minified JavaScript Bootstrap-->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
</body>
</html>