start adding fancyView

This commit is contained in:
janis
2023-10-23 16:37:12 +02:00
parent ddd9b789e8
commit 7f5a2d7eef
2 changed files with 42 additions and 1 deletions

View File

@@ -0,0 +1,34 @@
<template>
<div class="fancy-view">
<span class="material-symbols-outlined image" v-if="!song.hasCoverArt">music_note</span>
<img v-else :src="'http://localhost:8081/getSongCover?filename=' + song.filename" class="image">
</div>
</template>
<style scoped>
.fancy-view {
display: block;
position: fixed;
z-index: 20;
height: 100vh;
width: 100vw;
top: 0;
left: 0;
background-color: var( --background-color );
}
</style>
<script>
export default {
methods: {
control ( instruction ) {
}
},
props: {
song: {
type: Object,
}
}
}
</script>

View File

@@ -17,7 +17,7 @@
<div class="song-info"> <div class="song-info">
<audio v-if="audioLoaded" :src="'http://localhost:8081/getSongFile?filename=' + playingSong.filename" id="music-player"></audio> <audio v-if="audioLoaded" :src="'http://localhost:8081/getSongFile?filename=' + playingSong.filename" id="music-player"></audio>
<div class="song-info-wrapper"> <div class="song-info-wrapper">
<div v-if="audioLoaded"> <div v-if="audioLoaded" @click="showFancyView()" style="cursor: pointer;">
<span class="material-symbols-outlined image" v-if="!playingSong.hasCoverArt">music_note</span> <span class="material-symbols-outlined image" v-if="!playingSong.hasCoverArt">music_note</span>
<img v-else :src="'http://localhost:8081/getSongCover?filename=' + playingSong.filename" class="image"> <img v-else :src="'http://localhost:8081/getSongCover?filename=' + playingSong.filename" class="image">
</div> </div>
@@ -33,6 +33,7 @@
</div> </div>
<sliderView :active="audioLoaded" :position="playbackPos" :duration="playingSong.duration" @pos="( p ) => { setPos( p ) }"></sliderView> <sliderView :active="audioLoaded" :position="playbackPos" :duration="playingSong.duration" @pos="( p ) => { setPos( p ) }"></sliderView>
</div> </div>
<FancyView v-if="isShowingFancyView" :song="playingSong"></FancyView>
</div> </div>
</template> </template>
@@ -114,6 +115,7 @@
</style> </style>
<script> <script>
import FancyView from './fancyView.vue';
import SliderView from './sliderView.vue'; import SliderView from './sliderView.vue';
export default { export default {
@@ -129,10 +131,12 @@ export default {
playbackPosBeautified: '00:00', playbackPosBeautified: '00:00',
durationBeautified: '--:--', durationBeautified: '--:--',
hasLoadedSongs: false, hasLoadedSongs: false,
isShowingFancyView: false,
} }
}, },
components: { components: {
SliderView, SliderView,
FancyView,
}, },
methods: { methods: {
play( song, autoplay, doCrossFade = false ) { play( song, autoplay, doCrossFade = false ) {
@@ -258,6 +262,9 @@ export default {
let musicPlayer = document.getElementById( 'music-player' ); let musicPlayer = document.getElementById( 'music-player' );
musicPlayer.currentTime = pos; musicPlayer.currentTime = pos;
}, },
showFancyView() {
this.isShowingFancyView = true;
},
} }
} }
</script> </script>