Skip to content

Commit

Permalink
code>modify.fix: fix bug in changing the font color to ensure it look…
Browse files Browse the repository at this point in the history
…s clear when the background color is deep
  • Loading branch information
pwnfan committed Jul 31, 2023
1 parent 1e2de4f commit 4318a99
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions js/tagmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -761,15 +761,19 @@ function addTags(
4
)}\n\nTag Mouse Operation Guide:\n* [Left Click] to show/hide the definition of this tag.\n* [Right Click] to add this tag into the header filter input box.\n* [Hover] to show tag information (this popup).`;

let tagCountSub;
if (withCount) {
let tagCountSub = document.createElement("sub");
tagCountSub = document.createElement("sub");
tagDiv.appendChild(tagCountSub);
tagCountSub.innerText = `${count}`;
}

// Change the font color to ensure it looks clear when the background color is deep
if (count / maxTagCount >= 0.6) {
tagsDiv.style.color = "white";
tagSpan.style.color = "white";
if (tagCountSub){
tagCountSub.style.color = "white";
}
}

tagDiv.addEventListener("click", showTagDefinition);
Expand Down

0 comments on commit 4318a99

Please sign in to comment.