-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
72 lines (62 loc) · 2.81 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
<html>
<head>
<title>Glitch Experiment</title>
<script type="text/javascript" src="//webrtchacks.github.io/adapter/adapter-latest.js"></script>
<script type="text/javascript" src="oflow.js"></script>
<script type="text/javascript" src="getimagedata.js"></script>
<script type="text/javascript" src="glitch.js"></script>
<link rel="stylesheet" href="//fiendish.github.io/gh-fork-banner/gh.css">
<style>
/* Recent Firefox versions (48 and 49, at least) seem to have a default styling bug that makes range inputs invisible. This fixes it. */
input[type=range] {
border: 1px;
}
</style>
</head>
<body style='background-color:grey'>
<center>
Give access to your webcam and have fun.<br>
Whether it works best in Chrome or Firefox seems to change often, so maybe try both.<br>
<canvas id='canvas'></canvas>
<video id='video' loop muted autoplay oncanplay="this.play()" onloadedmetadata="this.muted = true" style="display:none"></video>
<!-- the test video clip (if you have no webcam) is from Big Buck Bunny http://www.bigbuckbunny.org/ -->
<script type="text/javascript">
// @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later
main();
// @license-end
</script>
<br>
<form submit="return false" autocomplete="off" oninput="setValues();">
<table>
<tr>
<td><label for="zoneSizeInput">Block Size</label></td>
<td><input name="zoneSizeSlider" id="zoneSizeInput" type="range" min="4" max="64" value="16" step="4"></td>
<td><output for="zoneSizeInput" id=zoneSizeOutput>16</output></td>
</tr>
<tr>
<td><label for="thresholdInput">Motion Threshold</label></td>
<td><input name="thresholdSlider" id="thresholdInput" type="range" min="0" max="15" value="5" step="1"></td>
<td><output for="thresholdInput" id=thresholdOutput>5</output></td>
</tr>
<tr>
<td><label for="stretchInput">Motion Stretch</label></td>
<td><input name="stretchSlider" id="stretchInput" type="range" min="0" max="6" value="2" step="1"></td>
<td><output for="stretchInput" id=stretchOutput>2</output></td>
</tr>
</table>
</form>
</center>
<span id="gh"><a href="https://github.com/fiendish/webcam-art">Fork me on GitHub...lol</a></span>
<script type="text/javascript">
function setValues() {
var zoneSize = document.getElementById('zoneSizeInput').valueAsNumber;
document.getElementById('zoneSizeOutput').value = zoneSize;
setZoneSize(zoneSize);
threshold = document.getElementById('thresholdInput').valueAsNumber
document.getElementById('thresholdOutput').value = threshold;
stretch = document.getElementById('stretchInput').valueAsNumber;
document.getElementById('stretchOutput').value = stretch;
}
</script>
</body>
</html>