-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
61 lines (45 loc) · 1.68 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
55
56
57
58
59
60
61
<!doctype html>
<html>
<head>
<title>Random Colors</title>
<meta charset="utf-8">
<meta name="description" content="Get beautiful random colors on every page reload">
<meta name="author" content="CybrHome">
<meta name="product" content="random-colors">
<meta name="keywords" content="css color, css background, random colors, custom background, ui design, colours">
<link rel="stylesheet" href="colors.css">
<style>
body {
margin: 0;
}
div {
height: 25vh;
text-align: center;
color: white;
line-height: 25vh;
}
</style>
</head>
<body>
<div class='random-dark-bg'></div>
<div class='random-light-bg'></div>
<div class='random-dark-bg'></div>
<div class='random-light-bg'></div>
<script>
var bgdark = ['bg-darkBrown','bg-darkCrimson','bg-darkMagenta','bg-darkIndigo','bg-darkCyan','bg-darkCobalt','bg-darkTeal','bg-darkEmerald','bg-darkGreen','bg-darkOrange','bg-darkRed','bg-darkPink','bg-darkViolet','bg-darkBlue'];
var elements = document.getElementsByClassName('random-dark-bg');
for(i = 0; i < elements.length; i++) {
var x = Math.floor((Math.random() * bgdark.length) + 0);
elements[i].innerHTML = bgdark[x];
elements[i].className += ' '+bgdark[x];
}
var bglight = ['bg-lightBlue','bg-lightRed','bg-lightGreen','bg-lighterBlue','bg-lightTeal','bg-lightOlive','bg-lightOrange','bg-lightPink','bg-grayLight','bg-grayLighter'];
var lightelements = document.getElementsByClassName('random-light-bg');
for(i = 0; i < elements.length; i++) {
var x = Math.floor((Math.random() * bglight.length) + 0);
lightelements[i].innerHTML = bglight[x];
lightelements[i].className += ' '+bglight[x];
}
</script>
</body>
</html>