From 9881a1dba1845c5de131750544bb3cda1d796830 Mon Sep 17 00:00:00 2001 From: EKNr1 Date: Sat, 26 Oct 2024 13:41:17 +0200 Subject: [PATCH] Added function to read description and made some style changes. --- file_viewer.php | 23 +++++++++++++++++++++-- file_viewer_styles.css | 2 ++ index.php | 15 +++++++++------ styles.php | 12 ++++++++++++ 4 files changed, 44 insertions(+), 8 deletions(-) diff --git a/file_viewer.php b/file_viewer.php index ea9e8a9..4a2692c 100644 --- a/file_viewer.php +++ b/file_viewer.php @@ -18,10 +18,13 @@ function generateCSSCode($directory) { foreach ($directory as $path => $filename) { if (is_array($filename)) { // $filename is either a filename or an array of filenames, if so, it represents a directory + $randomColor = "rgba(" . rand(0, 255) . ", " . rand(0, 255) . ", " . rand(0, 255); + $useableName = str_replace("/", "_", $path); echo "#input_$useableName:checked + .submenu_$useableName, .submenu_$useableName:hover { display: block; + background-color: $randomColor, 0.1); }\n"; generateCSSCode($filename); @@ -35,14 +38,30 @@ if (is_array($filename)) { $folderName = end(explode("/", $path)); - echo " $indentation + echo " $indentation $indentation $indentation $indentation
\n"; + } else { - echo " $indentation$filename\n"; + if ($filename !== "README.txt") { + echo " $indentation$filename\n"; + } } echo " $indentation
\n"; } diff --git a/file_viewer_styles.css b/file_viewer_styles.css index 303fc52..ad9d581 100644 --- a/file_viewer_styles.css +++ b/file_viewer_styles.css @@ -2,6 +2,8 @@ display: none; margin: 8px 0px 0px; padding: 16px 0px 0px 16px; + border: 2px solid rgba(255, 255, 255, 0.3); + background-color: rgba(46, 46, 46, 0.5) } .file-link { diff --git a/index.php b/index.php index 24417e1..079f985 100644 --- a/index.php +++ b/index.php @@ -123,16 +123,19 @@ echo " ";
-

- Hab hier nen kleinen Datenschrottplatz an Mist, +

+ Hab hier nen kleinen Datenschrottplatz an Mist, +
+ den ich mal mit irgendwem teilen musste und ich deshalb hier auf den Server geladen hab. +
+ Evtl. könnt ihr hier etwas brauchbares finden. +

+

- den ich mal mit irgendwem teilen musste und ich deshalb hier auf den Server geladen hab. -
- Evtl. könnt ihr hier etwas brauchbares finden. -

+
diff --git a/styles.php b/styles.php index ec9d0fa..70f8212 100644 --- a/styles.php +++ b/styles.php @@ -40,6 +40,11 @@ label { text-shadow: 4px 4px 8px rgb(0, 0, 0), -4px 4px 8px rgb(0, 0, 0), -4px -4px 8px rgb(0, 0, 0), 4px -4px 8px rgb(0, 0, 0); } +hr { + margin: 0px 16px 0px 0px; + border: 1px solid rgba(255, 255, 255, 0.5); +} + .background { background-image: url(''); background-repeat: no-repeat; @@ -111,6 +116,13 @@ label { font-size: 26px; } +.heading-text { + font-family: ubuntu, arial; + color: white; + font-size: 20px; + padding-left: 20px; +} + .medium-text { font-family: ubuntu, arial; }