From 7c575be4bc85f12af6d9a38294b800c877a613b8 Mon Sep 17 00:00:00 2001 From: geoffrey45 Date: Fri, 2 Sep 2022 23:15:35 +0300 Subject: [PATCH] add hover state to playlist card --- src/components/PlaylistsList/PlaylistCard.vue | 11 +++++++---- src/stores/queue.ts | 6 ++++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/components/PlaylistsList/PlaylistCard.vue b/src/components/PlaylistsList/PlaylistCard.vue index a8820f58..7f206c04 100644 --- a/src/components/PlaylistsList/PlaylistCard.vue +++ b/src/components/PlaylistsList/PlaylistCard.vue @@ -5,7 +5,7 @@ class="p-card rounded noscroll" > -
+
{{ playlist.name }}
{{ playlist.count + ` ${playlist.count == 1 ? "Track" : "Tracks"}` }} @@ -38,7 +38,7 @@ const props = defineProps<{ height: 100%; aspect-ratio: 1/1.2; object-fit: cover; - border-radius: $medium; + transition: all 0.25s ease; } .overlay { @@ -46,7 +46,7 @@ const props = defineProps<{ top: 0; background-image: linear-gradient( to top, - rgba(0, 0, 0, 0.753), + rgba(0, 0, 0, 0.55), transparent 60% ); height: 100%; @@ -54,6 +54,7 @@ const props = defineProps<{ display: flex; flex-direction: column; justify-content: flex-end; + transition: all 0.25s ease; .p-count { opacity: 0.75; @@ -62,7 +63,9 @@ const props = defineProps<{ } &:hover { - background-color: $darkestblue; + img { + transform: scale(1.1); + } } .bottom { diff --git a/src/stores/queue.ts b/src/stores/queue.ts index f7a8d9fa..2e04201f 100644 --- a/src/stores/queue.ts +++ b/src/stores/queue.ts @@ -208,9 +208,11 @@ export default defineStore("Queue", { this.tracklist = shuffled; this.currentindex = 0; - this.play(this.currentindex); - this.currentid = shuffled[0].trackid; + + if (this.playing) { + this.play(this.currentindex); + } }, removeFromQueue(index: number = 0) { this.tracklist.splice(index, 1);