From a994562779b4ba903e73b01d08ebe60a4672fbd4 Mon Sep 17 00:00:00 2001 From: Turtle <104490184+CodingTurtle2@users.noreply.github.com> Date: Sat, 3 Jan 2026 11:02:42 +0100 Subject: [PATCH] g4.3 --- imgs/xp-bar-bg.png | Bin 0 -> 167 bytes imgs/xp-bar-fg.png | Bin 0 -> 1241 bytes lib/basic.css | 14 + lib/basic.js | 20 +- prof/auswertung.html | 3 + student/kursAnzeige.html | 1 + student/uebersicht.html | 610 ++++++++++++++++------------------ student/uebersicht_overlay.js | 2 + 8 files changed, 323 insertions(+), 327 deletions(-) create mode 100644 imgs/xp-bar-bg.png create mode 100644 imgs/xp-bar-fg.png diff --git a/imgs/xp-bar-bg.png b/imgs/xp-bar-bg.png new file mode 100644 index 0000000000000000000000000000000000000000..ae66ea5ef45baae64a9893cf494490daec0d4857 GIT binary patch literal 167 zcmeAS@N?(olHy`uVBq!ia0vp^+klvrg&9anHE_QHQgQ)4A+A8$%-KfI%2?A>U&B~e zK}S_VTUAm;PDEakQ-EjX!{dvADi}+G{DK)Ap4~_Ta?Cwl978H@B|n(sscq1hxMVfw<~3iHBMfkrTR My85}Sb4q9e0IgatMF0Q* literal 0 HcmV?d00001 diff --git a/imgs/xp-bar-fg.png b/imgs/xp-bar-fg.png new file mode 100644 index 0000000000000000000000000000000000000000..338ff0f03a494c045dc98a645a6058221f11d0ee GIT binary patch literal 1241 zcmV;~1Sb25P)n?+-gKu&rpX_!L@91(GvPZ7BwW6&1#s? zYg&ylWtBf>lR;*bLQsAzQGYB_e=JggEK`3kQ-Lf~fh}vCMN@(-ZJkAKphs_@MsJ}> zZ=y(WqexSNEi+XaRDvyXrATt7Nph!4bEZmjr%7|CN^_`7bf-#msz`OIOjLs`RD&&c zsY`aMOLnSEccN5Ogf1XD4S1tfc&aRZ5wObwr$(CZF_&*cBZnowzfZ= zI(hOWHI?yr44fJ!f`=LiE3F=8ftVZr*^2VN}-pz9<@ViB%IV4id753 z-$N8i=a!_UZX?_9)`W=eOVQ}Vp{B94yf!+I6T(QwuE){!ykOL+h#z>=;*(A=LSSOh zvf2Z`D6I&s;{10*Nd^rq-dC-p|cy0v1eAoX5C(nBjj6l`E&s-JsO zQC_f|Jt`{Q8Qgq%re=5yxc~EWysj<>SmujFj4FmHR-(CVRj@;V0_@m)0>WS z_$7OOXUr1u;| zr4{fqN-?Jc=IWPmfh`nsnhpTzl+@IWq1e1AsFD664TSC%wr$A;0G>^lU*ibU`7_`) z=!GQABC`c#Wi35Pz3taFEwHZ7h=dvWFqdOF<_G~%%#jTBwo{K*Jv&rsI6baX5>b)b zp@K>(r{Lcl1`ty{uKVw2!P6wV&JC*76uC~KoA>+y9sYv!@-Po)00000NkvXXu0mjf D@9Z+= literal 0 HcmV?d00001 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 @@ + Kurs Anzeige diff --git a/student/uebersicht.html b/student/uebersicht.html index 0526651..4bcb5db 100644 --- a/student/uebersicht.html +++ b/student/uebersicht.html @@ -1,364 +1,324 @@ - - - - - - - - - - Übersicht + + + + + + + + +Übersicht -
-
- Meine Kurse -
-
+ - const couchDB = new CouchDB(); - setUserData(couchDB).then((val) => { - setCourseView(); - setLevelProgress(userData.xp); - setLevel(userData.level); - }); +
+
Meine Kurse
+
+
+ +
+
+
- async function startSurvey() { - const code = getOverlay("survey").getElementsByTagName("INPUT")[0].value.trim(); - console.log(code); - var course = await couchDB.get("course:" + code); - if (course != undefined) { - const users = await couchDB.get("users"); - users[userData.name].courses ??= []; - if (!users[userData.name].courses.includes(code)) { - users[userData.name].courses.push(code); - } - await couchDB.set("users", users); - location.href = "./umfrage.html?user=" + userData.name + ",course=" + code; - } else { - alert("Umfrage nicht gefunden!"); - } - } +
- async function setCourseView() { - const courseList = document.getElementById("courses-list"); - courseList.innerHTML = ""; +
+
+
+
Level 5
+
+
+
+
+
+ + +
+
- for (const courseId of userData.courses) { - const course = await couchDB.get("course:" + courseId); + + +
+ +
+ +
+
- const card = document.createElement("div"); - card.className = "course-card"; - card.addEventListener("click", (e) => { - if (e.target.closest("button")) return; - location.href = "./kursAnzeige.html?user=" + userData.name + ",course=" + courseId; - }); + +
+ +
+ +
+
- const surveyUrl = - card.innerHTML = ` -
${course.title}
+ +function newCourse() { + showOverlay("add-course"); +} - +function addCourseToList(courseName) { + const coursesList = document.getElementById("courses-list"); + const courseDiv = document.createElement("div"); + courseDiv.className = "course-item"; + courseDiv.innerHTML = ` + ${courseName} + + `; + coursesList.appendChild(courseDiv); +} + - \ No newline at end of file + + diff --git a/student/uebersicht_overlay.js b/student/uebersicht_overlay.js index 6b101f8..87d12bf 100644 --- a/student/uebersicht_overlay.js +++ b/student/uebersicht_overlay.js @@ -133,6 +133,8 @@ border-radius: var(--border-radius); span.innerHTML = `
${answers}
`; + span.style.justifyContent = "top"; + span.style.setProperty("justify-content", "start"); } }