From 064015f759b5f27d3f87db2bf1b9d8d2a93f5fac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFs=20Boubault?= <7613286+Applelo@users.noreply.github.com> Date: Fri, 15 Dec 2023 20:55:03 +0100 Subject: [PATCH 1/6] add favicons, add multiple headers, fix shikiji init --- app.vue | 100 ++++++++++++--------- bun.lockb | Bin 463550 -> 468899 bytes components/Footer.vue | 2 +- components/Result.vue | 34 +++---- package.json | 16 ++-- public/favicons/android-chrome-192x192.png | Bin 0 -> 3698 bytes public/favicons/android-chrome-512x512.png | Bin 0 -> 8978 bytes public/favicons/apple-touch-icon.png | Bin 0 -> 3263 bytes public/favicons/browserconfig.xml | 9 ++ public/favicons/favicon-16x16.png | Bin 0 -> 714 bytes public/favicons/favicon-32x32.png | Bin 0 -> 1234 bytes public/favicons/favicon.ico | Bin 0 -> 15086 bytes public/favicons/mstile-144x144.png | Bin 0 -> 6508 bytes public/favicons/mstile-150x150.png | Bin 0 -> 6250 bytes public/favicons/mstile-310x150.png | Bin 0 -> 6873 bytes public/favicons/mstile-310x310.png | Bin 0 -> 13753 bytes public/favicons/mstile-70x70.png | Bin 0 -> 2996 bytes public/favicons/safari-pinned-tab.svg | 62 +++++++++++++ public/favicons/site.webmanifest | 18 ++++ utils/schema.ts | 23 ++--- 20 files changed, 183 insertions(+), 81 deletions(-) create mode 100644 public/favicons/android-chrome-192x192.png create mode 100644 public/favicons/android-chrome-512x512.png create mode 100644 public/favicons/apple-touch-icon.png create mode 100644 public/favicons/browserconfig.xml create mode 100644 public/favicons/favicon-16x16.png create mode 100644 public/favicons/favicon-32x32.png create mode 100644 public/favicons/favicon.ico create mode 100644 public/favicons/mstile-144x144.png create mode 100644 public/favicons/mstile-150x150.png create mode 100644 public/favicons/mstile-310x150.png create mode 100644 public/favicons/mstile-310x310.png create mode 100644 public/favicons/mstile-70x70.png create mode 100644 public/favicons/safari-pinned-tab.svg create mode 100644 public/favicons/site.webmanifest diff --git a/app.vue b/app.vue index 5deb6cb..e4fefd5 100644 --- a/app.vue +++ b/app.vue @@ -3,12 +3,11 @@ import type { FormError } from '#ui/types' const state = reactive({ url: undefined, - headerName: undefined, - headerValue: undefined, + headers: [], }) -const hasHeader = ref(false) const rawSchema = ref('') +const errorSchema = ref(null) const loading = ref(false) function validate(state: any): FormError[] { @@ -16,13 +15,13 @@ function validate(state: any): FormError[] { if (!state.url) errors.push({ path: 'url', message: 'Required' }) - if (hasHeader.value) { - if (!state.headerName) - errors.push({ path: 'headerName', message: 'Required' }) + // if (hasHeader.value) { + // if (!state.headerName) + // errors.push({ path: 'headerName', message: 'Required' }) - if (!state.headerValue) - errors.push({ path: 'headerValue', message: 'Required' }) - } + // if (!state.headerValue) + // errors.push({ path: 'headerValue', message: 'Required' }) + // } return errors } @@ -30,7 +29,8 @@ function validate(state: any): FormError[] { async function onSubmit() { rawSchema.value = '' loading.value = true - const { data } = await useAsyncData(() => getSchema(state)) + const { data, error } = await useAsyncData(() => getSchema(state)) + errorSchema.value = error.value if (!data.value) return loading.value = false @@ -38,10 +38,6 @@ async function onSubmit() { loading.value = false } -const headerValuePlaceholder = computed( - () => (Math.random() + 1).toString(36).substring(2), -) - useHead({ htmlAttrs: { lang: 'en', @@ -52,6 +48,13 @@ useHead({