-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
54 lines (46 loc) · 1.2 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
<!DOCTYPE html>
<!--
__ __ ___ ___ __
| | | | \ \ / / | |
| | | | \ \ / / | |
| |____ | | \ \/ / | |
|_______| |__| \____/ |__|
HAND CODED BY LIVINGSTON SAMUEL
-->
<html lang='en'>
<head>
<title>Squares</title>
<style>
html, body {
height:100%;
overflow:hidden
}
body {
border:0;
margin:0;
}
</style>
</head>
<body>
<canvas id='sqrs-grid'></canvas>
<script src='http://rawgit.com/lodash/lodash/2.4.1/dist/lodash.js'></script>
<script src='Squares.js'></script>
<script>
var pastelMix = 130;
var getRandomPastelColor = function () {
return "rgb(#,#,#)".replace(/#/g, function () { return (Math.round(Math.random() * pastelMix) + pastelMix); });
};
var renderSquare = function (ctx, cols) {
ctx.fillStyle = getRandomPastelColor();
ctx.fillRect(0, 0, cols, cols);
};
var options = {
height: document.body.offsetHeight,
width: document.body.offsetWidth,
shapeFn: renderSquare
};
var sqrs = new Squares(document.getElementById('sqrs-grid'), options);
sqrs.tick();
</script>
</body>
</html>