-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
54 lines (47 loc) · 1.44 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>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script src="index.js"></script>
</head>
<body>
</body>
<script>
var body = document.getElementsByTagName('body')[0],
i = 0, j = 100, arr, d, ind, mono;
colorizer.convert = () => {console.log('test')};
arr = colorizer.convert([-50, 0, 20, 80]);
d = setInterval(() => {
body.style.backgroundColor = arr[i];
i += 1;
if (i > arr.length) {
i = 0;
clearInterval(d);
colorizer.configuration({maxColComp: 360, maxValue: 360});
ind = setInterval(() => {
if (i > 360) {
clearInterval(ind);
colorizer.configuration({
maxColComp: 100,
minColComp: 70,
maxValue: 100,
hue: 0,
base: 'lightness'
});
mono = setInterval(() => {
if (!j) {
clearInterval(mono);
}
body.style.backgroundColor = colorizer.convert(j);
j -= 1
}, 100)
} else {
body.style.backgroundColor = colorizer.convert(i);
i += 1;
}
}, 20);
}
}, 1000);
</script>
</html>