mirror of
https://github.com/janishutz/MusicPlayerV2.git
synced 2025-11-25 13:04:23 +00:00
some more progress on fancy view
This commit is contained in:
@@ -66,6 +66,10 @@ app.get( '/indexDirs', ( req, res ) => {
|
|||||||
} catch ( err ) {
|
} catch ( err ) {
|
||||||
files[ req.query.dir + '/' + dat[ file ] ] = 'ERROR';
|
files[ req.query.dir + '/' + dat[ file ] ] = 'ERROR';
|
||||||
}
|
}
|
||||||
|
} else if ( dat[ file ].slice( dat[ file ].indexOf( '.' ), dat[ file ].length ) === '.csv' ) {
|
||||||
|
|
||||||
|
} else if ( dat[ file ].slice( dat[ file ].indexOf( '.' ), dat[ file ].length ) === '.json' ) {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
indexedData[ req.query.dir ] = files;
|
indexedData[ req.query.dir ] = files;
|
||||||
|
|||||||
@@ -1,13 +1,27 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="fancy-view">
|
<div class="fancy-view">
|
||||||
<span class="material-symbols-outlined image" v-if="!song.hasCoverArt">music_note</span>
|
<span class="material-symbols-outlined fancy-view-song-art" v-if="!song.hasCoverArt">music_note</span>
|
||||||
<img v-else :src="'http://localhost:8081/getSongCover?filename=' + song.filename" class="image">
|
<img v-else :src="'http://localhost:8081/getSongCover?filename=' + song.filename" class="fancy-view-song-art">
|
||||||
|
<button @click="exit()" id="exit-button"><span class="material-symbols-outlined" style="font-size: 4vh;">close</span></button>
|
||||||
|
<div class="controls"></div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
#exit-button {
|
||||||
|
position: fixed;
|
||||||
|
right: 1vw;
|
||||||
|
top: 1vw;
|
||||||
|
background-color: rgba( 0,0,0,0 );
|
||||||
|
border: none;
|
||||||
|
cursor: pointer;
|
||||||
|
color: var( --primary-color );
|
||||||
|
}
|
||||||
|
|
||||||
.fancy-view {
|
.fancy-view {
|
||||||
display: block;
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
z-index: 20;
|
z-index: 20;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
@@ -16,6 +30,12 @@
|
|||||||
left: 0;
|
left: 0;
|
||||||
background-color: var( --background-color );
|
background-color: var( --background-color );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.fancy-view-song-art {
|
||||||
|
height: 40vh;
|
||||||
|
width: auto;
|
||||||
|
margin-bottom: 5%;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -23,6 +43,9 @@
|
|||||||
methods: {
|
methods: {
|
||||||
control ( instruction ) {
|
control ( instruction ) {
|
||||||
|
|
||||||
|
},
|
||||||
|
exit() {
|
||||||
|
this.$emit( 'control', 'exitFancyView' );
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="media-pool">
|
<div class="media-pool" :style="isShowingFancyView ? 'overflow: hidden;' : ''">
|
||||||
<div v-if="hasLoadedSongs" style="width: 100%;" class="song-list-wrapper">
|
<div v-if="hasLoadedSongs" style="width: 100%;" class="song-list-wrapper">
|
||||||
<div v-for="song in songQueue" class="song-list" :class="[ isPlaying ? ( currentlyPlaying === song.filename ? 'playing': 'not-playing' ) : 'not-playing', !isPlaying && currentlyPlaying === song.filename ? 'active-song': undefined ]">
|
<div v-for="song in songQueue" class="song-list" :class="[ isPlaying ? ( currentlyPlaying === song.filename ? 'playing': 'not-playing' ) : 'not-playing', !isPlaying && currentlyPlaying === song.filename ? 'active-song': undefined ]">
|
||||||
<span class="material-symbols-outlined song-image" v-if="!loadCoverArtPreview || !song.hasCoverArt">music_note</span>
|
<span class="material-symbols-outlined song-image" v-if="!loadCoverArtPreview || !song.hasCoverArt">music_note</span>
|
||||||
@@ -128,7 +128,7 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
width: 80%;
|
width: 80%;
|
||||||
margin: 2px;
|
margin: 2px;
|
||||||
padding: 15px;
|
padding: 1vh;
|
||||||
border: 1px var( --border-color ) solid;
|
border: 1px var( --border-color ) solid;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -199,6 +199,7 @@
|
|||||||
isPlaying: false,
|
isPlaying: false,
|
||||||
songPos: 0,
|
songPos: 0,
|
||||||
repeat: false,
|
repeat: false,
|
||||||
|
isShowingFancyView: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -235,6 +236,8 @@
|
|||||||
this.repeat = true;
|
this.repeat = true;
|
||||||
} else if ( status.type === 'repeatOff' ) {
|
} else if ( status.type === 'repeatOff' ) {
|
||||||
this.repeat = false;
|
this.repeat = false;
|
||||||
|
} else if ( status.type === 'fancyView' ) {
|
||||||
|
this.isShowingFancyView = status.status;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
queueHandler ( command ) {
|
queueHandler ( command ) {
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
<h3>{{ playingSong.title ?? 'No song selected' }}</h3>
|
<h3>{{ playingSong.title ?? 'No song selected' }}</h3>
|
||||||
<p>{{ playingSong.artist }}</p>
|
<p>{{ playingSong.artist }}</p>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="image"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="playback-pos-info">
|
<div class="playback-pos-info">
|
||||||
<div style="margin-right: auto;">{{ playbackPosBeautified }}</div>
|
<div style="margin-right: auto;">{{ playbackPosBeautified }}</div>
|
||||||
@@ -33,14 +34,14 @@
|
|||||||
</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>
|
<FancyView v-if="isShowingFancyView" :song="playingSong" @control="instruction => { control( instruction ) }" :playing="isPlaying"></FancyView>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.song-info {
|
.song-info {
|
||||||
background-color: #8e9ced;
|
background-color: #8e9ced;
|
||||||
height: 80%;
|
height: 13vh;
|
||||||
width: 50%;
|
width: 50%;
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
@@ -48,11 +49,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.image {
|
.image {
|
||||||
width: 6vh;
|
width: 7vh;
|
||||||
height: 6vh;
|
height: 7vh;
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
object-position: center;
|
object-position: center;
|
||||||
font-size: 6vh;
|
font-size: 7vh;
|
||||||
margin-left: 1vh;
|
margin-left: 1vh;
|
||||||
margin-top: 1vh;
|
margin-top: 1vh;
|
||||||
}
|
}
|
||||||
@@ -107,8 +108,8 @@
|
|||||||
.playback-pos-info {
|
.playback-pos-info {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
width: 99%;
|
width: 98%;
|
||||||
margin-left: 0.5%;
|
margin-left: 1%;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 17px;
|
bottom: 17px;
|
||||||
}
|
}
|
||||||
@@ -239,6 +240,9 @@ export default {
|
|||||||
} else if ( action === 'repeatOff' ) {
|
} else if ( action === 'repeatOff' ) {
|
||||||
this.$emit( 'update', { 'type': 'repeatOff' } );
|
this.$emit( 'update', { 'type': 'repeatOff' } );
|
||||||
this.repeatMode = 'off';
|
this.repeatMode = 'off';
|
||||||
|
} else if ( action === 'exitFancyView' ) {
|
||||||
|
this.isShowingFancyView = false;
|
||||||
|
this.$emit( 'update', { 'type': 'fancyView', 'status': false } );
|
||||||
}
|
}
|
||||||
} else if ( action === 'songsLoaded' ) {
|
} else if ( action === 'songsLoaded' ) {
|
||||||
this.hasLoadedSongs = true;
|
this.hasLoadedSongs = true;
|
||||||
@@ -256,6 +260,9 @@ export default {
|
|||||||
} else if ( action === 'repeatOff' ) {
|
} else if ( action === 'repeatOff' ) {
|
||||||
this.$emit( 'update', { 'type': 'repeatOff' } );
|
this.$emit( 'update', { 'type': 'repeatOff' } );
|
||||||
this.repeatMode = 'off';
|
this.repeatMode = 'off';
|
||||||
|
} else if ( action === 'exitFancyView' ) {
|
||||||
|
this.isShowingFancyView = false;
|
||||||
|
this.$emit( 'update', { 'type': 'fancyView', 'status': false } );
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
setPos( pos ) {
|
setPos( pos ) {
|
||||||
@@ -263,6 +270,7 @@ export default {
|
|||||||
musicPlayer.currentTime = pos;
|
musicPlayer.currentTime = pos;
|
||||||
},
|
},
|
||||||
showFancyView() {
|
showFancyView() {
|
||||||
|
this.$emit( 'update', { 'type': 'fancyView', 'status': true } );
|
||||||
this.isShowingFancyView = true;
|
this.isShowingFancyView = true;
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
12
frontend/src/imageFetcher.js
Normal file
12
frontend/src/imageFetcher.js
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
/*
|
||||||
|
* MusicPlayerV2 - imageFetcher.js
|
||||||
|
*
|
||||||
|
* Created by Janis Hutz 10/23/2023, Licensed under the GPL V3 License
|
||||||
|
* https://janishutz.com, development@janishutz.com
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
module.exports.fetch = () => {
|
||||||
|
// TODO: Implement
|
||||||
|
}
|
||||||
@@ -47,7 +47,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.logo {
|
.logo {
|
||||||
height: 90%;
|
height: 13vh;
|
||||||
margin-left: 3%;
|
margin-left: 3%;
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user