Move into app/

This commit is contained in:
2025-10-07 13:52:57 +07:00
parent 6dd7d33661
commit 36f5508d48
95 changed files with 28 additions and 19 deletions
+26
View File
@@ -0,0 +1,26 @@
<template>
<template v-if="post">
<NuxtLink class="post-card" :to="post.path">
<img :src="post.coverImage" :alt="post?.title + 's cover image'"/>
<div class="post-card-content">
<h3>{{ post.title }}</h3>
<p :title="post.description">{{ post.description }}</p>
<p class="mt-4 text-xs" :title="useFormatDate(post.dateUpdated)">{{ useRelativeDate(post.dateUpdated) }}</p>
</div>
</NuxtLink>
</template>
</template>
<script setup lang="ts">
const config = useRuntimeConfig();
const baseUrl = config.public.baseUrl
import { useFormatDate } from '~/composables/formatDate';
import { useRelativeDate } from '~/composables/relativeDate';
import type { PostsCollectionItem } from '@nuxt/content'
defineProps<{
post: PostsCollectionItem
}>()
</script>
+26
View File
@@ -0,0 +1,26 @@
<template>
<section class="post-card-container">
<template v-for="post in posts" :key="post.id">
<PostCard :post="post" />
</template>
</section>
</template>
<script lang="ts" setup>
const route = useRoute();
const currentRoute = route.path
const props = defineProps<{
limit?: number | null
}>()
const fetchLimit = props.limit ?? undefined
const { data: posts } = await useAsyncData(
`${currentRoute}-blog`,
async () => {
let query = queryCollection('posts').order('dateUpdated', 'DESC')
if (fetchLimit) {
query = query.limit(fetchLimit)
}
return query.all()
}
)
</script>
+27
View File
@@ -0,0 +1,27 @@
<script setup lang="ts">
import WebThemeToggle from './web-theme-toggle.vue';
</script>
<template>
<footer>
<div class="article">
<section class="web-section">
<h3 class="text-2xl md:text-3xl mb-4 font-light">Techit's Home /// thawia.ng</h3>
<p>
<small>
Copyright &copy; Techit Thawiang 2025 (2568). All rights reserved.<br>
PGP/GPG Key: <code style="font-size: 12px;"><a href="https://files.thawia.ng/files/Techit Thawiang_0xE649CED321557334_public.asc">4116 33BE 1B4A 19D4 8D77 9ADE E649 CED3 2155 7334</a></code><br>
Powered by <a class="link" href="https://dailitation.xyz">dailitation.xyz</a>, <a class="link" href="https://github.com/TechitWinner/web">Source Code</a>.
</small>
</p>
<p>
<small>
More from me: <a class="link" href="https://unix.in.th">unix.in.th</a> and <a class="link" href="https://uptime.dailitation.xyz">Network Status</a>
</small>
</p>
<WebThemeToggle/>
</section>
</div>
</footer>
</template>
+102
View File
@@ -0,0 +1,102 @@
<template>
<div class="sticky top-0 w-full h-14 overflow-visible">
<header :class="{'web-header': true, 'web-header-autohide': !mobileHamburger }">
<section class="web-heading z-10">
<NuxtLink href="/" @click="closeMobileHamburger" class="web-heading-left-section text-(--ui-text) hover:text-primary">
<img width="36" height="36"src="/favicon.ico">
<p title="thawia.ng, Go home" class="web-nav-title mx-2" aria-hidden="true">TechitWinner</p>
</NuxtLink>
<div class="web-heading-right-section">
<nav v-if="!mobileHamburger" class="nav-links">
<ul class="nav-wrapper">
<li class="nav-link">
<NuxtLink href="/posts">Posts</NuxtLink>
</li>
<!-- <li class="nav-link">
<NuxtLink href="/projects">Projects</NuxtLink>
</li>
<li class="nav-link">
<NuxtLink href="/about">About</NuxtLink>
</li> -->
<li class="nav-link">
<NuxtLink title="Contact" href="/contact">Contact</NuxtLink>
</li>
<li class="nav-link">
<NuxtLink title="Fonts" href="/fonts">Fonts</NuxtLink>
</li>
<li class="nav-link">
<NuxtLink title="Collection" href="/collections">Collections</NuxtLink>
</li>
</ul>
</nav>
<button class="hamburger-toggle" @click="toggleMobileHamburger">
<Icon name="oundr:menu"/>
</button>
</div>
</section>
</header>
<nav :class="{'hamburger-menu': true, 'hamburger-menu-hidden': !mobileHamburger }">
<ul class="nav-wrapper">
<li class="nav-link">
<NuxtLink title="Go home" aria-label="Go home" @click="closeMobileHamburger" href="/">Home</NuxtLink>
</li>
<li class="nav-link">
<NuxtLink title="Go to posts" aria-label="Go to posts" @click="closeMobileHamburger" href="/posts">Posts</NuxtLink>
</li>
<li class="nav-link">
<NuxtLink title="Go to contact" aria-label="Go to contact" @click="closeMobileHamburger" href="/contact">Contact</NuxtLink>
</li>
<li class="nav-link">
<NuxtLink title="Go to fonts" aria-label="Go to fonts" @click="closeMobileHamburger" href="/fonts">Fonts</NuxtLink>
</li>
<li class="nav-link">
<NuxtLink title="Go to collections" aria-label="Go to collections" @click="closeMobileHamburger" href="/collections">Collections</NuxtLink>
</li>
<li class="nav-button nav-button-only-desktop">
<button role="button" class="hamburger-btn-square" @click="closeMobileHamburger" title="Close this menu" aria-label="Close this menu"><Icon name="oundr:x"/></button>
</li>
</ul>
</nav>
</div>
</template>
<script setup>
const navs = [
{
"label": "Home",
"href": "/"
},
{
"label": "Posts",
"href": "/posts"
},
// {
// "label": "Projects",
// "href": "/projects"
// },
// {
// "label": "About",
// "href": "/about"
// },
{
"label": "Contact",
"href": "/contact"
},
{
"label": "Fonts",
"href": "/fonts"
},
{
"label": "Collections",
"href": "/collections"
}
]
const mobileHamburger = ref(false);
function toggleMobileHamburger() {
mobileHamburger.value = !mobileHamburger.value
}
function closeMobileHamburger() {
mobileHamburger.value = false
}
</script>
+21
View File
@@ -0,0 +1,21 @@
<script setup>
const colorMode = useColorMode()
const isDark = computed({
get() {
return colorMode.value === 'dark'
},
set() {
colorMode.preference = colorMode.value === 'dark' ? 'light' : 'dark'
}
})
</script>
<template>
<ClientOnly v-if="!colorMode?.forced">
<button @click="isDark = !isDark" class="btn btn-sm btn-neutral">Toggle Theme</button>
<template #fallback>
<button class="btn btn-sm btn-neutral">Loading...</button>
</template>
</ClientOnly>
</template>