Add mobile-friendly
PDF handling- Score icon on mobile: direct link to PDF triggers download - Works page: hide score iframe on mobile, Score link downloads PDF - Desktop behavior unchanged
This commit is contained in:
parent
8f73a3388e
commit
d5fc1eed21
|
|
@ -2,7 +2,10 @@
|
||||||
<div class="inline-flex p-1 min-w-[25px]">
|
<div class="inline-flex p-1 min-w-[25px]">
|
||||||
<div v-show="visible" class="bg-black rounded-full text-xs inline-flex" >
|
<div v-show="visible" class="bg-black rounded-full text-xs inline-flex" >
|
||||||
|
|
||||||
<button v-if="type === 'score'" @click="openWithHash('score')" class="inline-flex p-1">
|
<a v-if="type === 'score' && isMobile" :href="scoreLink" class="inline-flex p-1">
|
||||||
|
<Icon name="ion:book-sharp" style="color: white" />
|
||||||
|
</a>
|
||||||
|
<button v-else-if="type === 'score'" @click="openWithHash('score')" class="inline-flex p-1">
|
||||||
<Icon name="ion:book-sharp" style="color: white" />
|
<Icon name="ion:book-sharp" style="color: white" />
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
|
@ -55,6 +58,19 @@
|
||||||
|
|
||||||
const workSlug = computed(() => slugify(props.work?.title))
|
const workSlug = computed(() => slugify(props.work?.title))
|
||||||
|
|
||||||
|
const isMobile = computed(() => {
|
||||||
|
if (typeof window === 'undefined') return false
|
||||||
|
return window.innerWidth < 768
|
||||||
|
})
|
||||||
|
|
||||||
|
const scoreLink = computed(() => {
|
||||||
|
if (!props.work?.score) return null
|
||||||
|
if (props.work.score.startsWith('/scores/')) {
|
||||||
|
return props.work.score
|
||||||
|
}
|
||||||
|
return '/scores/' + props.work.score
|
||||||
|
})
|
||||||
|
|
||||||
const isExternalLink = computed(() => {
|
const isExternalLink = computed(() => {
|
||||||
return props.link && !props.link.endsWith('.pdf') && !props.link.startsWith('/')
|
return props.link && !props.link.endsWith('.pdf') && !props.link.startsWith('/')
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
<nav v-if="itemCount >= 2" class="flex gap-4 mb-6">
|
<nav v-if="itemCount >= 2" class="flex gap-4 mb-6">
|
||||||
<a v-if="work.vimeo_trackid" href="#video" class="hover:underline">Video</a>
|
<a v-if="work.vimeo_trackid" href="#video" class="hover:underline">Video</a>
|
||||||
<a v-if="gallery && gallery.length" href="#images" class="hover:underline">Images</a>
|
<a v-if="gallery && gallery.length" href="#images" class="hover:underline">Images</a>
|
||||||
<a v-if="scoreUrl" href="#score" class="hover:underline">Score</a>
|
<a v-if="scoreUrl" :href="isMobile ? scoreUrl : '#score'" class="hover:underline">Score</a>
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
<ImageSlider :bucket="'images'" :gallery="gallery"></ImageSlider>
|
<ImageSlider :bucket="'images'" :gallery="gallery"></ImageSlider>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="score" v-if="scoreUrl" class="mb-8 scroll-mt-[280px]">
|
<div id="score" v-if="scoreUrl && !isMobile" class="mb-8 scroll-mt-[280px]">
|
||||||
<iframe :src="scoreUrl + '#toolbar=1&navpanes=0&sidebar=0'" class="w-full h-[85vh] border"></iframe>
|
<iframe :src="scoreUrl + '#toolbar=1&navpanes=0&sidebar=0'" class="w-full h-[85vh] border"></iframe>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -77,6 +77,11 @@ const itemCount = computed(() => {
|
||||||
return count
|
return count
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const isMobile = computed(() => {
|
||||||
|
if (typeof window === 'undefined') return false
|
||||||
|
return window.innerWidth < 768
|
||||||
|
})
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (work.value?.soundcloud_trackid) {
|
if (work.value?.soundcloud_trackid) {
|
||||||
audioPlayerStore.setSoundCloudTrackID(work.value.soundcloud_trackid)
|
audioPlayerStore.setSoundCloudTrackID(work.value.soundcloud_trackid)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue