This commit is contained in:
Turtle committed 2026-01-03 11:02:42 +01:00
1 parent 6c89037ca6
commit a994562779
8 files changed
+323 -327

No files matched your search

+18 -2
View File
@@ -507,14 +507,21 @@ Rolle: <label></label>
function _showProfile(user) {
let elm = getId("profile_overlay");
const hasProfilAbility = user.enabled_abilities.includes("profile_pic");
const features = user.enabled_abilities ??= [];
const hasProfilAbility = features.includes("profile_pic");
const avatarInp = elm.querySelector(".avatar-inp");
const profilePic = elm.querySelector(".profile-pic");
if (hasProfilAbility) {
elm.querySelector(".profile-pic").style.setProperty("background-image", `url('${user.avatar}')`);
profilePic.style.setProperty("background-image", `url('${user.avatar}')`);
elm.querySelector("input").setAttribute("value", user.avatar);
avatarInp.style.display = "unset";
} else {
if (features.includes("pink_mode")) {
profilePic.style.setProperty("background-image", `url("https://static.turtle-coding-gbr.de/gmci/rosa_profil.png")`);
} else {
profilePic.style.setProperty("background-image", `url("https://static.turtle-coding-gbr.de/gmci/standart_profil.png")`);
}
avatarInp.style.display = "none";
}
elm.querySelector("u").innerText = getUserDisplayName(user);
@@ -594,4 +601,13 @@ async function levelUpXP(couchDB, user = userData, xp = 1) {
await updateUserData(couchDB, user);
return resLevelUp;
}
function setXPBarPercent(percent) {
percent = 100 - percent;
const elms = document.querySelectorAll(".mc-xp-bar");
for (var elm of elms) {
const div = elm.querySelector("div");
div.style.setProperty('clip-path', `inset(0 ${percent}% 0 0)`);
}
}