-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
37 lines (31 loc) · 949 Bytes
/
script.js
File metadata and controls
37 lines (31 loc) · 949 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
var scrl = "Fun fact about Minota: He's terrible at web design. ";
function scrollTitle() {
scrl = scrl.substring(1, scrl.length) + scrl.substring(0, 1);
document.title = scrl;
setTimeout("scrollTitle()", 300);
}; scrollTitle();
function getRandomRGBValue() {
return Math.min(Math.floor(Math.random() * 255 + 1), 255);
}
function start() {
changeThemeColor()
playAudio()
}
function getRandomColor() {
var r = getRandomRGBValue(),
g = getRandomRGBValue(),
b = getRandomRGBValue();
return "#" + (((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1));
}
function changeThemeColor() {
var metaThemeColor = document.querySelector("meta[name=theme-color]");
metaThemeColor.setAttribute("content", getRandomColor());
setTimeout(function() {
changeThemeColor();
}, 1000);
}
changeThemeColor()
function playAudio() {
var x = document.getElementById("audio");
x.play();
}