frontend: image file picker
This commit is contained in:
parent
ac97e5b152
commit
831f3a5f98
2 changed files with 18 additions and 8 deletions
|
@ -1,8 +1,15 @@
|
|||
<script lang="ts">
|
||||
const { handler, size = 32 } = $props();
|
||||
let { handler = () => {}, type = "button", files = $bindable() } = $props();
|
||||
</script>
|
||||
|
||||
<button class="plus round" style="height: {size}px;" onclick={handler}>+</button>
|
||||
{#if type == "button"}
|
||||
<button class="plus round" style="height: 32px;" onclick={handler}>+</button>
|
||||
{:else if type == "image"}
|
||||
<label for="img-upload" class="plus round" style="height: 48px; display: inline-block;">+</label>
|
||||
<input id="img-upload" accept="image/png, image/jpeg" style="display: none" bind:files type="file"/>
|
||||
{:else}
|
||||
TODO
|
||||
{/if}
|
||||
|
||||
<style>
|
||||
/* Кнопка "плюс" */
|
||||
|
@ -11,6 +18,8 @@
|
|||
aspect-ratio: 1 / 1;
|
||||
font-size: x-large;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
align-content: center;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: light) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue