🔷 add PlayingFrom component to right sidebar

🔷 move upNext card into separate component
🔷 a lot of refactors
This commit is contained in:
geoffrey45
2022-04-03 21:47:57 +03:00
parent 334cf0fce1
commit 6cf9a58d6d
26 changed files with 425 additions and 220 deletions
+5 -69
View File
@@ -1,28 +1,8 @@
<template>
<div class="up-next">
<div class="r-grid">
<div class="main-item border">
<p class="heading">COMING UP NEXT</p>
<div class="itemx" @click="queue.playNext">
<div
class="album-art image"
:style="{
backgroundImage: `url(&quot;${queue.next.image}&quot;)`,
}"
></div>
<div class="tags">
<p class="title ellip">{{ queue.next.title }}</p>
<hr />
<p class="artist ellip">
<span
v-for="artist in putCommas(queue.next.artists)"
:key="artist"
>{{ artist }}</span
>
</p>
</div>
</div>
</div>
<PlayingFrom :from="queue.from" />
<UpNext :next="queue.next" :playNext="queue.playNext" />
<div class="scrollable-r border rounded">
<TrackItem
v-for="t in queue.tracks"
@@ -38,16 +18,14 @@
</template>
<script setup lang="ts">
import perks from "../../composables/perks.js";
import TrackItem from "../shared/TrackItem.vue";
import useQStore from "../../stores/queue";
import { Track } from "../../interfaces.js";
import { onBeforeMount } from "vue";
import PlayingFrom from "./queue/playingFrom.vue";
import UpNext from "./queue/upNext.vue";
const queue = useQStore();
const putCommas = perks.putCommas;
function playThis(track: Track) {
queue.play(track);
}
@@ -64,53 +42,11 @@ function playThis(track: Track) {
margin: 0.5rem 0 1rem 0;
}
.main-item {
border-radius: 0.5rem;
padding: 0.5rem;
margin-bottom: 0.5rem;
.itemx {
display: flex;
align-items: center;
padding: 0.5rem;
cursor: pointer;
border-radius: 0.5rem;
&:hover {
background-color: $gray;
}
}
.album-art {
width: 4.5rem;
height: 4.5rem;
background-image: url(../../assets/images/null.webp);
margin: 0 0.5rem 0 0;
border-radius: 0.5rem;
}
.tags {
hr {
border: none;
margin: 0.3rem;
}
.title {
width: 20rem;
margin: 0;
}
.artist {
width: 20rem;
margin: 0;
font-size: small;
}
}
}
.r-grid {
position: relative;
height: 100%;
display: grid;
grid-template-rows: min-content;
grid-template-rows: max-content max-content 1fr;
.scrollable-r {
height: 100%;