diff --git a/imgs/xp-bar-bg.png b/imgs/xp-bar-bg.png new file mode 100644 index 0000000..ae66ea5 Binary files /dev/null and b/imgs/xp-bar-bg.png differ diff --git a/imgs/xp-bar-fg.png b/imgs/xp-bar-fg.png new file mode 100644 index 0000000..338ff0f Binary files /dev/null and b/imgs/xp-bar-fg.png differ diff --git a/lib/basic.css b/lib/basic.css index df60261..5a779c1 100644 --- a/lib/basic.css +++ b/lib/basic.css @@ -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 { diff --git a/lib/basic.js b/lib/basic.js index 5ab917e..838ea2e 100644 --- a/lib/basic.js +++ b/lib/basic.js @@ -507,14 +507,21 @@ Rolle: 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)`); + } } \ No newline at end of file diff --git a/prof/auswertung.html b/prof/auswertung.html index 1c13a5b..2919fbd 100644 --- a/prof/auswertung.html +++ b/prof/auswertung.html @@ -87,6 +87,9 @@ button.navigation:hover { background-color: var(--accent_color_bg_o); border-radius: var(--border-radius); } +#umfrage_list { + width: 100%; +} #umfrage_list > div { padding: 10px; border: 2px solid var(--accent_color_bg); diff --git a/student/kursAnzeige.html b/student/kursAnzeige.html index a700279..d71ea24 100644 --- a/student/kursAnzeige.html +++ b/student/kursAnzeige.html @@ -11,6 +11,7 @@ +