From 7b911c1658804b387eaf2520634400751a27cc4d Mon Sep 17 00:00:00 2001
From: marcus <30408959+8790@users.noreply.github.com>
Date: Tue, 21 Jun 2022 13:45:32 +0800
Subject: [PATCH] feat: Add "Volume Control" to Lyrics Page (#1672)
* feat: Add "Volume Control" to Lyrics Page
* fix: fix mute button
---
src/views/lyrics.vue | 105 +++++++++++++++++++++++++++++++------------
1 file changed, 77 insertions(+), 28 deletions(-)
diff --git a/src/views/lyrics.vue b/src/views/lyrics.vue
index 27520d6..e73a993 100644
--- a/src/views/lyrics.vue
+++ b/src/views/lyrics.vue
@@ -76,26 +76,50 @@
-
@@ -260,6 +284,14 @@ export default {
currentTrack() {
return this.player.currentTrack;
},
+ volume: {
+ get() {
+ return this.player.volume;
+ },
+ set(value) {
+ this.player.volume = value;
+ },
+ },
imageUrl() {
return this.player.currentTrack?.al?.picUrl + '?param=1024y1024';
},
@@ -474,6 +506,9 @@ export default {
getListPath() {
return getListSourcePath();
},
+ mute() {
+ this.player.mute();
+ },
},
};
@@ -591,17 +626,31 @@ export default {
display: flex;
justify-content: space-between;
- .buttons {
+ .top-right {
display: flex;
- align-items: center;
-
- button {
- margin: 0 0 0 4px;
+ justify-content: space-between;
+
+ .volume-control {
+ margin: 0 10px;
+ display: flex;
+ align-items: center;
+ .volume-bar {
+ width: 84px;
+ }
}
- .svg-icon {
- height: 18px;
- width: 18px;
+ .buttons {
+ display: flex;
+ align-items: center;
+
+ button {
+ margin: 0 0 0 4px;
+ }
+
+ .svg-icon {
+ height: 18px;
+ width: 18px;
+ }
}
}
}