diff --git a/public/css/index.css b/public/css/index.css index 8820378..fe49dc2 100644 --- a/public/css/index.css +++ b/public/css/index.css @@ -102,7 +102,7 @@ body { } .open-source-logo:hover { - opacity: 1; + opacity: 1 !important; } .hidden { @@ -349,6 +349,8 @@ ul { padding: 0.75rem 1rem; border-radius: 10px; border: 1px solid var(--border-color); + + transition: background-color 0.3s ease; } .activity:hover { diff --git a/public/js/index.js b/public/js/index.js index f4481a9..a43515b 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -390,6 +390,8 @@ async function updatePresence(data) { document.title = username; } + updateClanBadge(data); + const platform = { mobile: data.active_on_discord_mobile, web: data.active_on_discord_web, @@ -559,6 +561,38 @@ async function getAllNoAsset() { } } +function updateClanBadge(data) { + const userInfoInner = document.querySelector(".user-info-inner"); + if (!userInfoInner) return; + + const clan = data?.discord_user?.clan; + if (!clan || !clan.tag || !clan.identity_guild_id || !clan.badge) return; + + const existing = userInfoInner.querySelector(".clan-badge"); + if (existing) existing.remove(); + + const wrapper = document.createElement("div"); + wrapper.className = "clan-badge"; + + const img = document.createElement("img"); + img.src = `https://cdn.discordapp.com/clan-badges/${clan.identity_guild_id}/${clan.badge}`; + img.alt = "Clan Badge"; + + const span = document.createElement("span"); + span.className = "clan-name"; + span.textContent = clan.tag; + + wrapper.appendChild(img); + wrapper.appendChild(span); + + const usernameEl = userInfoInner.querySelector(".username"); + if (usernameEl) { + usernameEl.insertAdjacentElement("afterend", wrapper); + } else { + userInfoInner.appendChild(wrapper); + } +} + if (instanceUri) { if (!instanceUri.startsWith("http")) { instanceUri = `https://${instanceUri}`; diff --git a/src/views/index.html b/src/views/index.html index 3a3ac84..abb36d8 100644 --- a/src/views/index.html +++ b/src/views/index.html @@ -1,52 +1,59 @@ - + +
+ + - - - +