Fix before refacto player
repod / nextcloud (push) Successful in 1m12s Details
repod / nodejs (push) Successful in 1m47s Details

This commit is contained in:
Michel Roux 2023-08-24 23:19:54 +02:00
parent fb21092dff
commit e1e93771ff
5 changed files with 36 additions and 19 deletions

View File

@ -1,5 +1,5 @@
<template>
<router-link :to="toUrl(link)">
<router-link :to="toUrl">
<img :alt="`${title} - ${author}`"
:src="imageUrl"
:title="author">
@ -28,9 +28,9 @@ export default {
required: true,
},
},
methods: {
toUrl(url) {
return `/${btoa(url)}`
computed: {
toUrl() {
return `/${btoa(this.link)}`
},
},
}

View File

@ -17,7 +17,7 @@
{{ format(new Date(episode.episodeDuration*1000), 'H:mm:ss') }}
</template>
<template #actions>
<NcActionButton>
<NcActionButton @click="play(episode)">
<template #icon>
<Play :size="20" />
</template>
@ -73,6 +73,9 @@ export default {
methods: {
format,
formatTimeAgo,
play(episode) {
this.$store.commit('player/play', episode)
},
},
}
</script>

View File

@ -1,7 +1,12 @@
<template>
<div v-if="currentPlayingUrl" class="oui">
{{ 'oui' }}
</div>
<fragment>
<div v-if="episode" class="footer">
<img class="background" :src="episode.episodeImage">
<div class="content">
{{ 'oui' }}
</div>
</div>
</fragment>
</template>
<script>
@ -9,20 +14,29 @@ export default {
name: 'Bar',
components: {},
computed: {
currentPlayingUrl() {
return this.$store.state.currentPlayingUrl
episode() {
return this.$store.state.player.episode
},
},
}
</script>
<style scoped>
.oui {
.footer {
position: relative;
}
.background {
filter: blur(5rem) brightness(50%);
height: auto;
left: 0;
opacity: .4;
position: absolute;
bottom: 0;
top: 0;
width: 100%;
height: 4rem;
background-color: red;
z-index: 1001;
}
.content {
position: relative;
}
</style>

View File

@ -1,11 +1,11 @@
export const player = {
namespaced: true,
state: {
currentPlayingUrl: null,
episode: null,
},
mutations: {
set: (state, currentPlayingUrl) => {
state.currentPlayingUrl = currentPlayingUrl
play: (state, episode) => {
state.episode = episode
},
},
}

View File

@ -17,7 +17,7 @@
</ul>
</NcAppContentList>
</NcAppNavigation>
<router-view />
<router-view :key="$route.path" />
<Bar />
</fragment>
</template>