This commit is contained in:
@@ -15,7 +15,24 @@ const displayedText = ref("");
|
|||||||
let index = 0
|
let index = 0
|
||||||
let interval = null
|
let interval = null
|
||||||
|
|
||||||
|
const dragon_names = ["katlum", "solus"];
|
||||||
|
const sprite_names = dragon_names.map(name => `/sprites/${name}/${name}.gif`);
|
||||||
|
|
||||||
|
const preloadImages = (imageArray) => {
|
||||||
|
return Promise.all(
|
||||||
|
imageArray.map(src => {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
const img = new Image()
|
||||||
|
img.src = src
|
||||||
|
img.onload = resolve
|
||||||
|
img.onerror = reject
|
||||||
|
})
|
||||||
|
})
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
preloadImages(sprite_names);
|
||||||
if (hasAnimated.value) {
|
if (hasAnimated.value) {
|
||||||
displayedText.value = fullText
|
displayedText.value = fullText
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -1,56 +1,32 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { routeLocationKey } from 'vue-router';
|
|
||||||
import FixedLayout from '~/components/layouts/FixedLayout.vue';
|
import FixedLayout from '~/components/layouts/FixedLayout.vue';
|
||||||
import TableHeader from '~/components/parts/TableHeader.vue';
|
import TableHeader from '~/components/parts/TableHeader.vue';
|
||||||
|
|
||||||
const { locale } = useI18n();
|
const { locale } = useI18n();
|
||||||
const localePath = useLocalePath()
|
const localePath = useLocalePath()
|
||||||
|
|
||||||
const {data: posts} = useAsyncData('art-posts', async () =>
|
const {data: posts} = useAsyncData('art-posts', async () =>
|
||||||
await queryCollection(`art`).where('path', 'LIKE', `/art/${locale.value}/%`).order('date', 'DESC').all()
|
await queryCollection(`art`).where('path', 'LIKE', `/art/${locale.value}/%`).order('date', 'DESC').all()
|
||||||
, {watch: [locale, () => useRoute().path]});
|
, {watch: [locale, () => useRoute().path]});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<TableHeader></TableHeader>
|
<TableHeader></TableHeader>
|
||||||
|
|
||||||
<FixedLayout>
|
<FixedLayout>
|
||||||
<Container>
|
<Container>
|
||||||
<div class="grid">
|
<div class="grid">
|
||||||
<NuxtLink v-for="art in posts"
|
<NuxtLink v-for="art in posts"
|
||||||
:key="art.slug"
|
:key="art.slug"
|
||||||
class="selector"
|
class="selector"
|
||||||
:style="`background-image: url('${art.thumb}');`"
|
|
||||||
:to="localePath(`/art/${art.slug}`)">
|
:to="localePath(`/art/${art.slug}`)">
|
||||||
|
<NuxtImg
|
||||||
|
:src="art.thumb"
|
||||||
|
:alt="art.title"
|
||||||
|
class="selector-img"
|
||||||
|
width="600"
|
||||||
|
height="250"
|
||||||
|
fit="cover"
|
||||||
|
/>
|
||||||
<div class="overlay-text">{{ art.title }}</div>
|
<div class="overlay-text">{{ art.title }}</div>
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
|
|
||||||
<!--
|
|
||||||
<div class="selector" style="background-image: url('/art/nozt/nozt-full-low.png');">
|
|
||||||
<div class="overlay-text">Test</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="selector" style="background-image: url('/art/knocking/knocking-low.png');">
|
|
||||||
<div class="overlay-text">Test</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="selector" style="background-image: url('/art/valentin/valentin.png');">
|
|
||||||
<div class="overlay-text">Test</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="selector" style="background-image: url('/art/miirym/miirym.png');">
|
|
||||||
<div class="overlay-text">Test</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="selector" style="background-image: url('/art/silang-3d/silang-3d.png');">
|
|
||||||
<div class="overlay-text">Test</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="selector" style="background-image: url('/art/yharon/yharon.png'); background-position-y: 0px;">
|
|
||||||
<div class="overlay-text">Test</div>
|
|
||||||
</div>
|
|
||||||
-->
|
|
||||||
</div>
|
</div>
|
||||||
</Container>
|
</Container>
|
||||||
</FixedLayout>
|
</FixedLayout>
|
||||||
@@ -67,19 +43,22 @@ await queryCollection(`art`).where('path', 'LIKE', `/art/${locale.value}/%`).ord
|
|||||||
.selector {
|
.selector {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 250px;
|
height: 250px;
|
||||||
background-size: cover;
|
|
||||||
background-position: center;
|
|
||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
position: relative;
|
position: relative;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: transform 0.2s ease;
|
transition: transform 0.2s ease;
|
||||||
|
display: block; /* ensures NuxtLink behaves as a block */
|
||||||
}
|
}
|
||||||
|
|
||||||
.selector:hover {
|
.selector:hover {
|
||||||
transform: scale(1.03);
|
transform: scale(1.03);
|
||||||
}
|
}
|
||||||
|
.selector-img {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
object-fit: cover;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
.overlay-text {
|
.overlay-text {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 10px;
|
bottom: 10px;
|
||||||
@@ -90,28 +69,5 @@ await queryCollection(`art`).where('path', 'LIKE', `/art/${locale.value}/%`).ord
|
|||||||
text-shadow: 0 2px 8px rgba(0,0,0,0.7);
|
text-shadow: 0 2px 8px rgba(0,0,0,0.7);
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
h2 {
|
/* ...rest unchanged */
|
||||||
margin-left: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
p {
|
|
||||||
margin-left: 30px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.two-columns {
|
|
||||||
display: flex;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 900px) {
|
|
||||||
.grid {
|
|
||||||
grid-template-columns: repeat(2, minmax(250px, 1fr));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 500px) {
|
|
||||||
.grid {
|
|
||||||
grid-template-columns: 1fr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
@@ -27,5 +27,5 @@ export default defineNuxtConfig({
|
|||||||
vueI18n: './i18n.config.ts',
|
vueI18n: './i18n.config.ts',
|
||||||
langDir: 'locales/'
|
langDir: 'locales/'
|
||||||
},
|
},
|
||||||
modules: ['@nuxtjs/i18n', '@nuxt/content']
|
modules: ['@nuxtjs/i18n', '@nuxt/content', '@nuxt/image']
|
||||||
})
|
})
|
||||||
1117
frontend/package-lock.json
generated
1117
frontend/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -11,6 +11,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nuxt/content": "^3.12.0",
|
"@nuxt/content": "^3.12.0",
|
||||||
|
"@nuxt/image": "^2.0.0",
|
||||||
"@nuxtjs/i18n": "10.2.3",
|
"@nuxtjs/i18n": "10.2.3",
|
||||||
"better-sqlite3": "^12.8.0",
|
"better-sqlite3": "^12.8.0",
|
||||||
"nuxt": "^4.3.1",
|
"nuxt": "^4.3.1",
|
||||||
|
|||||||
Reference in New Issue
Block a user