vitesse/src/pages/index.vue
userquin 0d571d6cc2
fix: accessibility (#57)
* fix accesibility issues:
- index.vue: input without label
- about.vue: color contrast doesn't have sufficient contrast ratio on code sample on light theme

* optimize png icons:
pwa-192x192.png: -31.04%
pwa-512x512.png: -14.66%

use https://ezgif.com/

* chore: color

Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
2021-02-12 13:00:32 +08:00

62 lines
1.3 KiB
Vue

<script setup lang="ts">
import { ref } from 'vue'
import { useRouter } from 'vue-router'
import { useI18n } from 'vue-i18n'
const name = ref('')
const router = useRouter()
const go = () => {
if (name.value)
router.push(`/hi/${encodeURIComponent(name.value)}`)
}
const { t } = useI18n()
</script>
<template>
<div>
<p class="text-4xl">
<carbon-campsite class="inline-block" />
</p>
<p>
<a rel="noreferrer" href="https://github.com/antfu/vitesse" target="_blank">
Vitesse
</a>
</p>
<p>
<em class="text-sm opacity-75">{{ t('intro.desc') }}</em>
</p>
<div class="py-4" />
<input
id="input"
v-model="name"
:placeholder="t('intro.whats-your-name')"
:aria-label="t('intro.whats-your-name')"
type="text"
autocomplete="false"
class="px-4 py-2 text-sm text-center bg-transparent border border-gray-200 rounded outline-none active:outline-none dark:border-gray-700"
style="width: 250px"
@keydown.enter="go"
>
<label class="hidden" for="input">{{ t('intro.whats-your-name') }}</label>
<div>
<button
class="m-3 text-sm btn"
:disabled="!name"
@click="go"
>
{{ t('button.go') }}
</button>
</div>
</div>
</template>
<route lang="yaml">
meta:
layout: home
</route>