re-add clan tags, never moved them after the js move
All checks were successful
Code quality checks / biome (push) Successful in 13s
All checks were successful
Code quality checks / biome (push) Successful in 13s
This commit is contained in:
parent
bafdfb47f9
commit
94046881dd
3 changed files with 81 additions and 38 deletions
|
@ -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 {
|
||||
|
|
|
@ -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}`;
|
||||
|
|
|
@ -1,17 +1,16 @@
|
|||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
|
||||
<title>Discord Presence</title>
|
||||
|
||||
<link rel="stylesheet" href="/public/css/index.css">
|
||||
<link rel="stylesheet" href="/public/css/root.css">
|
||||
<link rel="stylesheet" href="/public/css/index.css" />
|
||||
<link rel="stylesheet" href="/public/css/root.css" />
|
||||
|
||||
<meta name="color-scheme" content="dark">
|
||||
<link rel="icon" id="site-icon" type="image/png">
|
||||
<meta name="color-scheme" content="dark" />
|
||||
<link rel="icon" id="site-icon" type="image/png" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
@ -19,14 +18,23 @@
|
|||
<div class="loading-spinner"></div>
|
||||
</div>
|
||||
|
||||
<a href="https://git.creations.works/creations/profilePage" target="_blank" rel="noopener noreferrer">
|
||||
<img class="open-source-logo" src="/public/assets/forgejo_logo.svg" alt="Forgejo Logo" style="opacity: 0.5;">
|
||||
<a
|
||||
href="https://git.creations.works/creations/profilePage"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
<img
|
||||
class="open-source-logo"
|
||||
src="/public/assets/forgejo_logo.svg"
|
||||
alt="Forgejo Logo"
|
||||
style="opacity: 0.5"
|
||||
/>
|
||||
</a>
|
||||
|
||||
<div class="user-card">
|
||||
<div class="avatar-status-wrapper">
|
||||
<div class="avatar-wrapper">
|
||||
<img class="avatar hidden" src="">
|
||||
<img class="avatar hidden" src="" />
|
||||
<div class="status-indicator offline hidden"></div>
|
||||
</div>
|
||||
<div class="user-info">
|
||||
|
@ -48,5 +56,4 @@
|
|||
|
||||
<script src="/public/js/index.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
Loading…
Add table
Reference in a new issue