mirror of https://github.com/VERT-sh/VERT.git
chore: remove unused dropping code
This commit is contained in:
parent
5cc9056c33
commit
5b07832267
|
@ -13,17 +13,8 @@
|
||||||
|
|
||||||
const { class: classList }: Props = $props();
|
const { class: classList }: Props = $props();
|
||||||
|
|
||||||
let dropping = $state(false);
|
|
||||||
let uploaderButton = $state<HTMLButtonElement>();
|
let uploaderButton = $state<HTMLButtonElement>();
|
||||||
|
|
||||||
const dropFiles = (e: DragEvent) => {
|
|
||||||
e.preventDefault();
|
|
||||||
dropping = false;
|
|
||||||
const oldLength = files.files.length;
|
|
||||||
files.add(e.dataTransfer?.files);
|
|
||||||
if (oldLength !== files.files.length) goto("/convert");
|
|
||||||
};
|
|
||||||
|
|
||||||
const uploadFiles = async () => {
|
const uploadFiles = async () => {
|
||||||
const input = document.createElement("input");
|
const input = document.createElement("input");
|
||||||
input.type = "file";
|
input.type = "file";
|
||||||
|
@ -68,14 +59,9 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
ondragenter={() => (dropping = true)}
|
|
||||||
ondragleave={() => (dropping = false)}
|
|
||||||
ondrop={dropFiles}
|
|
||||||
onclick={uploadFiles}
|
onclick={uploadFiles}
|
||||||
bind:this={uploaderButton}
|
bind:this={uploaderButton}
|
||||||
class={clsx(`hover:scale-105 active:scale-100 duration-200 ${classList}`, {
|
class={clsx(`hover:scale-105 active:scale-100 duration-200 ${classList}`)}
|
||||||
"scale-105": dropping,
|
|
||||||
})}
|
|
||||||
>
|
>
|
||||||
<Panel
|
<Panel
|
||||||
class="flex justify-center items-center w-full h-full flex-col pointer-events-none"
|
class="flex justify-center items-center w-full h-full flex-col pointer-events-none"
|
||||||
|
|
|
@ -200,11 +200,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div class="grid grid-rows-1 grid-cols-1 h-full flex-grow z-50">
|
||||||
class="grid grid-rows-1 grid-cols-1 h-full flex-grow z-50 {dropping
|
|
||||||
? 'pointer-events-none'
|
|
||||||
: ''}"
|
|
||||||
>
|
|
||||||
{#key page.url.pathname}
|
{#key page.url.pathname}
|
||||||
<div
|
<div
|
||||||
class="row-start-1 col-start-1"
|
class="row-start-1 col-start-1"
|
||||||
|
|
Loading…
Reference in New Issue