Replace icons with text links; add video and images modal on pieces page
This commit is contained in:
parent
69fab67601
commit
f0133650f6
|
|
@ -6,25 +6,33 @@
|
||||||
|
|
||||||
<div v-for="item in works" :key="item.year" class="mb-8">
|
<div v-for="item in works" :key="item.year" class="mb-8">
|
||||||
<p class="text-sm text-gray-500 mb-3">{{ item.year }}</p>
|
<p class="text-sm text-gray-500 mb-3">{{ item.year }}</p>
|
||||||
<div v-for="work in item.works" :key="work.title" class="mb-4">
|
<div v-for="work in item.works" :key="work.title" class="mb-4 ml-4">
|
||||||
<div class="flex items-start gap-2">
|
<div>
|
||||||
<NuxtLink
|
<NuxtLink
|
||||||
v-if="hasItems(work)"
|
v-if="hasItems(work)"
|
||||||
:to="'/works/' + slugify(work.title)"
|
:to="'/works/' + slugify(work.title)"
|
||||||
class="italic hover:underline"
|
class="text-lg italic hover:underline"
|
||||||
>
|
>
|
||||||
<span v-html="work.title"></span>
|
<span v-html="work.title"></span>
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
<span v-else class="italic">
|
<span v-else class="text-lg italic">
|
||||||
<span v-html="work.title"></span>
|
<span v-html="work.title"></span>
|
||||||
</span>
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="flex gap-1">
|
<div v-if="hasContent(work)" class="flex gap-4 text-sm text-gray-500 mt-0.5">
|
||||||
<IconButton v-if="work.score" type="score" :work="work" :link="work.score" :visible="true"></IconButton>
|
<button v-if="work.soundcloud_trackid" @click="audioPlayerStore.setSoundCloudTrackID(work.soundcloud_trackid)" class="hover:underline">
|
||||||
<IconButton v-if="work.soundcloud_trackid" type="audio" :work="work" :visible="true"></IconButton>
|
audio
|
||||||
<IconButton v-if="work.vimeo_trackid" type="video" :work="work" :visible="true"></IconButton>
|
</button>
|
||||||
<IconButton v-if="work.gallery" type="image" :work="work" :visible="true"></IconButton>
|
<button v-if="work.vimeo_trackid" @click="openVideoModal(work.vimeo_trackid)" class="hover:underline">
|
||||||
</div>
|
video
|
||||||
|
</button>
|
||||||
|
<button v-if="work.gallery" @click="openImageModal(work)" class="hover:underline">
|
||||||
|
images
|
||||||
|
</button>
|
||||||
|
<a v-if="work.score" :href="work.score" target="_blank" class="hover:underline">
|
||||||
|
score
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -55,8 +63,10 @@
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { useModalStore } from "@/stores/ModalStore"
|
import { useModalStore } from "@/stores/ModalStore"
|
||||||
|
import { useAudioPlayerStore } from "@/stores/AudioPlayerStore"
|
||||||
|
|
||||||
const modalStore = useModalStore()
|
const modalStore = useModalStore()
|
||||||
|
const audioPlayerStore = useAudioPlayerStore()
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
|
||||||
const slugify = (title) => {
|
const slugify = (title) => {
|
||||||
|
|
@ -70,6 +80,19 @@ const hasItems = (work) => {
|
||||||
return work.vimeo_trackid || (work.images && work.images.length) || work.score
|
return work.vimeo_trackid || (work.images && work.images.length) || work.score
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const hasContent = (work) => {
|
||||||
|
return work.soundcloud_trackid || work.vimeo_trackid || (work.images && work.images.length) || work.score
|
||||||
|
}
|
||||||
|
|
||||||
|
const openVideoModal = (vimeoId) => {
|
||||||
|
modalStore.setModalProps('video', 'aspect-video', true, '', '', vimeoId)
|
||||||
|
}
|
||||||
|
|
||||||
|
const openImageModal = (work) => {
|
||||||
|
const gallery = work.images.map(img => ({ image: img.filename }))
|
||||||
|
modalStore.setModalProps('image', 'aspect-auto', true, 'images', gallery, '')
|
||||||
|
}
|
||||||
|
|
||||||
const worksWithImages = computed(() => {
|
const worksWithImages = computed(() => {
|
||||||
if (!works.value) return []
|
if (!works.value) return []
|
||||||
const allWorks = works.value.flatMap(group => group.works)
|
const allWorks = works.value.flatMap(group => group.works)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue