added pinia for stores and buttons coming alive
parent
ad4c66fc6a
commit
0511ab89cd
@ -1,17 +1,29 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="p-1">
|
<div class="p-1">
|
||||||
<button
|
<div v-show="visible" class="inline-flex bg-black rounded-full text-xs" >
|
||||||
type="button"
|
<NuxtLink v-if="type === 'document'" class="inline-flex p-1" :to="'/scores/' + work.score" target="_blank">
|
||||||
v-show="visible"
|
<Icon name="ion:book-outline" color="white" />
|
||||||
class="inline-flex bg-black rounded-full text-xs p-1"
|
</NuxtLink>
|
||||||
>
|
<button @click="audioPlayerStore.setSoundCloudTrackID(work.soundcloud_trackid)" v-else-if="type === 'audio'" class="inline-flex p-1">
|
||||||
<Icon :name="icon" color="white" />
|
<Icon name="wpf:speaker" color="white" />
|
||||||
</button>
|
</button>
|
||||||
|
<button v-else-if="type === 'video'" class="inline-flex p-1">
|
||||||
|
<Icon name="fluent:video-48-filled" color="white" />
|
||||||
|
</button>
|
||||||
|
<button v-else="type === 'image'" class="inline-flex p-1">
|
||||||
|
<Icon name="mdi:camera" color="white" />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { useAudioPlayerStore } from "@/stores/AudioPlayerStore"
|
||||||
|
const audioPlayerStore = useAudioPlayerStore()
|
||||||
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
props: ['icon', 'work', 'visible']
|
props: ['type', 'work', 'visible']
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
@ -0,0 +1,20 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<embed :src="'https://unboundedpress.org/api/scores.files/' + metadata._id.$oid + '/binary'" width="100%" height="900px" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
|
||||||
|
const route = useRoute()
|
||||||
|
|
||||||
|
const { data: metadata } = await useFetch('https://unboundedpress.org/api/scores.files?filter={"filename":"' + route.params.filename + '"}', {
|
||||||
|
//lazy: true,
|
||||||
|
//server: false,
|
||||||
|
transform: (metadata) => {
|
||||||
|
console.log(metadata)
|
||||||
|
return metadata[0]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
</script>
|
@ -0,0 +1,10 @@
|
|||||||
|
import {defineStore} from "pinia";
|
||||||
|
|
||||||
|
export const useAudioPlayerStore = defineStore("AudioPlayerStore", {
|
||||||
|
state: () => ({"soundcloud_trackid": "1032587794"}),
|
||||||
|
actions: {
|
||||||
|
setSoundCloudTrackID(trackid) {
|
||||||
|
this.soundcloud_trackid = trackid
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
Loading…
Reference in New Issue