g4.3
This commit is contained in:
1 parent
6c89037ca6
commit
a994562779
8 files changed
+323
-327
No files matched your search
@@ -65,6 +65,20 @@ button {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.mc-xp-bar {
|
||||
width: 100%;
|
||||
height: 20px;
|
||||
background-image: url("../imgs/xp-bar-bg.png");
|
||||
background-size: 100% 20px;
|
||||
}
|
||||
.mc-xp-bar > div {
|
||||
width: 100%;
|
||||
height: 20px;
|
||||
background-image: url("../imgs/xp-bar-fg.png");
|
||||
background-size: 100% 20px;
|
||||
clip-path: inset(0 100% 0 0);
|
||||
}
|
||||
|
||||
/* ----------- overlay ----------- */
|
||||
|
||||
overlay {
|
||||
|
||||
+18
-2
@@ -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)`);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user