This repository has been archived by the owner on Feb 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
82 lines (66 loc) · 1.92 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
<!DOCTYPE html>
<html>
<head>
<title>act grad show demo</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class="container">
<canvas id="canvas" width="1440" height="900"></canvas>
</div>
<div class="centerText">
<div class="title">
PUT THAT WHERE?
</div>
</div>
<div class="topLeftText">
<a href="">MIT Program in Art, Culture, Technology<br/>
2020 Graduate Exhibition</a>
</div>
<div class="bottomLeftText">
<a href="">Emma Zhu</a><br/>
<a href="">Po-Hao Chi</a><br/>
<a href="">Chucho Ocampo Aguilar</a><br/>
<a href="">Aarti Sunder</a><br/>
<a href="">Faruk Šabanović</a> <br/>
<a href="">Nancy Valladares</a><br/>
<a href="">Ryan Aasen</a><br/>
<a href="">Rae Yuping Hsu</a><br/>
<a href="">Matt Ledwidge</a><br/>
<a href="">Casey Tang</a><br/>
<a href="">Luíza Bastos Lages</a>
<div>
<script src="simpleheat.js"></script>
<script src="data.js"></script>
<script>
var w = window.innerWidth;
var h = window.innerHeight;
console.log(w + ", " + h);
window.requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame ||
window.webkitRequestAnimationFrame || window.msRequestAnimationFrame;
function get(id) {
return document.getElementById(id);
}
var heat = simpleheat('canvas').data(data).max(18),
frame;
function draw() {
console.time('draw');
heat.draw();
console.timeEnd('draw');
frame = null;
}
draw();
get('canvas').onmousemove = function (e) {
heat.add([e.layerX, e.layerY, 1]);
frame = frame || window.requestAnimationFrame(draw);
};
var radius = get('radius'),
blur = get('blur'),
changeType = 'oninput' in radius ? 'oninput' : 'onchange';
radius[changeType] = blur[changeType] = function (e) {
heat.radius(+radius.value, +blur.value);
frame = frame || window.requestAnimationFrame(draw);
};
</script>
</body>
</html>