diff --git a/file_viewer.php b/file_viewer.php
new file mode 100644
index 0000000..ea9e8a9
--- /dev/null
+++ b/file_viewer.php
@@ -0,0 +1,50 @@
+ $filename) {
+ if (is_array($filename)) { // $filename is either a filename or an array of filenames, if so, it represents a directory
+ $useableName = str_replace("/", "_", $path);
+ echo "#input_$useableName:checked + .submenu_$useableName,
+ .submenu_$useableName:hover {
+ display: block;
+ }\n";
+
+ generateCSSCode($filename);
+ }
+ }
+ }
+
+ function generateSubmenusHTML($directory, $indentation) {
+ foreach ($directory as $path => $filename) {
+ $useableName = str_replace("/", "_", $path); // CSS classes cant contain slashes
+
+ if (is_array($filename)) {
+ $folderName = end(explode("/", $path));
+ echo " $indentation
+ $indentation
+ $indentation
+ $indentation
\n";
+ } else {
+ echo " $indentation$filename\n";
+ }
+ echo " $indentation
\n";
+ }
+ }
+?>
\ No newline at end of file
diff --git a/file_viewer_styles.css b/file_viewer_styles.css
new file mode 100644
index 0000000..dd63e95
--- /dev/null
+++ b/file_viewer_styles.css
@@ -0,0 +1,22 @@
+.submenu {
+ display: none;
+ margin: 8px 0px 0px;
+ padding: 16px 0px 0px 16px;
+}
+
+.file-link {
+ padding: 0px 16px 0px 16px;
+ display: block;
+}
+
+.hacked-checkbox {
+ position: absolute;
+ left: -100vw;
+}
+
+.hcb-label {
+ padding: 8px 16px;
+ margin: 16px;
+ cursor: pointer;
+ border-radius: 16px 16px 0px 0px;
+}
\ No newline at end of file
diff --git a/index.html b/index.php
similarity index 86%
rename from index.html
rename to index.php
index 928e1c9..2310508 100644
--- a/index.html
+++ b/index.php
@@ -1,3 +1,9 @@
+
+
@@ -8,6 +14,14 @@
+
+
+
+ /* This CSS code is php generated. Hardcoding it would be a programming war crime. :3 */\n\n ";
+echo generateCSSCode(completeScanDir("files"));
+echo " ";
+?>
@@ -108,6 +122,16 @@
+
+
+ Hab hier nen kleinen Datenschrottplatz an Mist,
+
+ den ich mal mit irgendwem teilen musste und ich deshalb hier auf den Server geladen hab.
+
+
+= generateSubmenusHTML(completeScanDir("files"), " ") ?>
+
+