This commit is contained in:
@@ -1,56 +1,32 @@
|
||||
<script setup lang="ts">
|
||||
import { routeLocationKey } from 'vue-router';
|
||||
import FixedLayout from '~/components/layouts/FixedLayout.vue';
|
||||
import TableHeader from '~/components/parts/TableHeader.vue';
|
||||
|
||||
const { locale } = useI18n();
|
||||
const localePath = useLocalePath()
|
||||
|
||||
const {data: posts} = useAsyncData('art-posts', async () =>
|
||||
await queryCollection(`art`).where('path', 'LIKE', `/art/${locale.value}/%`).order('date', 'DESC').all()
|
||||
, {watch: [locale, () => useRoute().path]});
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<TableHeader></TableHeader>
|
||||
|
||||
<FixedLayout>
|
||||
<Container>
|
||||
<div class="grid">
|
||||
<NuxtLink v-for="art in posts"
|
||||
:key="art.slug"
|
||||
class="selector"
|
||||
:style="`background-image: url('${art.thumb}');`"
|
||||
: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>
|
||||
</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>
|
||||
</Container>
|
||||
</FixedLayout>
|
||||
@@ -67,19 +43,22 @@ await queryCollection(`art`).where('path', 'LIKE', `/art/${locale.value}/%`).ord
|
||||
.selector {
|
||||
width: 100%;
|
||||
height: 250px;
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
border-radius: 12px;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
transition: transform 0.2s ease;
|
||||
display: block; /* ensures NuxtLink behaves as a block */
|
||||
}
|
||||
|
||||
.selector:hover {
|
||||
transform: scale(1.03);
|
||||
}
|
||||
|
||||
.selector-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
display: block;
|
||||
}
|
||||
.overlay-text {
|
||||
position: absolute;
|
||||
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);
|
||||
pointer-events: none;
|
||||
}
|
||||
h2 {
|
||||
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;
|
||||
}
|
||||
}
|
||||
/* ...rest unchanged */
|
||||
</style>
|
||||
Reference in New Issue
Block a user