Files
lichx-blog/pages/index.vue
T

81 lines
2.5 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<script setup lang="ts">
import breakpointsHelper from '~/utils/breakpointsHelper.ts';
import ThemeChange from '~/pages/index/components/ThemeChange.vue';
const hitokoto = ref('加载中...');
onMounted(async () => {
const src = await $fetch<{ hitokoto: string; from_who?: string; from?: string }>('https://v1.hitokoto.cn?c=k');
hitokoto.value = `${src.hitokoto} —— ${src.from_who ? src.from_who : '佚名'}${src.from ? `,${src.from}` : '未知来源'}`;
});
</script>
<template>
<NuxtLayout :name="'user-layout'">
<template #navbarLeft="{ isScrollDown } : { isScrollDown: boolean }">
<Transition
enter-active-class="transition-opacity duration-500 ease-in-out"
enter-from-class="opacity-0"
enter-to-class="opacity-100"
leave-active-class="transition-opacity duration-500 ease-in-out"
leave-from-class="opacity-100"
leave-to-class="opacity-0"
>
<div
v-if="isScrollDown && breakpointsHelper.greaterOrEqual('xl').value"
class="pl-5 text-xl h-12 leading-11 flex">
随机存取
</div>
</Transition>
</template>
<template #navbarRight>
<div class="flex items-center h-full">
<div class="flex-1"/>
<div class="flex-1 flex items-center justify-end ease-in-out">
<ThemeChange />
</div>
</div>
</template>
<template #header>
<div class="w-full flex-1 justify-center flex items-center">
<p class="text-8xl mt-12">
随机存取
</p>
</div>
</template>
<template #content>
<div class="max-w-full">
<NuxtRouteAnnouncer/>
<NuxtPage class="max-w-full"/>
</div>
</template>
<template #footer>
<div class="w-full flex flex-col justify-center items-center p-10 text-old-neutral-500">
<div>
{{ hitokoto }}
</div>
<div>
© 2025 随机存取. 由Lichx制作
</div>
<div>
蒙ICP备2025022865号
</div>
<div class="flex items-center justify-center w-full">
<img src="/logo01.6189a29f.png" alt="警徽图" class="w-5"/>
<a
href="https://beian.mps.gov.cn/#/query/webSearch?code=15020202000411"
target="_blank"
rel="noreferrer"
class="hover:text-old-neutral-700 dark:hover:text-old-neutral-300">
蒙公网安备15020202000411号
</a>
</div>
</div>
</template>
</NuxtLayout>
</template>
<style scoped>
</style>