-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchanges.js
More file actions
30 lines (26 loc) · 781 Bytes
/
changes.js
File metadata and controls
30 lines (26 loc) · 781 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
$.get("/side-bar.html", function(data){
$("#side-placeholder").replaceWith(data);
});
function dark_mode() {
document.body.style.backgroundColor = '#303030';
document.body.style.color = "#ffffff"
}
var myArray = ['#d47564', '#CAA67A', '#4fa4a5'];
var elements = document.getElementsByClassName("color-text");
var c = ''
var last_c = ''
for(var i=0; i<elements.length; i++) {
c = myArray[Math.floor(Math.random() * myArray.length)];
while (c == last_c) {
c = myArray[Math.floor(Math.random() * myArray.length)];
}
elements[i].style.color = c;
}
var links = document.getElementsByTagName("a");
for(var i=0;i<links.length;i++)
{
if(links[i].href)
{
links[i].style.color = myArray[Math.floor(Math.random() * myArray.length)];
}
}