forked from seductivegeese/softi.es
-
Notifications
You must be signed in to change notification settings - Fork 0
/
softies.js
41 lines (37 loc) · 1.08 KB
/
softies.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
(function() {
var blinkGoose = function() {
var goose = document.getElementById("goose");
var open = ""+goose.innerHTML;
var closed = open.replace("o", "-");
setInterval(function() {
goose.innerHTML = open;
}, 5000);
setInterval(function() {
goose.innerHTML = closed;
}, 4800);
};
//Many thanks to http://codepen.io/simsketch/pen/pJbYKx <3
var bubble = function() {
var icons = ['laptop', 'battery-3', 'chrome', 'y-combinator', 'beer', 'cloud', 'desktop','power-off', 'tv', 'file'];
var i = 0;
var inter = null;
var c = document.getElementById('bubbles');
var generateBubble = function() {
if(i < 30){
var el = document.createElement('div');
el.className = 'fa fa-'+_.sample(icons);
el.setAttribute('style', 'left:'+_.random(4, 96)+'%;');
c.appendChild(el);
i++;
} else {
clearInterval(inter);
}
};
generateBubble();
inter = setInterval(generateBubble, 1500);
};
window.addEventListener("load", function() {
bubble();
blinkGoose();
});
})();