add bottom padding to v-scroll-page class instead of individual pages

+ Rewrite queue page with  @Akryum/vue-virtual-scroller
This commit is contained in:
geoffrey45
2022-10-08 16:24:52 +03:00
committed by Mungai Njoroge
parent 858e59f81c
commit ed7f26c12b
8 changed files with 68 additions and 105 deletions
-57
View File
@@ -1,57 +0,0 @@
<template>
<div class="album-tracks rounded">
<div v-for="(disc, key) in discs" class="album-disc">
<SongList
:key="key"
:tracks="disc"
:on_album_page="true"
:disc="key"
:copyright="isLastDisc(key) ? copyright : null"
@playFromPage="playFromAlbumPage"
/>
</div>
</div>
</template>
<script setup lang="ts">
// @stores
import useQueueStore from "@/stores/queue";
import useAlbumStore from "@/stores/pages/album";
// @utils
import { Track } from "@/interfaces";
// @components
import SongList from "@/components/FolderView/SongList.vue";
// @setup
const props = defineProps<{
discs: {
[key: string]: Track[];
};
copyright?: string;
}>();
const queue = useQueueStore();
const album = useAlbumStore();
// check if the disc is the last disc
const isLastDisc = (disc: string | number) => {
const discs = Object.keys(props.discs);
return discs[discs.length - 1] === disc;
};
function playFromAlbumPage(index: number) {
const { title, artist, hash } = album.info;
queue.playFromAlbum(title, artist, hash, album.allTracks);
queue.play(index);
}
</script>
<style lang="scss">
.album-tracks {
display: grid;
gap: 1rem;
}
</style>
+3 -7
View File
@@ -21,9 +21,9 @@
<script setup lang="ts">
import { computed } from "@vue/reactivity";
import {
onBeforeRouteLeave,
onBeforeRouteUpdate,
RouteLocationNormalized
onBeforeRouteLeave,
onBeforeRouteUpdate,
RouteLocationNormalized,
} from "vue-router";
import { Track } from "@/interfaces";
@@ -104,10 +104,6 @@ onBeforeRouteLeave(() => {
.album-virtual-scroller {
height: 100%;
.scroller {
padding-bottom: $content-padding-bottom;
}
.songlist-item {
grid-template-columns: 1.5rem 1.5fr 1fr 2.5rem 2.5rem;
}