Redesigned some things and made a post at Bla.
This commit is contained in:
parent
9fe8dfec49
commit
b349f68bea
8 changed files with 292 additions and 142 deletions
|
@ -2,10 +2,10 @@ function randomBackground(backgrounds) {
|
|||
let background = selectRandom(backgrounds);
|
||||
console.log("Choosen random background image:", background);
|
||||
|
||||
document.getElementById("background").style.backgroundImage = "url(backgrounds/" + background + ")";
|
||||
let div_height = document.getElementById("background").offsetHeight;
|
||||
let half_div_height = (0 - div_height) / 2;
|
||||
document.getElementById("background").style.backgroundPosition = "0% " + half_div_height.toString() + "px";
|
||||
document.getElementById("background").style.backgroundImage = "url(https://i21k.de/emil/backgrounds/" + background + ")";
|
||||
// let div_height = document.getElementById("background").offsetHeight;
|
||||
// let half_div_height = (0 - div_height) / 2;
|
||||
// document.getElementById("background").style.backgroundPosition = "0% " + half_div_height.toString() + "px";
|
||||
}
|
||||
|
||||
function selectRandom(array) {
|
||||
|
@ -52,3 +52,4 @@ function getFilesInFolder(pageContent) { // Needs auto file indexing
|
|||
};
|
||||
|
||||
// getStringOfPageContent("backgrounds", getFilesInFolder)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue