beautifying the tags

This commit is contained in:
2026-05-29 09:12:21 +02:00
parent 18add9f21a
commit 697d62f89b
6 changed files with 21 additions and 29 deletions

View File

@@ -60,7 +60,7 @@
a.textContent = tag.tag;
const span = document.createElement("span");
span.classList.add("badge", "mr-2");
span.classList.add("badge");
if (highlightTag && (tag.tag === highlightTag || tag.normalized === highlightTag)) {
span.classList.add('new-tag-glow');
}

View File

@@ -3659,7 +3659,7 @@ window.cancelAnimFrame = (function () {
// Backup current state
const oldClasses = [...toggleBtn.classList];
const oldTextContent = toggleBtn.textContent;
const oldInnerHTML = toggleBtn.innerHTML;
// Track active request ID to ignore out-of-order race conditions on rapid keypresses
const reqId = (toggleBtn._lastCycleReqId || 0) + 1;
@@ -3671,7 +3671,7 @@ window.cancelAnimFrame = (function () {
// Optimistically apply new state
toggleBtn.classList.remove('is-sfw', 'is-nsfw', 'is-nsfl', 'is-untagged');
toggleBtn.classList.add(`is-${nextRating}`);
toggleBtn.textContent = nextLabel;
// (icon stays — only CSS class color changes)
// Optimistically update the sidebar tag list
let originalTags = [];
@@ -3750,7 +3750,7 @@ window.cancelAnimFrame = (function () {
// Verify visual state and sync tags
toggleBtn.classList.remove('is-sfw', 'is-nsfw', 'is-nsfl', 'is-untagged');
toggleBtn.classList.add(`is-${res.rating}`);
toggleBtn.textContent = labels[res.rating] || res.rating.toUpperCase();
// icon stays constant — class drives the color
if (window.renderTags) {
window.renderTags(res.tags);
@@ -3778,7 +3778,7 @@ window.cancelAnimFrame = (function () {
function revert() {
toggleBtn.className = '';
oldClasses.forEach(cls => toggleBtn.classList.add(cls));
toggleBtn.textContent = oldTextContent;
toggleBtn.innerHTML = oldInnerHTML;
if (window.renderTags && originalTags.length > 0) {
window.renderTags(originalTags);
}
@@ -7138,7 +7138,7 @@ class NotificationSystem {
const fragment = document.createDocumentFragment();
data.tags.forEach(tag => {
const span = document.createElement('span');
span.className = `badge ${tag.badge} mr-2`;
span.className = `badge ${tag.badge}`;
if (hasSession) span.setAttribute('tooltip', tag.display_name || tag.user);
const a = document.createElement('a');

View File

@@ -56,7 +56,7 @@
a.textContent = tag.tag;
const span = document.createElement("span");
span.classList.add("badge", "mr-2");
span.classList.add("badge");
if (highlightTag && (tag.tag === highlightTag || tag.normalized === highlightTag)) {
span.classList.add('new-tag-glow');
}