-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
36 lines (34 loc) · 1.27 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Matrix</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<canvas id="matrixCanvas"></canvas>
<canvas id="camCanvas"></canvas>
<script>
navigator.mediaDevices.getUserMedia({video:true})
.then(function(rawData){
const video = document.createElement("video");
video.srcObject = rawData;
video.play();
video.onloadeddata=function(){
const camCanvas = document.getElementById("camCanvas");
camCanvas.width=video.videoWidth;
camCanvas.height = video.videoHeight;
const matrixCanvas = document.getElementById("matrixCanvas");
matrixCanvas.width=video.videoWidth;
matrixCanvas.height = video.videoHeight;
const ste = new SeeThroughEffect(camCanvas,video,[242,15,21])
const me = new MatrixEffect(matrixCanvas,[242,15,21]);
}
}).catch(function(err){alert(err)});
</script>
<script src="see-through.js"></script>
<script src="matrix.js"></script>
<script src="utils.js"></script>
</body>
</html>