Skip to content

Commit

Permalink
Ughhhhhhhhhh
Browse files Browse the repository at this point in the history
  • Loading branch information
enderpuff committed Apr 5, 2024
1 parent cd74bec commit 40f68ee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions res/js/rand-image.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export var theme;

window.onload = choosePic;

var pictures = [
Expand Down Expand Up @@ -40,9 +42,12 @@ var extractRootDomain = function(filePath){

var prefixes = ["res/img/backgrounds/", "res/img/logos/",];

var theme;

function choosePic() {
console.log(extractRootDomain(href));
var randomNum = Math.floor(Math.random() * pictures[0].length);
theme = pictures[0][randomNum];
//You always miss it the first time, and so I did. But it should work on the second. Or the third. Or the fourth. Or the fifth...
document.body.style.backgroundImage = 'url("' + extractRootDomain(href) + prefixes[0] + pictures[0][randomNum] + '")';
document.getElementById("logo").src = extractRootDomain(href) + prefixes[1] + pictures[1][randomNum];
Expand Down
2 changes: 1 addition & 1 deletion res/styles/footer.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ footer {
}

footer a {
align-items: top;
align-items: middle;
padding: 0.5em;
}

Expand Down

0 comments on commit 40f68ee

Please sign in to comment.