forked from antfu-collective/vitesse-nuxt3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/antfu/vitesse-nuxt3
- Merge upstream (upgraded to nuxt@3.0.0) - Temporary fixing `vue-tsc` to `1.0.13` to workaround: https://github.com/nuxt/framework/issues/9777#issuecomment-1357547284 - Temporary using forked `unplugin-auto-imports` and `unplugin-vue-components` for `nuxt@3.0.0` compatibility - Remove GraphQL
- Loading branch information
Showing
37 changed files
with
2,213 additions
and
4,084 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<script setup lang="ts"> | ||
const { t } = useI18n() | ||
const { data } = await useFetch('/api/pageview' as const) | ||
const time = useTimeAgo( | ||
computed(() => data.value?.startAt ?? new Date()), | ||
{ | ||
fullDateFormatter: (date: Date) => date.toLocaleDateString(), | ||
messages: { | ||
justNow: t('justNow'), | ||
past: (n: number | string) => | ||
String(n).match(/\d/) ? t('timeAgo', [n]) : String(n), | ||
future: (n: number | string) => | ||
String(n).match(/\d/) ? t('inTime', [n]) : String(n), | ||
second: (n: number | string) => `${n} ${t(`second${n > 1 ? 's' : ''}`)}`, | ||
minute: (n: number | string) => `${n} ${t(`minute${n > 1 ? 's' : ''}`)}`, | ||
hour: (n: number | string) => `${n} ${t(`hour${n > 1 ? 's' : ''}`)}`, | ||
day: (n: number | string, past: boolean) => | ||
n === 1 | ||
? past | ||
? t('yesterday') | ||
: t('tomorrow') | ||
: `${n} ${t(`day${n > 1 ? 's' : ''}`)}`, | ||
week: (n: number | string, past: boolean) => | ||
n === 1 | ||
? past | ||
? t('last week') | ||
: t('next week') | ||
: `${n} ${t(`week${n > 1 ? 's' : ''}`)}`, | ||
month: (n: number | string, past: boolean) => | ||
n === 1 | ||
? past | ||
? t('last month') | ||
: t('next month') | ||
: `${n} ${t(`month${n > 1 ? 's' : ''}`)}`, | ||
year: (n: number | string, past: boolean) => | ||
n === 1 | ||
? past | ||
? t('last year') | ||
: t('next year') | ||
: `${n} ${t(`year${n > 1 ? 's' : ''}`)}`, | ||
}, | ||
}, | ||
) | ||
</script> | ||
|
||
<template> | ||
<div text-gray:80> | ||
<span v-if="data" font-500 text-gray> | ||
{{ | ||
$t('visited', { | ||
count: data.pageview, | ||
time, | ||
}) | ||
}} | ||
</span> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.