-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
38 lines (31 loc) · 821 Bytes
/
script.js
File metadata and controls
38 lines (31 loc) · 821 Bytes
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
'use strict';
var card_container = document.getElementById('card-container'),
cards = document.getElementsByClassName('card'),
query_divs = document.querySelectorAll('div'),
query_container = document.querySelector('#card-container'),
body = document.getElementsByTagName('body');
var i = 100;
var timer = setInterval(function () {
card_container.style['background-color'] = 'rgb('
+ randColor()
+ ','
+ randColor()
+ ','
+ randColor()
+ ')';
function randColor () {
return Math.floor(Math.random() * 255);
};
cards[0].innerHTML = '<h1>' + i + '</h1>';
cards[0].style['background-color'] = 'rgb('
+ randColor()
+ ','
+ randColor()
+ ','
+ randColor()
+ ')';
if (i == 0) {
clearInterval(timer);
}
i--
}, 50);