feat(ui): improve looks and add icons

This commit is contained in:
Pihkaal
2024-10-03 04:25:16 +02:00
parent cf9c5f02f6
commit ef04a2cc9e

80
app.vue
View File

@@ -99,8 +99,12 @@ const upperCase = (str: string) => str.toUpperCase();
<NuxtRouteAnnouncer /> <NuxtRouteAnnouncer />
<canvas ref="canvas" class="hidden" /> <canvas ref="canvas" class="hidden" />
<div class="p-5 w-full max-w-[850px] flex flex-col justify-center space-y-3"> <div
<h1 class="text-4xl font-bold text-gray-700 dark:text-gray-200 border-b border-gray-700"> class="p-5 w-full max-w-[850px] flex flex-col justify-center space-y-4"
>
<h1
class="text-4xl font-bold text-gray-700 dark:text-gray-200 border-b border-gray-700"
>
Simple QRCode Generator Simple QRCode Generator
</h1> </h1>
<div class="flex justify-between space-x-8"> <div class="flex justify-between space-x-8">
@@ -108,13 +112,27 @@ const upperCase = (str: string) => str.toUpperCase();
<div class="flex-1 flex flex-col justify-center"> <div class="flex-1 flex flex-col justify-center">
<UForm ref="form" :state="state" class="space-y-4"> <UForm ref="form" :state="state" class="space-y-4">
<UFormGroup label="Username or link" name="content" @input="updateQRCode"> <UFormGroup
<UInput v-model="state.content" placeholder="Your username or profile link" /> label="Username or link"
name="content"
@input="updateQRCode"
>
<UInput
icon="i-heroicons-user"
v-model="state.content"
placeholder="Your username or profile link"
/>
</UFormGroup> </UFormGroup>
<UFormGroup label="Logo" name="logo"> <UFormGroup label="Logo" name="logo">
<USelectMenu v-model="state.logo" :options="LOGOS" placeholder="Select logo" searchable <USelectMenu
@change="updateQRCode"> icon="i-heroicons-photo"
v-model="state.logo"
:options="LOGOS"
placeholder="Select logo"
searchable
@change="updateQRCode"
>
<template #label> <template #label>
<span v-if="state.logo">{{ capitalize(state.logo) }}</span> <span v-if="state.logo">{{ capitalize(state.logo) }}</span>
</template> </template>
@@ -126,8 +144,13 @@ const upperCase = (str: string) => str.toUpperCase();
</UFormGroup> </UFormGroup>
<UFormGroup label="Format" name="format"> <UFormGroup label="Format" name="format">
<USelectMenu v-model="state.format" :options="IMAGE_FORMATS" placeholder="Select format" <USelectMenu
@change="updateQRCode"> icon="i-heroicons-document-duplicate"
v-model="state.format"
:options="IMAGE_FORMATS"
placeholder="Select format"
@change="updateQRCode"
>
<template #label> <template #label>
<span v-if="state.format">{{ upperCase(state.format) }}</span> <span v-if="state.format">{{ upperCase(state.format) }}</span>
</template> </template>
@@ -140,17 +163,46 @@ const upperCase = (str: string) => str.toUpperCase();
<UFormGroup label="API"> <UFormGroup label="API">
<UButtonGroup size="sm" orientation="horizontal" class="w-full"> <UButtonGroup size="sm" orientation="horizontal" class="w-full">
<UInput v-model="apiUrl" disabled placeholder="Please fill all fields first" class="w-full" /> <UInput
<UButton :disabled="isQRCodeEmpty" :icon="copyUrlIcon" @click="copyUrl" /> v-model="apiUrl"
disabled
placeholder="Please fill all fields first"
class="w-full"
/>
<UButton
:disabled="isQRCodeEmpty"
:icon="copyUrlIcon"
@click="copyUrl"
/>
</UButtonGroup> </UButtonGroup>
</UFormGroup> </UFormGroup>
<div class="flex space-x-4 pt-2"> <div class="flex space-x-4 pt-2">
<UButton class="flex-1" block :icon="copyImageIcon" size="md" color="primary" variant="solid" <UButton
:label="copyImageLabel" :trailing="false" :disabled="isQRCodeEmpty" @click="copyQRCode" /> class="flex-1"
block
:icon="copyImageIcon"
size="md"
color="primary"
variant="solid"
:label="copyImageLabel"
:trailing="false"
:disabled="isQRCodeEmpty"
@click="copyQRCode"
/>
<UButton class="flex-1" block icon="i-heroicons-arrow-down-tray" size="md" color="primary" variant="solid" <UButton
label="Download" :trailing="false" :disabled="isQRCodeEmpty" @click="downloadQRCode" /> class="flex-1"
block
icon="i-heroicons-arrow-down-tray"
size="md"
color="primary"
variant="solid"
label="Download"
:trailing="false"
:disabled="isQRCodeEmpty"
@click="downloadQRCode"
/>
</div> </div>
</UForm> </UForm>
</div> </div>