fix: 收藏 (#301)
This commit is contained in:
parent
e434faf684
commit
baedee5638
@ -189,7 +189,7 @@ progress::-webkit-progress-value {
|
||||
.button-group {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin: 15px 0;
|
||||
margin: 5px 0;
|
||||
}
|
||||
|
||||
.player-controls {
|
||||
@ -285,12 +285,12 @@ textarea {
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
/* 媒体查询 屏幕宽度小于440px时 */
|
||||
|
||||
|
||||
|
||||
@media screen and (max-width: 440px) {
|
||||
.player{
|
||||
width: 90%;
|
||||
}
|
||||
.footer {
|
||||
position: relative;
|
||||
}
|
||||
}
|
@ -71,14 +71,16 @@ function togglePlayMode(isSend = true) {
|
||||
}
|
||||
|
||||
function addToFavorites() {
|
||||
|
||||
const cmd = $(".favorite").hasClass("favorite-active")
|
||||
? "取消收藏"
|
||||
: "加入收藏";
|
||||
if ($(".favorite").hasClass("favorite-active")) {
|
||||
const isLiked = $(".favorite").hasClass("favorite-active");
|
||||
const cmd = isLiked? "取消收藏": "加入收藏";
|
||||
if (isLiked) {
|
||||
$(".favorite").removeClass("favorite-active");
|
||||
// 取消收藏
|
||||
favoritelist = favoritelist.filter((item) => item != $("#music_name").val());
|
||||
} else {
|
||||
$(".favorite").addClass("favorite-active");
|
||||
// 加入收藏
|
||||
favoritelist.push($("#music_name").val());
|
||||
}
|
||||
sendcmd(cmd);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user