mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 20:43:04 +00:00
use virtual scroll layout on playlist page
+ fix playlist and album page header width
This commit is contained in:
committed by
Mungai Njoroge
parent
f2aee70a8a
commit
097c2b4a83
@@ -13,7 +13,7 @@ $medium: 0.75rem;
|
|||||||
$large: 1.5rem;
|
$large: 1.5rem;
|
||||||
$larger: 2rem;
|
$larger: 2rem;
|
||||||
|
|
||||||
$banner-height: 18rem;
|
$banner-height: 23rem;
|
||||||
|
|
||||||
// apple human design guideline colors
|
// apple human design guideline colors
|
||||||
$black: #181a1c;
|
$black: #181a1c;
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ useVisibility(albumheaderthing, handleVisibilityState);
|
|||||||
grid-template-columns: max-content 1fr;
|
grid-template-columns: max-content 1fr;
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
height: 100% !important;
|
height: $banner-height;
|
||||||
background-color: $black;
|
background-color: $black;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ function editPlaylist() {
|
|||||||
.p-header {
|
.p-header {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 1fr;
|
grid-template-columns: 1fr;
|
||||||
height: 100%;
|
height: $banner-height;
|
||||||
position: relative;
|
position: relative;
|
||||||
background-color: $gray5;
|
background-color: $gray5;
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ import useLoaderStore from "@/stores/loader";
|
|||||||
import useFolderStore from "@/stores/pages/folder";
|
import useFolderStore from "@/stores/pages/folder";
|
||||||
|
|
||||||
import Layout from "@/layouts/HeaderAndVList.vue";
|
import Layout from "@/layouts/HeaderAndVList.vue";
|
||||||
import SongList from "@/components/FolderView/SongList.vue";
|
|
||||||
import FolderList from "@/components/FolderView/FolderList.vue";
|
import FolderList from "@/components/FolderView/FolderList.vue";
|
||||||
|
|
||||||
const loader = useLoaderStore();
|
const loader = useLoaderStore();
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
<template>
|
|
||||||
<Header :album="album" />
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup lang="ts">
|
|
||||||
import Header from "@/components/AlbumView/Header.vue";
|
|
||||||
import { AlbumInfo } from "@/interfaces";
|
|
||||||
|
|
||||||
defineProps<{
|
|
||||||
album: AlbumInfo;
|
|
||||||
}>();
|
|
||||||
</script>
|
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
:on_album_page="true"
|
:on_album_page="true"
|
||||||
>
|
>
|
||||||
<template #header>
|
<template #header>
|
||||||
<Header :album="album.info" :bio="album.bio" />
|
<Header :album="album.info" />
|
||||||
</template>
|
</template>
|
||||||
</Layout>
|
</Layout>
|
||||||
</template>
|
</template>
|
||||||
@@ -23,7 +23,7 @@ import useQueueStore from "@/stores/queue";
|
|||||||
import useAStore from "@/stores/pages/album";
|
import useAStore from "@/stores/pages/album";
|
||||||
|
|
||||||
// @components
|
// @components
|
||||||
import Header from "./Header.vue";
|
import Header from "@/components/AlbumView/Header.vue";
|
||||||
import Layout from "@/layouts/HeaderAndVList.vue";
|
import Layout from "@/layouts/HeaderAndVList.vue";
|
||||||
|
|
||||||
// @vars
|
// @vars
|
||||||
|
|||||||
@@ -1,47 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="songlist rounded">
|
|
||||||
<div v-if="tracks.length">
|
|
||||||
<SongList
|
|
||||||
:tracks="tracks"
|
|
||||||
:pname="name"
|
|
||||||
:playlistid="playlistid"
|
|
||||||
@playFromPage="playFromPlaylistPage"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div v-else-if="tracks.length === 0 && count > 0">
|
|
||||||
<div class="no-results">
|
|
||||||
<div class="text">We can't find your music 🦋</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div v-else-if="tracks.length === 0 && count == 0">
|
|
||||||
<div class="no-results">
|
|
||||||
<div class="text">Nothing here</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup lang="ts">
|
|
||||||
import useQueueStore from "@/stores/queue";
|
|
||||||
import usePlaylistStore from "@/stores/pages/playlist";
|
|
||||||
|
|
||||||
import SongList from "@/components/FolderView/SongList.vue";
|
|
||||||
import { Track } from "@/interfaces";
|
|
||||||
import { onUpdated } from "vue";
|
|
||||||
|
|
||||||
const props = defineProps<{
|
|
||||||
tracks: Track[];
|
|
||||||
count: number;
|
|
||||||
name: string;
|
|
||||||
playlistid: string;
|
|
||||||
}>();
|
|
||||||
|
|
||||||
const queue = useQueueStore();
|
|
||||||
const playlist = usePlaylistStore();
|
|
||||||
|
|
||||||
function playFromPlaylistPage(index: number) {
|
|
||||||
const { name, playlistid } = playlist.info;
|
|
||||||
queue.playFromPlaylist(name, playlistid, playlist.allTracks);
|
|
||||||
queue.play(index);
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@@ -1,37 +1,32 @@
|
|||||||
<template>
|
<template>
|
||||||
<Page>
|
<Layout :tracks="playlist.tracks" @playFromPage="playFromPlaylistPage">
|
||||||
<template #header>
|
<template #header>
|
||||||
<Header :info="playlist" />
|
<Header :info="playlist.info" />
|
||||||
</template>
|
</template>
|
||||||
<template #content>
|
</Layout>
|
||||||
<Content
|
|
||||||
:tracks="tracks"
|
|
||||||
:count="playlist.count"
|
|
||||||
:name="playlist.name"
|
|
||||||
:playlistid="playlist.playlistid"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</Page>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { storeToRefs } from "pinia";
|
|
||||||
import Page from "@/layouts/HeaderContentBottom.vue";
|
|
||||||
|
|
||||||
import Header from "@/components/PlaylistView/Header.vue";
|
|
||||||
import Content from "./Content.vue";
|
|
||||||
|
|
||||||
import usePlaylistStore from "@/stores/pages/playlist";
|
|
||||||
import { onBeforeRouteLeave } from "vue-router";
|
import { onBeforeRouteLeave } from "vue-router";
|
||||||
|
|
||||||
const store = usePlaylistStore();
|
import useQueueStore from "@/stores/queue";
|
||||||
const { info: playlist, tracks } = storeToRefs(store);
|
import usePlaylistStore from "@/stores/pages/playlist";
|
||||||
|
|
||||||
|
import Layout from "@/layouts/HeaderAndVList.vue";
|
||||||
|
import Header from "@/components/PlaylistView/Header.vue";
|
||||||
|
|
||||||
|
const queue = useQueueStore();
|
||||||
|
const playlist = usePlaylistStore();
|
||||||
|
|
||||||
|
function playFromPlaylistPage(index: number) {
|
||||||
|
const { name, playlistid } = playlist.info;
|
||||||
|
queue.playFromPlaylist(name, playlistid, playlist.allTracks);
|
||||||
|
queue.play(index);
|
||||||
|
}
|
||||||
|
|
||||||
onBeforeRouteLeave(() => {
|
onBeforeRouteLeave(() => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
store.resetQuery();
|
playlist.resetQuery();
|
||||||
}, 500);
|
}, 500);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss"></style>
|
|
||||||
|
|||||||
Reference in New Issue
Block a user