reduce dependencies, and stop blocking

This commit is contained in:
Zoe
2024-09-25 03:13:40 -05:00
parent d85b6e7fe8
commit d0fb293c76
16 changed files with 414 additions and 14221 deletions

BIN
bun.lockb Executable file

Binary file not shown.

View File

@@ -1,21 +1,15 @@
<script setup lang="ts"> <script setup lang="ts">
let colorMode = useColorMode(); const toggleTheme = () => {
if (import.meta.client) {
const changeTheme = () => { if (document.documentElement.classList.contains('dark')) {
if (colorMode.preference === "dark") { document.documentElement.classList.remove('dark');
// from dark => light localStorage.setItem('theme', 'light');
colorMode.preference = "light" } else {
} else if (colorMode.preference === "light") { document.documentElement.classList.add('dark');
// from light => system localStorage.setItem('theme', 'dark');
colorMode.preference = "system"; }
} else {
// from system => dark
colorMode.preference = "dark";
} }
};
return;
}
</script> </script>
<template> <template>
@@ -28,12 +22,12 @@ const changeTheme = () => {
<a href="#main">Skip to content</a> <a href="#main">Skip to content</a>
</li> </li>
<li> <li>
<NuxtLink to="/"> <NuxtLink :prefetch="true" to="/">
Home Home
</NuxtLink> </NuxtLink>
</li> </li>
<li> <li>
<NuxtLink to="/blog"> <NuxtLink :prefetch="true" to="/blog">
Blog Blog
</NuxtLink> </NuxtLink>
</li> </li>
@@ -57,11 +51,10 @@ const changeTheme = () => {
</a> </a>
</li> </li>
<li> <li>
<button @click="changeTheme"> <button @click="toggleTheme">
<span class="min-w-[22px]" v-if="$colorMode.unknown != true"> <span class="min-w-[22px]">
<Icon v-if="$colorMode.preference === 'dark'" name="tabler:moon" size="22" /> <Icon class="theme-dark" name="tabler:moon" size="22" />
<Icon v-else-if="$colorMode.preference === 'light'" name="tabler:sun-high" size="22" /> <Icon class="theme-light" name="tabler:sun-high" size="22" />
<Icon v-else name="ph:monitor-bold" size="22" />
</span> </span>
</button> </button>
</li> </li>
@@ -76,4 +69,20 @@ const changeTheme = () => {
button { button {
padding: 0.25rem padding: 0.25rem
} }
.theme-dark {
display: none !important;
}
.theme-light {
display: inline !important;
}
html.dark .theme-light {
display: none !important;
}
html.dark .theme-dark {
display: inline !important;
}
</style> </style>

View File

@@ -1,5 +1,4 @@
<script setup lang="ts"> <script setup lang="ts">
import { watchDebounced } from '@vueuse/core'
import type { Ref } from 'vue'; import type { Ref } from 'vue';
const props = withDefaults(defineProps<{ doc: any, activeTocId: string | null }>(), {}) const props = withDefaults(defineProps<{ doc: any, activeTocId: string | null }>(), {})
@@ -23,22 +22,24 @@ const onClick = (id: string) => {
const tocHeader = ref(); const tocHeader = ref();
const tocIsClosed = ref(false); const tocIsClosed = ref(false);
watchDebounced( watch(
() => props.activeTocId, () => props.activeTocId,
(newActiveTocId) => { (newActiveTocId) => {
const h2Link = tocLinksH2.value.find((el: HTMLElement) => el.id === `toc-${newActiveTocId}`) if (import.meta.client) {
const h3Link = tocLinksH3.value.find((el: HTMLElement) => el.id === `toc-${newActiveTocId}`) const h2Link = tocLinksH2.value.find((el: HTMLElement) => el.id === `toc-${newActiveTocId}`)
const h3Link = tocLinksH3.value.find((el: HTMLElement) => el.id === `toc-${newActiveTocId}`)
// TODO: dont hard code these offsets // TODO: dont hard code these offsets
if (h2Link) { if (h2Link) {
sliderHeight.value = h2Link.offsetHeight sliderHeight.value = h2Link.offsetHeight
sliderTop.value = h2Link.offsetTop - 24 sliderTop.value = h2Link.offsetTop - 24
} else if (h3Link) { } else if (h3Link) {
sliderHeight.value = h3Link.offsetHeight sliderHeight.value = h3Link.offsetHeight
sliderTop.value = h3Link.offsetTop - 24 sliderTop.value = h3Link.offsetTop - 24
}
} }
}, },
{ debounce: 0, immediate: true } { immediate: true }
) )
</script> </script>

View File

@@ -0,0 +1,37 @@
<script lang="ts" setup>
const props = defineProps({
article: { type: Object, required: true },
});
</script>
<template>
<div
class="flex flex-col dark:bg-dark-slate bg-touched-lavender max-h-[563.25px] h-[563.25px] overflow-hidden rounded-lg border border-soft-lilac dark:border-midnight-slate/30 shadow-md">
<NuxtImg v-if="article.image" :src="article.image.src" width="464" densities="1x 2x" quality="80"
class="w-full rounded-tl-lg rounded-tr-lg aspect-video" loading="lazy" />
<div
class="flex-shrink p-3 overflow-hidden pt-2 text-fade dark:before:bg-[linear-gradient(180deg,transparent_0,hsla(0,0%,5%,0)_36%,#0C0B0C_95%,#0C0B0C)] before:bg-[linear-gradient(180deg,transparent_0,hsla(0,0%,5%,0)_36%,#F5EDFE_95%,#F5EDFE)] mb-1 pb-1 relative">
<h3>
<NuxtLink tabindex="0" class="text-lg" :prefetch="true" :to="article._path">
{{ article.title }}
</NuxtLink>
</h3>
<p class="dark:text-zinc-400 text-zinc-600">
{{ article.description }}
</p>
<p class="text-zinc-500">
{{ new Date(article.date).toDateString().split(' ').slice(1).join(' ') }} |
{{ article.readTime }} minute read
</p>
<div
class="flex flex-wrap w-full gap-2 justify-start my-1 dark:text-zinc-200 text-zinc-800 max-h-[13.75rem]">
<IconTag v-for="tag in article.tags" :name="tag" :iconName='tag' isTag="true" />
</div>
<div class="max-h-full leading-relaxed">
<ContentRenderer :value="article">
<ContentRendererMarkdown :value="article" :excerpt="true" />
</ContentRenderer>
</div>
</div>
</div>
</template>

View File

@@ -0,0 +1,35 @@
<script lang="ts" setup>
const titleWidth = Math.max(Math.floor(Math.random() * 300), 175);
</script>
<template>
<div
class="flex flex-col dark:bg-dark-slate bg-touched-lavender max-h-[563.25px] h-[563.25px] overflow-hidden rounded-lg border border-soft-lilac dark:border-midnight-slate/30 shadow-md">
<div class="w-full rounded-tl-lg rounded-tr-lg aspect-video dark:bg-zinc-400 bg-zinc-600 animate-pulse">
</div>
<div
class="flex-shrink p-3 overflow-hidden pt-2 text-fade dark:before:bg-[linear-gradient(180deg,transparent_0,hsla(0,0%,5%,0)_36%,#0C0B0C_95%,#0C0B0C)] before:bg-[linear-gradient(180deg,transparent_0,hsla(0,0%,5%,0)_36%,#F5EDFE_95%,#F5EDFE)] mb-1 pb-1 relative">
<div class="h-5 mb-1 rounded-lg dark:bg-zinc-400 bg-zinc-600 animate-pulse"
:style="{ width: `${titleWidth}px` }"></div>
<div class="h-3 mb-1 rounded-lg dark:bg-zinc-400 bg-zinc-600 animate-pulse w-36"></div>
<div class="h-3 mb-1 rounded-lg bg-zinc-500 animate-pulse w-44"></div>
<div
class="flex flex-wrap w-full gap-2 justify-start my-1 dark:text-zinc-200 text-zinc-800 max-h-[13.75rem]">
<!-- <IconTag v-for="tag in article.tags" :name="tag" :iconName='tag' isTag="true" /> -->
<div v-for="i in Math.ceil(Math.random() * 4)"
class="font-inter md:text-lg w-fit max-h-9 min-w-fit dark:bg-obsidian-night bg-[hsl(270,68%,95.47%)] border border-soft-lilac dark:border-midnight-slate/30 py-1 px-2 rounded shadow flex items-center">
<div class="mb-1 rounded bg-zinc-500 animate-pulse w-[20px] h-[20px] mr-2"></div>
<div class="h-3 mb-1 rounded-lg bg-zinc-500 animate-pulse" :style="{ width: `${(i * 10) + 67}px` }">
</div>
</div>
</div>
<div class="max-h-full leading-relaxed">
<div v-for="i in 100" class="h-3 my-1 rounded-lg dark:bg-zinc-400 bg-zinc-600 animate-pulse"
:style="{ width: `${80 + Math.ceil(Math.random() * 20)}%` }" :class="{
'mb-4':
Math.random() > 0.8
}"></div>
</div>
</div>
</div>
</template>

149
components/blog/index.vue Normal file
View File

@@ -0,0 +1,149 @@
<script setup lang="ts">
import { withoutTrailingSlash } from 'ufo';
import MiniBlogCard from './MiniBlogCard.vue';
let copied = ref(false);
const copy = (text: string) => {
if (import.meta.client) {
navigator.clipboard.writeText(text)
copied.value = true;
setTimeout(() => {
copied.value = false;
}, 2000);
}
};
const activeTocId: Ref<string | null> = ref(null)
const nuxtContent = ref(null)
const updateActiveHeading = () => {
const headings = document.querySelectorAll('#main h2[id], #main h3[id]')
const windowHeight = window.innerHeight
const windowMidpoint = windowHeight / 2
headings.forEach((heading) => {
const headingRect = heading.getBoundingClientRect()
const headingBottom = headingRect.bottom
if (headingBottom <= windowMidpoint) {
activeTocId.value = heading.id
}
})
}
onMounted(() => {
window.addEventListener('scroll', updateActiveHeading)
})
onUnmounted(() => {
window.removeEventListener('scroll', updateActiveHeading)
})
let year = new Date().getFullYear();
let route = useRoute();
const { data: doc } = await useAsyncData(`${route.path}-data`, () => queryContent(route.path).findOne())
if (!doc.value) {
throw createError({ statusCode: 404, statusMessage: 'Article not found', fatal: true })
}
const { data: surround } = await useAsyncData(`${route.path}-surround`, () => queryContent('/blog')
.where({ _extension: 'md' })
.only(['title', 'description', '_path'])
.sort({ date: 1 })
.where({ _draft: false })
.findSurround(withoutTrailingSlash(route.path))
)
console.log("SURROUND", surround.value)
useSeoMeta({
title: doc.value?.title,
description: doc.value?.description,
ogTitle: doc.value?.title,
ogDescription: doc.value?.description,
ogImage: doc.value?.image.src,
ogUrl: 'https://juls07.dev',
twitterTitle: doc.value?.title,
twitterDescription: doc.value?.description,
twitterImage: doc.value?.image.src,
twitterCard: 'summary_large_image',
})
useHead({
htmlAttrs: {
lang: 'en'
},
meta: [
{
name: "copyright",
content: `© ${year} juls07`
},
{
name: "robots",
content: "index, follow"
},
{
name: "keywords",
content: doc.value?.tags.join(", ")
},
{
name: "author",
content: "juls07",
}
],
link: [
{
rel: 'icon',
type: 'image/png',
href: '/favicon.png'
}
]
})
</script>
<template>
<div class="!col-start-2 md:!col-start-3 lg:!col-start-4 lg:col-span-6 md:col-span-8 col-span-10 order-1">
<NuxtImg v-if="doc && doc.image" :src="doc.image.src" class="mb-2 rounded-md drop-shadow w-full" quality="80" />
<h1 class="text-3xl dark:text-gray-100 md:text-4xl font-semibold mb-2">{{ doc?.title }}</h1>
<p class="mb-1 dark:text-zinc-400 text-zinc-600">
{{ doc?.description }}
</p>
<p class="mb-2 text-zinc-500">
{{ new Date(doc?.date).toDateString().split(' ').slice(1).join(' ') }} |
{{ doc?.readTime }} minute read
</p>
<div class="flex flex-wrap w-full gap-2 justify-start mb-3">
<IconTag v-for="tag in doc?.tags" :name="tag" :iconName='tag' isTag="true" />
</div>
<hr class="mb-4 border-[#ECE6E7] dark:border-[#232326] border-t" />
</div>
<div class="!col-start-2 md:!col-start-3 lg:!col-start-4 lg:col-span-6 md:col-span-8 col-span-10 order-3">
<main id="main" class="leading-relaxed">
<ContentRenderer ref="nuxtContent" class="dark:text-gray-200 text-gray-800" :value="doc" />
</main>
</div>
<nav
class="lg:ml-2 mb-3 lg:mb-0 col-start-2 md:col-start-3 lg:block lg:col-start-10 lg:col-span-2 md:col-span-8 col-span-10 lg:sticky lg:top-8 h-fit order-2 lg:order-4">
<TableOfContents :doc="doc" :activeTocId="activeTocId" />
</nav>
<div class="!col-start-2 md:!col-start-3 lg:!col-start-4 lg:col-span-6 md:col-span-8 col-span-10 order-5">
<div class="flex justify-between mt-10">
<NuxtLink class="flex items-center text-fuschia hover:underline visited:bg-rose-700" to="/blog">
Back to Blog
</NuxtLink>
<button class="flex items-center px-2 py-1" @click="copy('https://juls07.dev' + route.path)">
<Icon v-if="copied" name="tabler:check" class="mr-1.5" size="20" />
<Icon v-else name="tabler:link" class="mr-1.5" size="20" />
Copy Link
</button>
</div>
<hr class="my-6 border-[#ECE6E7] dark:border-[#232326] border-t" />
<div v-if="surround && surround.length > 0" class="sm:grid gap-8 sm:grid-cols-2">
<MiniBlogCard v-if="surround[0]" :to="surround[0]._path" :title="surround[0].title"
:description="surround[0].description" />
<MiniBlogCard class="col-start-2" v-if="surround[1]" :to="surround[1]._path" :title="surround[1].title"
:right-align="true" :description="surround[1].description" />
</div>
</div>
</template>

View File

@@ -29,9 +29,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { useClipboard } from '@vueuse/core'; withDefaults(
const { copy, copied } = useClipboard();
const props = withDefaults(
defineProps<{ defineProps<{
code?: string; code?: string;
language?: string | null; language?: string | null;
@@ -42,6 +40,7 @@ const props = withDefaults(
); );
const codeElm = ref(); const codeElm = ref();
let copied = ref(false);
const copyCode = () => { const copyCode = () => {
if (!codeElm.value) { if (!codeElm.value) {
@@ -58,7 +57,13 @@ const copyCode = () => {
} }
} }
copy(str); if (import.meta.client) {
navigator.clipboard.writeText(str);
copied.value = true;
setTimeout(() => {
copied.value = false;
}, 2000);
}
}; };
</script> </script>

View File

@@ -3,7 +3,7 @@
<h2 :id="id" class="text-2xl"> <h2 :id="id" class="text-2xl">
<slot /> <slot />
</h2> </h2>
<button @click="copy(location.origin + location.pathname + '#' + id)" <button @click="copy('https://juls07.dev' + route.path + '#' + id)"
class="dark:text-white ml-2 group-hover:opacity-100 opacity-0 transition-all"> class="dark:text-white ml-2 group-hover:opacity-100 opacity-0 transition-all">
<div class="h-5" v-if="copied"> <div class="h-5" v-if="copied">
<Icon size="20" name="tabler:check" /> <Icon size="20" name="tabler:check" />
@@ -16,8 +16,6 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { useBrowserLocation, useClipboard } from '@vueuse/core';
const { copy, copied } = useClipboard();
withDefaults( withDefaults(
defineProps<{ defineProps<{
id?: string; id?: string;
@@ -25,7 +23,18 @@ withDefaults(
{ id: '' } { id: '' }
); );
const location = useBrowserLocation() let copied = ref(false);
const copy = (text: string) => {
if (import.meta.client) {
navigator.clipboard.writeText(text)
copied.value = true;
setTimeout(() => {
copied.value = false;
}, 2000);
}
};
const route = useRoute();
</script> </script>
<style scoped> <style scoped>

View File

@@ -3,7 +3,7 @@
<h3 :id="id" class="text-xl"> <h3 :id="id" class="text-xl">
<slot /> <slot />
</h3> </h3>
<button @click="copy(location.origin + location.pathname + '#' + id)" <button @click="copy('https://juls07.dev' + route.path + '#' + id)"
class="dark:text-white ml-2 group-hover:opacity-100 opacity-0 transition-all"> class="dark:text-white ml-2 group-hover:opacity-100 opacity-0 transition-all">
<div class="h-5" v-if="copied"> <div class="h-5" v-if="copied">
<Icon size="20" name="tabler:check" /> <Icon size="20" name="tabler:check" />
@@ -16,8 +16,6 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { useBrowserLocation, useClipboard } from '@vueuse/core';
const { copy, copied } = useClipboard();
withDefaults( withDefaults(
defineProps<{ defineProps<{
id?: string; id?: string;
@@ -25,7 +23,18 @@ withDefaults(
{ id: '' } { id: '' }
); );
const location = useBrowserLocation() let copied = ref(false);
const copy = (text: string) => {
if (import.meta.client) {
navigator.clipboard.writeText(text)
copied.value = true;
setTimeout(() => {
copied.value = false;
}, 2000);
}
};
const route = useRoute();
</script> </script>
<style scoped> <style scoped>

View File

@@ -1,10 +1,20 @@
import { defineNuxtConfig } from 'nuxt/config'; import { defineNuxtConfig } from 'nuxt/config';
// https://nuxt.com/docs/api/configuration/nuxt-config // https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({ export default defineNuxtConfig({
compatibilityDate: '2024-09-25',
ssr: true,
app: { app: {
head: { head: {
title: 'Juls07', title: 'Juls07',
script: [
{
vmid: 'themeScript',
hid: 'theme-script',
children: `if (localStorage.theme === 'dark' || (!('theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)) {document.documentElement.classList.add('dark')} else {document.documentElement.classList.remove('dark')}`,
type: 'text/javascript',
}
],
meta: [ meta: [
{ charset: 'utf-8' }, { charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' }, { name: 'viewport', content: 'width=device-width, initial-scale=1' },
@@ -21,10 +31,6 @@ export default defineNuxtConfig({
}, },
}, },
colorMode: {
classSuffix: ''
},
content: { content: {
highlight: { highlight: {
theme: { theme: {
@@ -39,24 +45,24 @@ export default defineNuxtConfig({
'@/assets/css/main.css', '@/assets/css/main.css',
], ],
devtools: { devtools: {
enabled: true enabled: true
}, },
experimental: { experimental: {
payloadExtraction: true payloadExtraction: false
}, },
image: { image: {
provider: 'ipx' provider: 'ipx'
}, },
modules: ['nuxt-icon', '@nuxt/content', '@nuxtjs/color-mode', '@nuxt/image'], modules: ['nuxt-icon', '@nuxt/content', '@nuxt/image'],
nitro: { nitro: {
plugins: ['plugins/read-time.ts'], plugins: ['plugins/read-time.ts'],
preset: 'static', preset: 'static',
minify: true,
prerender: { prerender: {
crawlLinks: true, crawlLinks: true,
routes: ['/sitemap.xml', '/rss.xml'] routes: ['/sitemap.xml', '/rss.xml']
@@ -77,4 +83,8 @@ export default defineNuxtConfig({
}, },
sourcemap: false, sourcemap: false,
webpack: {
optimizeCSS: true,
},
}) })

13951
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,30 +1,28 @@
{ {
"name": "nuxt-app", "name": "nuxt-app",
"private": true, "private": true,
"scripts": { "scripts": {
"build": "nuxt build", "build": "nuxt build",
"dev": "nuxt dev", "dev": "nuxt dev",
"generate": "nuxt generate", "generate": "nuxt generate",
"preview": "nuxt preview", "preview": "nuxt preview",
"postinstall": "nuxt prepare" "postinstall": "nuxt prepare"
}, },
"devDependencies": { "devDependencies": {
"@nuxt/devtools": "^1.1.5", "@nuxt/devtools": "^1.5.1",
"@nuxt/image": "^1.5.0", "@nuxt/image": "^1.8.0",
"@nuxtjs/color-mode": "^3.4.0", "@types/rss": "^0.0.32",
"@types/rss": "^0.0.32", "autoprefixer": "^10.4.20",
"autoprefixer": "^10.4.15", "nuxt": "^3.13.2",
"nuxt": "^3.7.0", "nuxt-icon": "^0.6.10",
"nuxt-icon": "^0.6.10", "postcss": "^8.4.47",
"postcss": "^8.4.29", "rss": "^1.2.2",
"rss": "^1.2.2", "sitemap": "^7.1.2",
"sitemap": "^7.1.1", "tailwindcss": "^3.4.13"
"tailwindcss": "^3.3.3" },
}, "dependencies": {
"dependencies": { "@nuxt/content": "^2.13.2",
"@nuxt/content": "^2.12.1", "sharp": "^0.33.5",
"@vueuse/core": "^10.9.0", "xml": "^1.0.1"
"sharp": "^0.33.3", }
"xml": "^1.0.1"
}
} }

View File

@@ -1,144 +1,47 @@
<script setup lang="ts">
import { withoutTrailingSlash } from 'ufo'
import { useBrowserLocation, useClipboard } from '@vueuse/core';
const { copy, copied } = useClipboard();
const location = useBrowserLocation()
let year = new Date().getFullYear();
let route = useRoute();
const { data: doc } = await useAsyncData(`${route.path}-data`, () => queryContent(route.path).findOne())
if (!doc.value) {
throw createError({ statusCode: 404, statusMessage: 'Article not found', fatal: true })
}
const { data: surround } = await useAsyncData(`${route.path}-surround`, () => queryContent('/blog')
.where({ _extension: 'md' })
.only(['title', 'description', '_path'])
.sort({ date: 1 })
.where({ _draft: false })
.findSurround(withoutTrailingSlash(route.path))
)
const activeTocId: Ref<string | null> = ref(null)
const nuxtContent = ref(null)
const updateActiveHeading = () => {
const headings = document.querySelectorAll('#main h2[id], #main h3[id]')
const windowHeight = window.innerHeight
const windowMidpoint = windowHeight / 2
headings.forEach((heading) => {
const headingRect = heading.getBoundingClientRect()
const headingBottom = headingRect.bottom
if (headingBottom <= windowMidpoint) {
activeTocId.value = heading.id
}
})
}
onMounted(() => {
window.addEventListener('scroll', updateActiveHeading)
})
onUnmounted(() => {
window.removeEventListener('scroll', updateActiveHeading)
})
useSeoMeta({
title: doc.value?.title,
description: doc.value?.description,
ogTitle: doc.value?.title,
ogDescription: doc.value?.description,
ogImage: doc.value?.image.src,
ogUrl: 'https://juls07.dev',
twitterTitle: doc.value?.title,
twitterDescription: doc.value?.description,
twitterImage: doc.value?.image.src,
twitterCard: 'summary_large_image',
})
useHead({
htmlAttrs: {
lang: 'en'
},
meta: [
{
name: "copyright",
content: `© ${year} juls07`
},
{
name: "robots",
content: "index, follow"
},
{
name: "keywords",
content: doc.value?.tags.join(", ")
},
{
name: "author",
content: "juls07",
}
],
link: [
{
rel: 'icon',
type: 'image/png',
href: '/favicon.png'
}
]
})
</script>
<template> <template>
<div class="min-h-screen"> <div class="min-h-screen">
<Nav /> <Nav />
<div class="grid grid-cols-12 gap-x-5 justify-center pt-6 mb-4 relative"> <div class="grid grid-cols-12 gap-x-5 justify-center pt-6 mb-4 relative">
<div class="!col-start-2 md:!col-start-3 lg:!col-start-4 lg:col-span-6 md:col-span-8 col-span-10 order-1"> <Suspense>
<NuxtImg v-if="doc.image" :src="doc.image.src" class="mb-2 rounded-md drop-shadow w-full" <Blog />
quality="80" /> <template #fallback>
<h1 class="text-3xl dark:text-gray-100 md:text-4xl font-semibold mb-2">{{ doc.title }}</h1> <div
<p class="mb-1 dark:text-zinc-400 text-zinc-600"> class="!col-start-2 md:!col-start-3 lg:!col-start-4 lg:col-span-6 md:col-span-8 col-span-10 order-1">
{{ doc.description }} <div
</p> class="mb-2 rounded-md drop-shadow w-full dark:bg-zinc-400 bg-zinc-600 animate-pulse aspect-video">
<p class="mb-2 text-zinc-500"> </div>
{{ new Date(doc.date).toDateString().split(' ').slice(1).join(' ') }} | <div class="h-9 mb-2 rounded-lg dark:bg-zinc-400 bg-zinc-600 animate-pulse"
{{ doc.readTime }} minute read :style="{ width: `${Math.max(Math.ceil(Math.random() * 100), 55)}%` }"></div>
</p> <div class="h-4 mb-2 rounded-lg dark:bg-zinc-400 bg-zinc-600 animate-pulse"
<div class="flex flex-wrap w-full gap-2 justify-start mb-3"> :style="{ width: `${Math.max(Math.ceil(Math.random() * 65), 15)}%` }"></div>
<IconTag v-for="tag in doc.tags" :name="tag" :iconName='tag' isTag="true" /> <div class="h-3 mb-2 rounded-lg bg-zinc-500 animate-pulse"
</div> :style="{ width: `${Math.max(Math.ceil(Math.random() * 50), 10)}%` }"></div>
<hr class="mb-4 border-[#ECE6E7] dark:border-[#232326] border-t" /> <div class="flex flex-wrap w-full gap-2 justify-start mb-3">
</div> <div v-for="i in Math.ceil(Math.random() * 4)"
<div class="!col-start-2 md:!col-start-3 lg:!col-start-4 lg:col-span-6 md:col-span-8 col-span-10 order-3"> class="font-inter md:text-lg w-fit max-h-9 min-w-fit dark:bg-obsidian-night bg-[hsl(270,68%,95.47%)] border border-soft-lilac dark:border-midnight-slate/30 py-1 px-2 rounded shadow flex items-center">
<main id="main" class="leading-relaxed"> <div class="mb-1 rounded bg-zinc-500 animate-pulse w-[20px] h-[20px] mr-2"></div>
<ContentRenderer ref="nuxtContent" class="dark:text-gray-200 text-gray-800" :value="doc" /> <div class="h-3 mb-1 rounded-lg bg-zinc-500 animate-pulse"
</main> :style="{ width: `${(i * 10) + 67}px` }">
</div> </div>
<nav </div>
class="lg:ml-2 mb-3 lg:mb-0 col-start-2 md:col-start-3 lg:block lg:col-start-10 lg:col-span-2 md:col-span-8 col-span-10 lg:sticky lg:top-8 h-fit order-2 lg:order-4"> </div>
<TableOfContents :doc="doc" :activeTocId="activeTocId" /> <hr class="mb-4 border-[#ECE6E7] dark:border-[#232326] border-t" />
</nav> <div
<div class="!col-start-2 md:!col-start-3 lg:!col-start-4 lg:col-span-6 md:col-span-8 col-span-10 order-5"> class="!col-start-2 md:!col-start-3 lg:!col-start-4 lg:col-span-6 md:col-span-8 col-span-10 order-3">
<div class="flex justify-between mt-10"> <main id="main" class="leading-relaxed">
<NuxtLink class="flex items-center text-fuschia hover:underline visited:bg-rose-700" to="/blog"> <div class="max-h-full leading-relaxed">
Back to Blog <div v-for="i in 100"
</NuxtLink> class="h-3 my-1 rounded-lg dark:bg-zinc-400 bg-zinc-600 animate-pulse"
<button class="flex items-center px-2 py-1" @click="copy(location.origin + location.pathname)"> :style="{ width: `${80 + Math.ceil(Math.random() * 20)}%` }" :class="{
<Icon v-if="copied" name="tabler:check" class="mr-1.5" size="20" /> 'mb-4':
<Icon v-else name="tabler:link" class="mr-1.5" size="20" /> Math.random() > 0.8
Copy Link }"></div>
</button> </div>
</div> </main>
<hr class="my-6 border-[#ECE6E7] dark:border-[#232326] border-t" /> </div>
<div v-if="surround" class="sm:grid gap-8 sm:grid-cols-2"> </div>
<MiniBlogCard v-if="surround[0]" :to="surround[0]._path" :title="surround[0].title" </template>
:description="surround[0].description" /> </Suspense>
<MiniBlogCard class="col-start-2" v-if="surround[1]" :to="surround[1]._path"
:title="surround[1].title" :right-align="true" :description="surround[1].description" />
</div>
</div>
</div> </div>
<footer class="grid grid-cols-12 gap-5 justify-center"> <footer class="grid grid-cols-12 gap-5 justify-center">
<div <div

View File

@@ -1,4 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import BlogSkeletonCard from '~/components/blog/BlogSkeletonCard.vue';
useHead({ useHead({
title: 'Juls07', title: 'Juls07',
}) })
@@ -9,45 +11,23 @@ useHead({
<Nav /> <Nav />
<main> <main>
<div id="main" class="gap-4 justify-evenly py-2 grid grid-cols-[repeat(auto-fit,_minmax(50px,_450px))]"> <div id="main" class="gap-4 justify-evenly py-2 grid grid-cols-[repeat(auto-fit,_minmax(50px,_450px))]">
<ContentQuery path="blog" <Suspense>
:only="['image', '_path', 'title', 'description', 'date', 'tags', 'excerpt', 'readTime']" :sort="{ <ContentQuery path="blog"
date: 1 :only="['image', '_path', 'title', 'description', 'date', 'tags', 'excerpt', 'readTime']" :sort="{
}" :where="{ date: 1
_draft: false }" :where="{
}" v-slot="{ data }"> _draft: false
<div v-for="article in data" :key="article._path" class="mb-5 px-1.5"> }" v-slot="{ data }">
<div <div v-for="article in data" :key="article._path" class="mb-5 px-1.5">
class="flex flex-col dark:bg-dark-slate bg-touched-lavender max-h-[563.25px] h-[563.25px] overflow-hidden rounded-lg border border-soft-lilac dark:border-midnight-slate/30 shadow-md"> <BlogCard :article="article" />
<NuxtImg v-if="article.image" :src="article.image.src" width="464" densities="1x 2x"
quality="80" class="w-full rounded-tl-lg rounded-tr-lg aspect-video" loading="lazy" />
<div
class="flex-shrink p-3 overflow-hidden pt-2 text-fade dark:before:bg-[linear-gradient(180deg,transparent_0,hsla(0,0%,5%,0)_36%,#0C0B0C_95%,#0C0B0C)] before:bg-[linear-gradient(180deg,transparent_0,hsla(0,0%,5%,0)_36%,#F5EDFE_95%,#F5EDFE)] mb-1 pb-1 relative">
<h3>
<nuxt-link tabindex="0" class="text-lg" :to="article._path">
{{ article.title }}
</nuxt-link>
</h3>
<p class="dark:text-zinc-400 text-zinc-600">
{{ article.description }}
</p>
<p class="text-zinc-500">
{{ new Date(article.date).toDateString().split(' ').slice(1).join(' ') }} |
{{ article.readTime }} minute read
</p>
<p class="dark:text-zinc-200 text-zinc-800 max-h-[13.75rem]">
<div class="flex flex-wrap w-full gap-2 justify-start my-1">
<IconTag v-for="tag in article.tags" :name="tag" :iconName='tag' isTag="true" />
</div>
<div class="max-h-full leading-relaxed">
<ContentRenderer :value="article">
<ContentRendererMarkdown :value="article" :excerpt="true" />
</ContentRenderer>
</div>
</p>
</div>
</div> </div>
</div> </ContentQuery>
</ContentQuery> <template #fallback>
<div v-for="i in 15">
<BlogSkeletonCard />
</div>
</template>
</Suspense>
</div> </div>
</main> </main>
</div> </div>

View File

@@ -1,5 +1,4 @@
<script setup lang="ts"> <script setup lang="ts">
let colorMode = useColorMode();
let today = new Date(); let today = new Date();
let age = today.getFullYear() - 2008; let age = today.getFullYear() - 2008;
@@ -151,21 +150,21 @@ let projects: Project[] = [
<h3 class="text-2xl md:text-3xl mb-1.5 ml-0.5">Skills</h3> <h3 class="text-2xl md:text-3xl mb-1.5 ml-0.5">Skills</h3>
<section class="flex flex-wrap w-full gap-2 justify-start ml-1"> <section class="flex flex-wrap w-full gap-2 justify-start ml-1">
<IconTag name="TypeScript" iconName="skill-icons:typescript" /> <IconTag name="TypeScript" iconName="skill-icons:typescript" />
<IconTag name="Nuxt.js" :iconName="'skill-icons:nuxtjs-' + $colorMode.value" /> <IconTag name="Nuxt.js" iconName="skill-icons:nuxtjs-dark" />
<IconTag name="Vue.js" :iconName="'skill-icons:vuejs-' + $colorMode.value" /> <IconTag name="Vue.js" iconName="skill-icons:vuejs-dark" />
<IconTag name="Ruby on rails" iconName="skill-icons:rails" /> <IconTag name="Ruby on rails" iconName="skill-icons:rails" />
<IconTag name="php" :iconName="'skill-icons:php-' + $colorMode.value" /> <IconTag name="php" iconName="skill-icons:php-dark" />
<IconTag name="React" :iconName="'skill-icons:react-' + $colorMode.value" /> <IconTag name="React" iconName="skill-icons:react-dark" />
<IconTag name="Bash" :iconName="'skill-icons:bash-' + $colorMode.value" /> <IconTag name="Bash" iconName="skill-icons:bash-dark" />
<IconTag name="Tailwindcss" :iconName="'skill-icons:tailwindcss-' + $colorMode.value" /> <IconTag name="Tailwindcss" iconName="skill-icons:tailwindcss-dark" />
<IconTag name="Rust" iconName="skill-icons:rust" /> <IconTag name="Rust" iconName="skill-icons:rust" />
<IconTag name="Node.js" :iconName="'skill-icons:nodejs-' + $colorMode.value" /> <IconTag name="Node.js" iconName="skill-icons:nodejs-dark" />
<IconTag name="Svelte" iconName="skill-icons:svelte" /> <IconTag name="Svelte" iconName="skill-icons:svelte" />
<IconTag name="Figma" :iconName="'skill-icons:figma-' + $colorMode.value" /> <IconTag name="Figma" iconName="skill-icons:figma-dark" />
<IconTag name="Electron" iconName="skill-icons:electron" /> <IconTag name="Electron" iconName="skill-icons:electron" />
<IconTag name="Cypress" :iconName="'skill-icons:cypress-' + $colorMode.value" /> <IconTag name="Cypress" iconName="skill-icons:cypress-light" />
<IconTag name="Prisma" iconName="skill-icons:prisma" /> <IconTag name="Prisma" iconName="skill-icons:prisma" />
<IconTag name="Docker" icon-name="skill-icons:docker" /> <IconTag name="Docker" iconName="skill-icons:docker" />
</section> </section>
</section> </section>
<div class="!col-start-2 md:!col-start-3 lg:!col-start-4 lg:col-span-6 md:col-span-8 col-span-10"> <div class="!col-start-2 md:!col-start-3 lg:!col-start-4 lg:col-span-6 md:col-span-8 col-span-10">