This commit is contained in:
May 2023-01-29 15:44:23 -08:00
parent 37c6537abb
commit eba3221d86
2 changed files with 44 additions and 5 deletions

View file

@ -22,7 +22,8 @@ TOKEN=KILL-YOURSELF.NOW
- [X] 1.2.2 clean up this shitty code - [X] 1.2.2 clean up this shitty code
- [X] 1.2.3 bugfixes - [X] 1.2.3 bugfixes
- [ ] 1.3.0 new ui; accounts; utility endpoints; multi file uploads - [ ] 1.3.0 new ui; accounts; utility endpoints; multi file uploads
- [ ] 1.3.1 disable cloning of local ips - [ ] 1.3.1 self-destruct option
- [ ] 1.3.2 disable cloning of local ips
- [ ] 1.4.0 admin panel - [ ] 1.4.0 admin panel
- [ ] 2.0.0 rewrite using theUnfunny's code as a base/rewrite using monofile-core - [ ] 2.0.0 rewrite using theUnfunny's code as a base/rewrite using monofile-core

View file

@ -1,5 +1,4 @@
<script> <script>
import { fade, scale } from "svelte/transition";
import { circIn, circOut } from "svelte/easing" import { circIn, circOut } from "svelte/easing"
let uploadTypes = { let uploadTypes = {
@ -27,6 +26,45 @@
} }
} }
} }
// file upload
let fileUpload;
$: {
if (fileUpload) {
fileUpload.addEventListener("change",() => {
uploadType = undefined
})
}
}
// file clone
/**
* @type HTMLButtonElement
*/
let cloneButton;
/**
* @type HTMLInputElement
*/
let cloneUrlTextbox;
$: {
if (cloneButton && cloneUrlTextbox) {
cloneButton.addEventListener("click",() => {
if (cloneUrlTextbox.value) {
uploadType = undefined;
} else {
cloneUrlTextbox.animate([
{"transform":"translateX(0px)"},
{"transform":"translateX(-3px)"},
{"transform":"translateX(3px)"},
{"transform":"translateX(0px)"}
],100)
}
})
}
}
</script> </script>
<!-- there are 100% better ways to do this but idgaf, it's still easier to manage than <1.3 lmao --> <!-- there are 100% better ways to do this but idgaf, it's still easier to manage than <1.3 lmao -->
@ -43,13 +81,13 @@
<div id="file_add_btns" out:_void in:_void={{easingFunc:circOut}}> <div id="file_add_btns" out:_void in:_void={{easingFunc:circOut}}>
<div class="fileUpload"> <div class="fileUpload">
<p>click/tap to browse<br/>or drag files into this box</p> <p>click/tap to browse<br/>or drag files into this box</p>
<input type="file" multiple> <input type="file" multiple bind:this={fileUpload}>
</div> </div>
</div> </div>
{:else if uploadType == uploadTypes.clone} {:else if uploadType == uploadTypes.clone}
<div id="file_add_btns" out:_void in:_void={{easingFunc:circOut}}> <div id="file_add_btns" out:_void in:_void={{easingFunc:circOut}}>
<input placeholder="url" type="text"> <input placeholder="url" type="text" bind:this={cloneUrlTextbox}>
<button style:flex-basis="30%">add file</button> <button style:flex-basis="30%" bind:this={cloneButton}>add file</button>
</div> </div>
{/if} {/if}
{/if} {/if}