This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue';
|
||||
import FixedLayout from '~/components/layouts/FixedLayout.vue';
|
||||
import TableHeader from '~/components/parts/TableHeader.vue';
|
||||
import MinimalHeader from '~/components/parts/MinimalHeader.vue';
|
||||
|
||||
const { locale } = useI18n();
|
||||
const { locale, t } = useI18n();
|
||||
const localePath = useLocalePath();
|
||||
|
||||
const { data: posts } = useAsyncData('art-posts', async () => {
|
||||
@@ -40,17 +41,28 @@ const { data: posts } = useAsyncData('art-posts', async () => {
|
||||
}, { watch: [locale, () => useRoute().path] });
|
||||
|
||||
const isFallback = (art) => art.path.startsWith('/art/en/') && locale.value !== 'en';
|
||||
|
||||
const ART_LIMIT = 6;
|
||||
const showAll = ref(false);
|
||||
|
||||
const displayedArt = computed(() => {
|
||||
const allPosts = posts.value || [];
|
||||
if (showAll.value || allPosts.length <= ART_LIMIT) return allPosts;
|
||||
return allPosts.slice(0, ART_LIMIT);
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<TableHeader></TableHeader>
|
||||
<MinimalHeader></MinimalHeader>
|
||||
<FixedLayout>
|
||||
<Container>
|
||||
<h2 class="section-title">ART GALLERY</h2>
|
||||
<div class="grid">
|
||||
<NuxtLink v-for="art in posts"
|
||||
<NuxtLink v-for="art in displayedArt"
|
||||
:key="art.slug"
|
||||
class="selector"
|
||||
:to="isFallback(art) ? `/art/${art.slug}` : localePath(`/art/${art.slug}`)">
|
||||
<span class="selector-border-top" aria-hidden="true">────────</span>
|
||||
<NuxtImg
|
||||
:src="art.thumb"
|
||||
:alt="art.title"
|
||||
@@ -59,49 +71,167 @@ const isFallback = (art) => art.path.startsWith('/art/en/') && locale.value !==
|
||||
height="250"
|
||||
fit="cover"
|
||||
/>
|
||||
<div class="overlay-text">{{ art.title }}</div>
|
||||
<span class="selector-border-bottom" aria-hidden="true">────────</span>
|
||||
<div class="overlay-label">{{ art.title }}</div>
|
||||
</NuxtLink>
|
||||
</div>
|
||||
<p v-if="posts && posts.length > ART_LIMIT" class="show-more-toggle">
|
||||
<button type="button" class="tui-link" @click="showAll = !showAll">{{ showAll ? t('pages.show_less') : t('pages.show_more') }}</button>
|
||||
</p>
|
||||
</Container>
|
||||
</FixedLayout>
|
||||
<Footer></Footer>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.section-title {
|
||||
font-family: 'Hurmit', monospace;
|
||||
color: var(--color-text);
|
||||
font-size: 1.2rem;
|
||||
letter-spacing: 0.5px;
|
||||
margin: 28px 0 16px 0;
|
||||
padding-left: 12px;
|
||||
line-height: 1.3;
|
||||
|
||||
&::before {
|
||||
content: "├";
|
||||
color: var(--color-link);
|
||||
margin-right: 8px;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
&::after {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
background-color: var(--color-link);
|
||||
margin-left: 10px;
|
||||
vertical-align: middle;
|
||||
box-shadow: 0 0 4px var(--color-link);
|
||||
animation: blink-cursor 1s steps(1) infinite;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes blink-cursor {
|
||||
0%, 50% { opacity: 1; }
|
||||
51%, 100% { opacity: 0; }
|
||||
}
|
||||
|
||||
.grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, minmax(250px, 1fr));
|
||||
gap: 16px;
|
||||
padding: 40px 20px 40px 20px;
|
||||
padding: 24px 0;
|
||||
}
|
||||
|
||||
.selector {
|
||||
width: 100%;
|
||||
height: 250px;
|
||||
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);
|
||||
transition: all 0.1s steps(3, end);
|
||||
display: block;
|
||||
border: 2px solid var(--color-border-color);
|
||||
background-color: var(--color-background-fore);
|
||||
|
||||
&:hover {
|
||||
border-color: var(--color-link);
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 4px -4px 0px 0px var(--color-link);
|
||||
}
|
||||
|
||||
.selector-border-top,
|
||||
.selector-border-bottom {
|
||||
position: absolute;
|
||||
left: 30px;
|
||||
right: 30px;
|
||||
height: 0;
|
||||
color: var(--color-border-color);
|
||||
font-family: 'Hurmit', monospace;
|
||||
font-size: 0;
|
||||
line-height: 0;
|
||||
white-space: nowrap;
|
||||
z-index: 10;
|
||||
transition: color 0.1s steps(2, end);
|
||||
}
|
||||
|
||||
.selector-border-top {
|
||||
top: -2px;
|
||||
&::before { content: "═══════════════════"; }
|
||||
}
|
||||
|
||||
.selector-border-bottom {
|
||||
bottom: -2px;
|
||||
&::before { content: "═══════════════════"; }
|
||||
}
|
||||
}
|
||||
|
||||
.selector-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
display: block;
|
||||
}
|
||||
.overlay-text {
|
||||
|
||||
.overlay-label {
|
||||
position: absolute;
|
||||
bottom: 10px;
|
||||
left: 10px;
|
||||
color: white;
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
text-shadow: 0 2px 8px rgba(0,0,0,0.7);
|
||||
bottom: -2px;
|
||||
left: 30px;
|
||||
background-color: var(--color-link);
|
||||
color: var(--color-background-fore);
|
||||
padding: 2px 8px;
|
||||
font-family: 'Hurmit', monospace;
|
||||
font-size: 0.7rem;
|
||||
letter-spacing: 1px;
|
||||
text-transform: uppercase;
|
||||
box-shadow: inset 0 -2px 0px 0px rgba(0,0,0,0.3);
|
||||
pointer-events: none;
|
||||
}
|
||||
/* ...rest unchanged */
|
||||
</style>
|
||||
|
||||
.show-more-toggle {
|
||||
margin-top: 16px;
|
||||
padding-left: 14px;
|
||||
|
||||
button {
|
||||
background: none;
|
||||
border: none;
|
||||
color: var(--color-link);
|
||||
font-family: 'Hurmit', monospace;
|
||||
font-size: 0.85rem;
|
||||
cursor: pointer;
|
||||
text-shadow: 0 0 4px var(--color-link);
|
||||
padding: 0;
|
||||
|
||||
&:hover {
|
||||
text-shadow: 0 0 10px var(--color-link), 0 0 3px var(--color-link);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 900px) {
|
||||
.grid {
|
||||
grid-template-columns: repeat(2, minmax(200px, 1fr));
|
||||
}
|
||||
|
||||
.selector {
|
||||
height: 200px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 640px) {
|
||||
.section-title {
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.grid {
|
||||
grid-template-columns: repeat(1, minmax(200px, 1fr));
|
||||
padding: 16px 0;
|
||||
}
|
||||
|
||||
.selector {
|
||||
height: 180px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user