diff --git a/README.md b/README.md index b64478c..d4f60e8 100644 --- a/README.md +++ b/README.md @@ -21,8 +21,7 @@ TOKEN=KILL-YOURSELF.NOW - [X] 1.2.1 add file counter to main page - [X] 1.2.2 clean up this shitty code - [X] 1.2.3 bugfixes -- [ ] 1.3.0 new ui; accounts; utility endpoints -- [ ] 1.3.0 add utility endpoints: `/embed/:fileId` for discord, `/:fileId` for quick access +- [ ] 1.3.0 new ui; accounts; utility endpoints; multi file uploads - [ ] 1.3.1 disable cloning of local ips - [ ] 1.4.0 admin panel - [ ] 2.0.0 rewrite using theUnfunny's code as a base/rewrite using monofile-core diff --git a/src/style/app/uploader/add_new_files.scss b/src/style/app/uploader/add_new_files.scss new file mode 100644 index 0000000..21167ce --- /dev/null +++ b/src/style/app/uploader/add_new_files.scss @@ -0,0 +1,104 @@ +#uploadWindow { + #add_new_files { + background-color:#191919; + border: 1px solid gray; + padding: 0px 0px 10px 0px; + + @media screen and (max-width: 500px) { + width:100%; + } + + p { + font-family: "Fira Code", monospace; + text-align: left; + margin: 0px 0px 0px 10px; + font-size: 30px; + + span { + font-size:16px; + position:relative; + top:-4px; + left:10px; + } + + @media screen and (max-width:500px) { + font-size: 40px; + + span { + font-size:20px; + position:relative; + top:-6px; + left:10px; + } + } + } + + #file_add_btns { + width:calc( 100% - 20px ); + margin:auto; + position:relative; + display:flex; + flex-direction:row; + column-gap:10px; + + button, input[type=text] { + background-color:#333333; + color:#DDDDDD; + border:none; + outline:none; + padding:5px; + + flex-basis:50%; + flex-grow:1; + transition-duration:250ms; + + @media screen and (max-width: 500px) { + font-size:16px; + padding:10px; + } + } + + button { + cursor:pointer; + + &:hover { + @media screen and (min-width: 500px) { + transition-duration:250ms; + flex-basis: 60%; + } + background-color:#393939; + color: #ffffff; + } + } + + .fileUpload { + width:100%; + height:100px; + position:relative; + + background-color:#262626; + + input[type=file] { + opacity: 0; + position:absolute; + left:0px; + top:0px; + width:100%; + height:100%; + cursor:pointer; + } + + p { + position:absolute; + top:50%; + transform:translateY(-50%); + font-size:12px; + width:100%; + text-align:center; + padding:0px; + margin: 0px; + } + } + } + } +} \ No newline at end of file diff --git a/src/style/app/uploads.scss b/src/style/app/uploads.scss index a0bc6a7..0e294f1 100644 --- a/src/style/app/uploads.scss +++ b/src/style/app/uploads.scss @@ -1,10 +1,14 @@ +@use "uploader/add_new_files"; + #uploadWindow { position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); - padding:5px 10px 10px 10px; + padding:10px 15px 10px 15px; + width:350px; + background-color:#222222; color:#ddd; @@ -25,77 +29,6 @@ .number { font-family: "Inconsolata", monospace; } - - #add_new_files { - background-color:#191919; - border: 1px solid gray; - width:350px; - padding: 0px 0px 10px 0px; - - @media screen and (max-width: 500px) { - width:100%; - } - - p { - font-family: "Fira Code", monospace; - text-align: left; - margin: 0px 0px 0px 10px; - font-size: 30px; - - span { - font-size:16px; - position:relative; - top:-4px; - left:10px; - } - - @media screen and (max-width:500px) { - font-size: 40px; - - span { - font-size:20px; - position:relative; - top:-6px; - left:10px; - } - } - } - - #file_add_btns { - width:calc( 100% - 20px ); - margin:auto; - position:relative; - display:flex; - flex-direction:row; - column-gap:10px; - - button { - background-color:#333333; - color:#DDDDDD; - border:none; - padding:5px; - - flex-basis:50%; - flex-grow:1; - transition-duration:250ms; - cursor:pointer; - - @media screen and (max-width: 500px) { - font-size:16px; - padding:10px; - } - - &:hover { - @media screen and (min-width: 500px) { - transition-duration:250ms; - flex-basis: 60%; - } - background-color:#393939; - color: #ffffff; - } - } - } - } @media screen and (max-width: 500px) { width: calc( 100% - 20px ); diff --git a/src/svelte/elem/UploadWindow.svelte b/src/svelte/elem/UploadWindow.svelte index a1bfdd1..e9e30b2 100644 --- a/src/svelte/elem/UploadWindow.svelte +++ b/src/svelte/elem/UploadWindow.svelte @@ -2,6 +2,8 @@ // stats + import AttachmentZone from "./uploader/AttachmentZone.svelte"; + let ServerStats = {} fetch("/server").then(async (data) => { @@ -10,6 +12,7 @@ // uploads + let attachmentZone; let uploads = new Map() @@ -22,7 +25,7 @@
{#each Array.from(uploads.entries()) as upload (upload[0])} -
+
{/each} @@ -30,21 +33,21 @@
-
-

+add files

-
- -
-
+ {#if uploads.size < 1} + + {/if}

Hosting {ServerStats.files || "•••"} files + — + Maximum filesize is {((ServerStats.maxDiscordFileSize || 0)*(ServerStats.maxDiscordFiles || 0))/1048576 || "•••"}MB

Made with ❤ by @nbitzzsource

+
\ No newline at end of file diff --git a/src/svelte/elem/uploader/AttachmentZone.svelte b/src/svelte/elem/uploader/AttachmentZone.svelte new file mode 100644 index 0000000..cbdfaf6 --- /dev/null +++ b/src/svelte/elem/uploader/AttachmentZone.svelte @@ -0,0 +1,56 @@ + + + + +
+

+add files

+ {#if !uploadType} +
+ + +
+ {:else} + {#if uploadType == uploadTypes.files} +
+
+

click/tap to browse
or drag files into this box

+ +
+
+ {:else if uploadType == uploadTypes.clone} +
+ + +
+ {/if} + {/if} +
\ No newline at end of file