added loading file

This commit is contained in:
you 2024-06-26 21:15:37 +03:00
parent 776c7cc2c6
commit b0bf630dca

View File

@ -89,6 +89,8 @@
}, 500);
let showAlertQuit = false;
let loadedFile = "";
</script>
<div
@ -198,15 +200,26 @@
</p>
</div>
</div>
<button on:click={()=>{
document.getElementById('loaded-file').click();
}}
class={"bg-indigo-800 hover:bg-indigo-700 ring-transparent" +
" w-full font-semibold text-xl flex gap-1 justify-center items-center text-center p-4 rounded-3xl transition-all duration-75 ring-2 ring-inset focus:outline-none focus:ring-inset focus:ring-1 focus:ring-white"}
>Загрузить чек</button>
<p class="text-xl font-semibold">Загружен файл: {loadedFile}</p>
<button
on:click={() => {}}
disabled={loadedFile === ""}
class={(false
? "bg-slate-950 ring-indigo-800 hover:bg-slate-900"
: "bg-green-800 hover:bg-green-700 ring-transparent") +
" w-full font-semibold text-xl flex gap-1 justify-center items-center text-center p-4 rounded-3xl transition-all duration-75 ring-2 ring-inset focus:outline-none focus:ring-inset focus:ring-1 focus:ring-white"}
" w-full font-semibold text-xl flex gap-1 disabled:bg-slate-950 disabled:ring-2 disabled:ring-inset disabled:ring-red-800 justify-center items-center text-center p-4 rounded-3xl transition-all duration-75 ring-2 ring-inset focus:outline-none focus:ring-inset focus:ring-1 focus:ring-white"}
>
{"Я оплатил"}
</button>
<input on:change={(e)=>{
loadedFile = e.target.files[0].name;
}} id="loaded-file" type="file" hidden accept=".png, .jpg, .jpeg, .pdf">
{/if}
{/if}
</div>