-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcsv.js
26 lines (23 loc) · 878 Bytes
/
csv.js
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
(function(d){
var flash = function(i, bpm) {
// Lights to the beat (1874 rows/beats)
var j = (i + 1) % 4
d.body.style['background-color'] = ['#8F8', '#FF8', '#8FF', '#F8F'][j]
setTimeout(function() {
flash(j, bpm)
}, 60000 / bpm)
}
var go = function() {
// Start the flashing
if (!d.body.style['background-color']) {
flash(0, 80)
}
}
// Apply the flashing
d.body.addEventListener('click', go)
d.body.addEventListener('touchend', go)
// Add the sticker if it's not already there
if (!d.getElementById('csv-sticker')) {
d.body.innerHTML += '<a href="http://csv.nyc" target="_blank"><img src="http://csv.nyc/csvsoundsystem.png" alt="csv soundsystem" id="csv-sticker" style="position: absolute; right: 50px; top: 10px;" /></a>'
}
})(document)