-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlowkey.html
67 lines (58 loc) · 2.02 KB
/
lowkey.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
62
63
64
65
66
67
<!DOCTYPE html>
<html>
<head>
<!-- For updates and configuration info visit https://github.com/Qronikarz/LowkeyScreensaver -->
<!-- MIT licensed. Visit https://choosealicense.com/licenses/mit/ for more info -->
<meta charset="UTF-8" />
<style>
html, body {
background-color: #050709;
color: #aeb6a7;
width: 100%;
height: 100%;
margin: 0px;
}
#letters_place {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
}
.big_letters {
font-size: 20vw;
text-shadow: 1px 1px 2px #aeb6a7, 0 0 150px #aeb6a7, 0 0 5px #aeb6a7;
}
</style>
</head>
<body>
<div id="letters_place"></div>
<script>
var text_holder = "LOWKEY"
var installed_fonts = ["serif", "sans-serif", "monospace", "cursive", "fantasy", "system-ui", "ui-serif", "ui-sans-serif", "ui-monospace", "ui-rounded", "emoji", "math", "fangsong"]
var timer = 400
var max_font_number = installed_fonts.length
var letters = text_holder.split("")
var letters_length = letters.length
for (var i = 0; i < letters_length; i++) {
var letter = letters[i]
if (letter === " ") {
letter = " "
}
document.getElementById("letters_place").innerHTML += "<span class='big_letters' id='big_letter_" + i + "'>" + letter + "</span>"
}
var timer_ref = setInterval(letter_changer, timer)
function letter_changer() {
for (var i = 0; i < letters_length; i++) {
document.getElementById("big_letter_" + i).style.fontFamily = installed_fonts[Math.floor(Math.random() * max_font_number) * 1]
var losowanko = Math.floor(Math.random() * 2)
if (losowanko === 1) {
document.getElementById("big_letter_" + i).innerHTML = document.getElementById("big_letter_" + i).innerHTML.toUpperCase()
} else {
document.getElementById("big_letter_" + i).innerHTML = document.getElementById("big_letter_" + i).innerHTML.toLowerCase()
}
}
}
</script>
</body>
</html>