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 @@
+
-
- -
- * 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 @@