added pinia for stores and buttons coming alive
parent
ad4c66fc6a
commit
0511ab89cd
@ -1,17 +1,29 @@
|
||||
<template>
|
||||
<div class="p-1">
|
||||
<button
|
||||
type="button"
|
||||
v-show="visible"
|
||||
class="inline-flex bg-black rounded-full text-xs p-1"
|
||||
>
|
||||
<Icon :name="icon" color="white" />
|
||||
<div v-show="visible" class="inline-flex bg-black rounded-full text-xs" >
|
||||
<NuxtLink v-if="type === 'document'" class="inline-flex p-1" :to="'/scores/' + work.score" target="_blank">
|
||||
<Icon name="ion:book-outline" color="white" />
|
||||
</NuxtLink>
|
||||
<button @click="audioPlayerStore.setSoundCloudTrackID(work.soundcloud_trackid)" v-else-if="type === 'audio'" class="inline-flex p-1">
|
||||
<Icon name="wpf:speaker" color="white" />
|
||||
</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>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { useAudioPlayerStore } from "@/stores/AudioPlayerStore"
|
||||
const audioPlayerStore = useAudioPlayerStore()
|
||||
</script>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: ['icon', 'work', 'visible']
|
||||
props: ['type', 'work', 'visible']
|
||||
}
|
||||
</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