diff --git a/backgrounds/halloween/baum_01.png b/backgrounds/halloween/baum_01.png new file mode 100644 index 0000000..33ad15d Binary files /dev/null and b/backgrounds/halloween/baum_01.png differ diff --git a/backgrounds/halloween/haus_01.png b/backgrounds/halloween/haus_01.png new file mode 100644 index 0000000..2095ad3 Binary files /dev/null and b/backgrounds/halloween/haus_01.png differ diff --git a/backgrounds/halloween/mineneingang_01.png b/backgrounds/halloween/mineneingang_01.png new file mode 100644 index 0000000..c359564 Binary files /dev/null and b/backgrounds/halloween/mineneingang_01.png differ diff --git a/bla/index.html b/bla/index.html index a6c9e86..346011f 100644 --- a/bla/index.html +++ b/bla/index.html @@ -72,10 +72,7 @@
diff --git a/downloads.html b/downloads.html index 6d2e116..6407351 100644 --- a/downloads.html +++ b/downloads.html @@ -39,10 +39,7 @@
diff --git a/index.html b/index.html index 829bc34..4fb6b74 100644 --- a/index.html +++ b/index.html @@ -34,10 +34,7 @@
diff --git a/pythonscripts.html b/pythonscripts.html index 6576f2f..7761999 100644 --- a/pythonscripts.html +++ b/pythonscripts.html @@ -16,43 +16,38 @@ -
+
-
-
- * PyBrow -
-
- - Ein Webbrowser mit Python programmiert. -
- Downloaded eine Version aber mit den Settings und Icon. -
-
- * Python Animation Test -
-
- - Ein kleiner Test einer Terminalanimation. -
-
- * EMatrix -
-
- - Eine kleine einfache Matrix. -
- Downloaded eine Version aber ab der 1.1 mit den Settings -
-
+

+ * PyBrow +

+

+ - Ein Webbrowser mit Python programmiert. +
+ Downloaded eine Version aber mit den Settings und Icon. +

+

+ * Python Animation Test +

+

+ - Ein kleiner Test einer Terminalanimation. +

+

+ * EMatrix +

+

+ - Eine kleine einfache Matrix. +
+ Downloaded eine Version aber ab der 1.1 mit den Settings +

+ setBackground(); +
diff --git a/script.js b/script.js index 4ed3b3a..dc2daf9 100644 --- a/script.js +++ b/script.js @@ -2,7 +2,11 @@ function randomBackground(backgrounds) { let background = selectRandom(backgrounds); console.log("Choosen random background image:", background); - document.getElementById("background").style.backgroundImage = "url(https://i21k.de/emil/backgrounds/" + background + ")"; + if (!background.includes("backgrounds/")) { + background = "backgrounds/" + background + } + + document.getElementById("background").style.backgroundImage = "url(" + 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"; @@ -51,5 +55,36 @@ function getFilesInFolder(pageContent) { // Needs auto file indexing return files; }; +function setBackground(bla = "") { + let currentDate = new Date(); + let currentMonth = currentDate.getMonth(); + let currentDay = currentDate.getDay(); + + if (currentMonth == 9) { + if (currentDay > 0 && currentDay < 20) { + getStringOfPageContent(bla + "backgrounds/halloween", function(pageContent) { + let backgrounds = getFilesInFolder(pageContent); + + let backgroundNumber = 0; + + while (backgroundNumber < backgrounds.length) { + backgrounds[backgroundNumber] = bla + "backgrounds/halloween/" + backgrounds[backgroundNumber]; + + backgroundNumber++; + } + + randomBackground(backgrounds); + }); + + } + } else { + getStringOfPageContent("backgrounds", function(pageContent) { + let backgrounds = getFilesInFolder(pageContent); + randomBackground(backgrounds); + }); + + } +} + // getStringOfPageContent("backgrounds", getFilesInFolder) diff --git a/ueber-mich.html b/ueber-mich.html index 40c539b..700e81c 100644 --- a/ueber-mich.html +++ b/ueber-mich.html @@ -100,10 +100,7 @@