mirror of
https://github.com/tcsenpai/swingmusic.git
synced 2025-07-03 08:10:12 +00:00
add transition to queue track list
This commit is contained in:
parent
59905f7afe
commit
a32d8fe66c
@ -1,7 +1,6 @@
|
|||||||
|
|
||||||
.now-playing-track-indicator {
|
.now-playing-track-indicator {
|
||||||
background-image: url(../../assets/icons/playing.gif);
|
background-image: url(../../assets/icons/playing.gif);
|
||||||
transition: all 0.3s ease-in-out;
|
|
||||||
height: 2rem;
|
height: 2rem;
|
||||||
width: 2rem;
|
width: 2rem;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
|
@ -1,4 +1,8 @@
|
|||||||
// paddings
|
// paddings
|
||||||
|
.pad-smaller {
|
||||||
|
padding: $smaller;
|
||||||
|
}
|
||||||
|
|
||||||
.pad-small {
|
.pad-small {
|
||||||
padding: $small;
|
padding: $small;
|
||||||
}
|
}
|
||||||
|
@ -92,22 +92,26 @@ function updateQueue(track: Track) {
|
|||||||
|
|
||||||
switch (routename) {
|
switch (routename) {
|
||||||
case "FolderView":
|
case "FolderView":
|
||||||
queue.playFromFolder(props.path, props.tracks);
|
queue.playFromFolder(props.path || "", props.tracks);
|
||||||
queue.play(index);
|
queue.play(index);
|
||||||
break;
|
break;
|
||||||
case "AlbumView":
|
case "AlbumView":
|
||||||
const tindex = album.tracks.findIndex((t) => t.trackid === track.trackid);
|
const tindex = album.tracks.findIndex((t) => t.trackid === track.trackid);
|
||||||
|
|
||||||
queue.playFromAlbum(
|
queue.playFromAlbum(
|
||||||
track.album,
|
track.album || "",
|
||||||
track.albumartist,
|
track.albumartist || "",
|
||||||
track.albumhash,
|
track.albumhash || "",
|
||||||
album.tracks
|
album.tracks
|
||||||
);
|
);
|
||||||
queue.play(tindex);
|
queue.play(tindex);
|
||||||
break;
|
break;
|
||||||
case "PlaylistView":
|
case "PlaylistView":
|
||||||
queue.playFromPlaylist(props.pname, props.playlistid, props.tracks);
|
queue.playFromPlaylist(
|
||||||
|
props.pname || "",
|
||||||
|
props.playlistid || "",
|
||||||
|
props.tracks
|
||||||
|
);
|
||||||
queue.play(index);
|
queue.play(index);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -4,8 +4,9 @@
|
|||||||
<UpNext :next="queue.tracklist[queue.next]" :playNext="queue.playNext" />
|
<UpNext :next="queue.tracklist[queue.next]" :playNext="queue.playNext" />
|
||||||
<div class="scrollable-r bg-black rounded">
|
<div class="scrollable-r bg-black rounded">
|
||||||
<QueueActions />
|
<QueueActions />
|
||||||
<div
|
<div class="inner">
|
||||||
class="inner"
|
<TransitionGroup
|
||||||
|
name="queuelist"
|
||||||
@mouseenter="setMouseOver(true)"
|
@mouseenter="setMouseOver(true)"
|
||||||
@mouseleave="setMouseOver(false)"
|
@mouseleave="setMouseOver(false)"
|
||||||
>
|
>
|
||||||
@ -17,6 +18,7 @@
|
|||||||
:isCurrent="index === queue.current"
|
:isCurrent="index === queue.current"
|
||||||
:isPlaying="queue.playing"
|
:isPlaying="queue.playing"
|
||||||
/>
|
/>
|
||||||
|
</TransitionGroup>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<PlayingFrom :from="queue.from" />
|
<PlayingFrom :from="queue.from" />
|
||||||
@ -45,11 +47,30 @@ function setMouseOver(val: boolean) {
|
|||||||
onUpdated(() => {
|
onUpdated(() => {
|
||||||
if (mouseover.value) return;
|
if (mouseover.value) return;
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
focusElem("currentInQueue");
|
focusElem("currentInQueue");
|
||||||
|
}, 1000);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
.queuelist-move, /* apply transition to moving elements */
|
||||||
|
.queuelist-enter-active {
|
||||||
|
transition: all 0.5s ease-in-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
.queuelist-enter-from,
|
||||||
|
.queuelist-leave-to {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ensure leaving items are taken out of layout flow so that moving
|
||||||
|
animations can be calculated correctly. */
|
||||||
|
.queuelist-leave-active {
|
||||||
|
transition: none;
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
|
||||||
.up-next {
|
.up-next {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
@ -114,7 +114,7 @@ const showContextMenu = (e: Event) => {
|
|||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
track: Track;
|
track: Track;
|
||||||
index: Number;
|
index?: number;
|
||||||
isPlaying: Boolean;
|
isPlaying: Boolean;
|
||||||
isCurrent: Boolean;
|
isCurrent: Boolean;
|
||||||
isHighlighted: Boolean;
|
isHighlighted: Boolean;
|
||||||
|
@ -10,12 +10,8 @@
|
|||||||
]"
|
]"
|
||||||
@contextmenu="showContextMenu"
|
@contextmenu="showContextMenu"
|
||||||
>
|
>
|
||||||
<div
|
<div class="album-art">
|
||||||
class="album-art image rounded"
|
<img :src="paths.images.thumb + track.image" alt="" class="rounded" />
|
||||||
:style="{
|
|
||||||
backgroundImage: `url("${imguri + props.track.image}")`,
|
|
||||||
}"
|
|
||||||
>
|
|
||||||
<div
|
<div
|
||||||
class="now-playing-track-indicator image"
|
class="now-playing-track-indicator image"
|
||||||
v-if="props.isCurrent"
|
v-if="props.isCurrent"
|
||||||
@ -120,10 +116,17 @@ const playThis = (track: Track) => {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
||||||
|
margin-right: $small;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
.now-playing-track-indicator {
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
img {
|
||||||
width: 3rem;
|
width: 3rem;
|
||||||
height: 3rem;
|
height: 3rem;
|
||||||
margin: 0 0.5rem 0 0;
|
|
||||||
background-image: url(../../assets/images/null.webp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
|
@ -192,7 +192,7 @@ export default defineStore("Queue", {
|
|||||||
this.from = <fromFolder>{
|
this.from = <fromFolder>{
|
||||||
type: FromOptions.folder,
|
type: FromOptions.folder,
|
||||||
path: fpath,
|
path: fpath,
|
||||||
name: fpath.split("/").splice(-1).join(""),
|
name: fpath?.split("/").splice(-1).join(""),
|
||||||
};
|
};
|
||||||
this.setNewQueue(tracks);
|
this.setNewQueue(tracks);
|
||||||
},
|
},
|
||||||
|
@ -3,8 +3,11 @@
|
|||||||
* @param seconds The seconds to convert
|
* @param seconds The seconds to convert
|
||||||
* @param long Whether to provide the time in the long format
|
* @param long Whether to provide the time in the long format
|
||||||
*/
|
*/
|
||||||
export default function formatSeconds(seconds: number, long?: boolean) {
|
export default function formatSeconds(
|
||||||
if (seconds == undefined) {
|
seconds: number | undefined,
|
||||||
|
long?: boolean
|
||||||
|
) {
|
||||||
|
if (seconds === undefined) {
|
||||||
return "00:00";
|
return "00:00";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user