From 74f6993d61b6b8d7b120d6b952787ccbe65788ae Mon Sep 17 00:00:00 2001 From: Alex Vitkov Date: Sat, 30 Jan 2021 10:19:29 +0200 Subject: HTML/CSS for user's filesystem --- css/style.css | 44 ++++++++++++- loggedin.php | 90 ++++++++++++++++++++++++++- mimeicons/application-octet-stream.png | Bin 0 -> 642 bytes mimeicons/application-pdf.png | Bin 0 -> 2510 bytes mimeicons/application-rss_xml.png | Bin 0 -> 2072 bytes mimeicons/application-x-bittorrent.png | Bin 0 -> 955 bytes mimeicons/application-x-cd-image.png | Bin 0 -> 3996 bytes mimeicons/application-x-executable.png | Bin 0 -> 2621 bytes mimeicons/application-x-object.png | Bin 0 -> 2913 bytes mimeicons/audio-x-generic.png | Bin 0 -> 1205 bytes mimeicons/font-x-generic.png | Bin 0 -> 2564 bytes mimeicons/image-x-generic.png | Bin 0 -> 494 bytes mimeicons/package-x-generic.png | Bin 0 -> 539 bytes mimeicons/text-html.png | Bin 0 -> 3293 bytes mimeicons/text-vnd.trolltech.linguist.png | Bin 0 -> 2815 bytes mimeicons/text-x-changelog.png | Bin 0 -> 1329 bytes mimeicons/text-x-chdr.png | Bin 0 -> 2077 bytes mimeicons/text-x-cpp.png | Bin 0 -> 2354 bytes mimeicons/text-x-csrc.png | Bin 0 -> 3152 bytes mimeicons/text-x-css.png | Bin 0 -> 1531 bytes mimeicons/text-x-generic.png | Bin 0 -> 1027 bytes mimeicons/text-x-go.png | Bin 0 -> 4613 bytes mimeicons/text-x-javascript.png | Bin 0 -> 3046 bytes mimeicons/text-x-preview.png | Bin 0 -> 521 bytes mimeicons/text-x-python.png | Bin 0 -> 3255 bytes mimeicons/text-x-script.png | Bin 0 -> 1130 bytes mimeicons/text-x-vala.png | Bin 0 -> 2669 bytes mimeicons/video-x-generic.png | Bin 0 -> 728 bytes mimeicons/x-office-calendar.png | Bin 0 -> 1487 bytes mimeicons/x-office-document-template.png | Bin 0 -> 2596 bytes mimeicons/x-office-document.png | Bin 0 -> 1207 bytes mimeicons/x-office-drawing-template.png | Bin 0 -> 3690 bytes mimeicons/x-office-drawing.png | Bin 0 -> 2994 bytes mimeicons/x-office-presentation-template.png | Bin 0 -> 2432 bytes mimeicons/x-office-presentation.png | Bin 0 -> 1446 bytes mimeicons/x-office-spreadsheet-template.png | Bin 0 -> 2009 bytes mimeicons/x-office-spreadsheet.png | Bin 0 -> 762 bytes php/configuration.php | 4 ++ php/upload.php | 1 - 39 files changed, 135 insertions(+), 4 deletions(-) create mode 100644 mimeicons/application-octet-stream.png create mode 100644 mimeicons/application-pdf.png create mode 100644 mimeicons/application-rss_xml.png create mode 100644 mimeicons/application-x-bittorrent.png create mode 100644 mimeicons/application-x-cd-image.png create mode 100644 mimeicons/application-x-executable.png create mode 100644 mimeicons/application-x-object.png create mode 100644 mimeicons/audio-x-generic.png create mode 100644 mimeicons/font-x-generic.png create mode 100644 mimeicons/image-x-generic.png create mode 100644 mimeicons/package-x-generic.png create mode 100644 mimeicons/text-html.png create mode 100644 mimeicons/text-vnd.trolltech.linguist.png create mode 100644 mimeicons/text-x-changelog.png create mode 100644 mimeicons/text-x-chdr.png create mode 100644 mimeicons/text-x-cpp.png create mode 100644 mimeicons/text-x-csrc.png create mode 100644 mimeicons/text-x-css.png create mode 100644 mimeicons/text-x-generic.png create mode 100644 mimeicons/text-x-go.png create mode 100644 mimeicons/text-x-javascript.png create mode 100644 mimeicons/text-x-preview.png create mode 100644 mimeicons/text-x-python.png create mode 100644 mimeicons/text-x-script.png create mode 100644 mimeicons/text-x-vala.png create mode 100644 mimeicons/video-x-generic.png create mode 100644 mimeicons/x-office-calendar.png create mode 100644 mimeicons/x-office-document-template.png create mode 100644 mimeicons/x-office-document.png create mode 100644 mimeicons/x-office-drawing-template.png create mode 100644 mimeicons/x-office-drawing.png create mode 100644 mimeicons/x-office-presentation-template.png create mode 100644 mimeicons/x-office-presentation.png create mode 100644 mimeicons/x-office-spreadsheet-template.png create mode 100644 mimeicons/x-office-spreadsheet.png diff --git a/css/style.css b/css/style.css index 9296e87..060fdde 100644 --- a/css/style.css +++ b/css/style.css @@ -95,7 +95,6 @@ body { font-weight: bold; } - form { background: white; margin: 4.5rem; @@ -165,7 +164,8 @@ form p { from { opacity: 0; } to { opacity: 1; } } -input { + +input:not([type=file]) { min-width: 300px; border: 1px solid #bbb; padding: 0.5rem; @@ -225,3 +225,43 @@ input[type=submit]:hover { display: none; } +.filesystem { + background: #fafafa; + margin: 1rem; + padding: 1rem; + box-shadow: 0 0.8rem 1.3rem rgba(0,0,0,0.2); + border-radius: 0.5rem; + border-radius: 0.5rem; + border: 1px solid #b9b9b9; + display: grid; + + grid-gap: 20px; + grid-auto-rows: 10rem; + grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); +} + +.file { + padding: 0.5rem; + cursor: pointer; + color: #333; + user-select: none; + -webkit-user-select: none; + -ms-user-select: none; + + display: flex; + flex-direction: column; + align-items: center; + border: 1px solid #fafafa; + border-radius: 0.3rem; +} + +.file:hover { + padding: 0.5rem; + background: white; + color: black; + border-color: #ddd; +} + +.file:hover > img { + filter: brightness(150%); +} diff --git a/loggedin.php b/loggedin.php index 884f4b9..bafdd51 100644 --- a/loggedin.php +++ b/loggedin.php @@ -1,5 +1,93 @@
- ALALALLALALLAl + +
+
+ +
asdf
+
+
+ +
asdf
+
+
+ +
asdf
+
+
+ +
asdf
+
+
+ +
asdf
+
+
+ +
asdf
+
+
+ +
asdf
+
+
+ +
asdf
+
+
+ +
asdf
+
+
+ +
asdf
+
+
+ +
asdf
+
+
+ +
asdf
+
+
+ +
asdf
+
+
+ +
asdf
+
+
+ +
asdf
+
+
+ +
asdf
+
+
+ +
asdf
+
+
+ +
asdf
+
+
+ +
asdf
+
+
+ +
asdf
+
+
+ +
asdf
+
+
+ +
diff --git a/mimeicons/application-octet-stream.png b/mimeicons/application-octet-stream.png new file mode 100644 index 0000000..741abd2 Binary files /dev/null and b/mimeicons/application-octet-stream.png differ diff --git a/mimeicons/application-pdf.png b/mimeicons/application-pdf.png new file mode 100644 index 0000000..a5589da Binary files /dev/null and b/mimeicons/application-pdf.png differ diff --git a/mimeicons/application-rss_xml.png b/mimeicons/application-rss_xml.png new file mode 100644 index 0000000..22095de Binary files /dev/null and b/mimeicons/application-rss_xml.png differ diff --git a/mimeicons/application-x-bittorrent.png b/mimeicons/application-x-bittorrent.png new file mode 100644 index 0000000..f1d5ddd Binary files /dev/null and b/mimeicons/application-x-bittorrent.png differ diff --git a/mimeicons/application-x-cd-image.png b/mimeicons/application-x-cd-image.png new file mode 100644 index 0000000..562c663 Binary files /dev/null and b/mimeicons/application-x-cd-image.png differ diff --git a/mimeicons/application-x-executable.png b/mimeicons/application-x-executable.png new file mode 100644 index 0000000..7c65294 Binary files /dev/null and b/mimeicons/application-x-executable.png differ diff --git a/mimeicons/application-x-object.png b/mimeicons/application-x-object.png new file mode 100644 index 0000000..e8e1a9a Binary files /dev/null and b/mimeicons/application-x-object.png differ diff --git a/mimeicons/audio-x-generic.png b/mimeicons/audio-x-generic.png new file mode 100644 index 0000000..624c09c Binary files /dev/null and b/mimeicons/audio-x-generic.png differ diff --git a/mimeicons/font-x-generic.png b/mimeicons/font-x-generic.png new file mode 100644 index 0000000..ab3d469 Binary files /dev/null and b/mimeicons/font-x-generic.png differ diff --git a/mimeicons/image-x-generic.png b/mimeicons/image-x-generic.png new file mode 100644 index 0000000..17071bb Binary files /dev/null and b/mimeicons/image-x-generic.png differ diff --git a/mimeicons/package-x-generic.png b/mimeicons/package-x-generic.png new file mode 100644 index 0000000..1fca710 Binary files /dev/null and b/mimeicons/package-x-generic.png differ diff --git a/mimeicons/text-html.png b/mimeicons/text-html.png new file mode 100644 index 0000000..31ba1bd Binary files /dev/null and b/mimeicons/text-html.png differ diff --git a/mimeicons/text-vnd.trolltech.linguist.png b/mimeicons/text-vnd.trolltech.linguist.png new file mode 100644 index 0000000..3cd52b3 Binary files /dev/null and b/mimeicons/text-vnd.trolltech.linguist.png differ diff --git a/mimeicons/text-x-changelog.png b/mimeicons/text-x-changelog.png new file mode 100644 index 0000000..0d3f7bf Binary files /dev/null and b/mimeicons/text-x-changelog.png differ diff --git a/mimeicons/text-x-chdr.png b/mimeicons/text-x-chdr.png new file mode 100644 index 0000000..adfc066 Binary files /dev/null and b/mimeicons/text-x-chdr.png differ diff --git a/mimeicons/text-x-cpp.png b/mimeicons/text-x-cpp.png new file mode 100644 index 0000000..fa76ba0 Binary files /dev/null and b/mimeicons/text-x-cpp.png differ diff --git a/mimeicons/text-x-csrc.png b/mimeicons/text-x-csrc.png new file mode 100644 index 0000000..6a9f2e8 Binary files /dev/null and b/mimeicons/text-x-csrc.png differ diff --git a/mimeicons/text-x-css.png b/mimeicons/text-x-css.png new file mode 100644 index 0000000..6d3b7e7 Binary files /dev/null and b/mimeicons/text-x-css.png differ diff --git a/mimeicons/text-x-generic.png b/mimeicons/text-x-generic.png new file mode 100644 index 0000000..924a5eb Binary files /dev/null and b/mimeicons/text-x-generic.png differ diff --git a/mimeicons/text-x-go.png b/mimeicons/text-x-go.png new file mode 100644 index 0000000..3ca93a6 Binary files /dev/null and b/mimeicons/text-x-go.png differ diff --git a/mimeicons/text-x-javascript.png b/mimeicons/text-x-javascript.png new file mode 100644 index 0000000..a37deb8 Binary files /dev/null and b/mimeicons/text-x-javascript.png differ diff --git a/mimeicons/text-x-preview.png b/mimeicons/text-x-preview.png new file mode 100644 index 0000000..b86d1ca Binary files /dev/null and b/mimeicons/text-x-preview.png differ diff --git a/mimeicons/text-x-python.png b/mimeicons/text-x-python.png new file mode 100644 index 0000000..05a7a7c Binary files /dev/null and b/mimeicons/text-x-python.png differ diff --git a/mimeicons/text-x-script.png b/mimeicons/text-x-script.png new file mode 100644 index 0000000..e476856 Binary files /dev/null and b/mimeicons/text-x-script.png differ diff --git a/mimeicons/text-x-vala.png b/mimeicons/text-x-vala.png new file mode 100644 index 0000000..81595dd Binary files /dev/null and b/mimeicons/text-x-vala.png differ diff --git a/mimeicons/video-x-generic.png b/mimeicons/video-x-generic.png new file mode 100644 index 0000000..167c9d0 Binary files /dev/null and b/mimeicons/video-x-generic.png differ diff --git a/mimeicons/x-office-calendar.png b/mimeicons/x-office-calendar.png new file mode 100644 index 0000000..5da8bd3 Binary files /dev/null and b/mimeicons/x-office-calendar.png differ diff --git a/mimeicons/x-office-document-template.png b/mimeicons/x-office-document-template.png new file mode 100644 index 0000000..834ebbe Binary files /dev/null and b/mimeicons/x-office-document-template.png differ diff --git a/mimeicons/x-office-document.png b/mimeicons/x-office-document.png new file mode 100644 index 0000000..20f5939 Binary files /dev/null and b/mimeicons/x-office-document.png differ diff --git a/mimeicons/x-office-drawing-template.png b/mimeicons/x-office-drawing-template.png new file mode 100644 index 0000000..34aa16d Binary files /dev/null and b/mimeicons/x-office-drawing-template.png differ diff --git a/mimeicons/x-office-drawing.png b/mimeicons/x-office-drawing.png new file mode 100644 index 0000000..7239629 Binary files /dev/null and b/mimeicons/x-office-drawing.png differ diff --git a/mimeicons/x-office-presentation-template.png b/mimeicons/x-office-presentation-template.png new file mode 100644 index 0000000..d1e9bff Binary files /dev/null and b/mimeicons/x-office-presentation-template.png differ diff --git a/mimeicons/x-office-presentation.png b/mimeicons/x-office-presentation.png new file mode 100644 index 0000000..dfc73b4 Binary files /dev/null and b/mimeicons/x-office-presentation.png differ diff --git a/mimeicons/x-office-spreadsheet-template.png b/mimeicons/x-office-spreadsheet-template.png new file mode 100644 index 0000000..dcec754 Binary files /dev/null and b/mimeicons/x-office-spreadsheet-template.png differ diff --git a/mimeicons/x-office-spreadsheet.png b/mimeicons/x-office-spreadsheet.png new file mode 100644 index 0000000..03e7755 Binary files /dev/null and b/mimeicons/x-office-spreadsheet.png differ diff --git a/php/configuration.php b/php/configuration.php index 89efb2a..a8a7a29 100644 --- a/php/configuration.php +++ b/php/configuration.php @@ -8,12 +8,16 @@ if (file_exists("/home/alex")) { $database_username="alex"; $database_password="lol"; $database_location="127.0.0.1"; + + $storage_root = "/home/alex/fileup_storage"; } else { $database_name="adam"; $database_username="adam"; $database_password="asdfd"; $database_location="127.0.0.1"; + + $storage_root = "/home/adam/fileup_storage"; } diff --git a/php/upload.php b/php/upload.php index 93fa778..d9110c7 100644 --- a/php/upload.php +++ b/php/upload.php @@ -5,7 +5,6 @@ if (!array_key_exists('uf', $_FILES)) { exit(); } - $file = $_FILES['uf']; -- cgit v1.2.3