Skip to content

Commit

Permalink
css: add liked hint (animated)
Browse files Browse the repository at this point in the history
  • Loading branch information
111116 committed Feb 12, 2020
1 parent 3ba9b54 commit abc0a8d
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
4 changes: 4 additions & 0 deletions scripts/addbeatmaplist.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ var NSaddBeatmapList = {
if (err) {
console.error("Error saving liked beatmap list");
}
else {
icon.classList.add("hint-liked");
}
});
icon.onclick = box.undolike;
icon.classList.remove("icon-heart-empty");
Expand All @@ -153,6 +156,7 @@ var NSaddBeatmapList = {
icon.onclick = box.like;
icon.classList.remove("icon-heart");
icon.classList.add("icon-heart-empty");
icon.classList.remove("hint-liked");
}
if (window.liked_sid_set) {
box.initlike();
Expand Down
25 changes: 24 additions & 1 deletion style/main.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@charset "UTF-8";

body{
background: #191919;
color: #eee;
Expand Down Expand Up @@ -784,7 +786,28 @@ progress.finished::-webkit-progress-value{background:#6cf;}
.beatmaplike.icon-heart {
color: #ed4956;
}

.beatmaplike.hint-liked::after {
content: "已收藏";
white-space: nowrap;
position: absolute;
bottom: 32px;
right: -8px;
color: white;
background: rgba(0,0,0,0.8);
font-size: 0.6em;
padding-left: 0.25em;
padding-right: 0.25em;
border-radius: 0.3em;
opacity: 0;
animation-name: fadeoutmy;
animation-duration: 0.8s;
animation-timing-function: ease-in;
}
@keyframes fadeoutmy {
0% { opacity: 1; }
70% { opacity: 1; }
100% { opacity: 0; }
}


.panel table {
Expand Down

0 comments on commit abc0a8d

Please sign in to comment.