From b5f589c323f415bb42ea7069cb4d1a8a2233dd69 Mon Sep 17 00:00:00 2001 From: Minteck Date: Wed, 31 Aug 2022 22:03:07 +0200 Subject: Update I guess - Stuffie --- app/banner.js | 17 ++++---- app/emergency/index.php | 2 +- app/fronters/style.css | 4 -- app/index.html | 107 +++++++++++++++++++++++++++++++++--------------- app/load.js | 58 ++++++++++++++++++++++++-- app/planner/index.php | 2 +- 6 files changed, 139 insertions(+), 51 deletions(-) (limited to 'app') diff --git a/app/banner.js b/app/banner.js index 8dd42a4..81991e9 100644 --- a/app/banner.js +++ b/app/banner.js @@ -107,17 +107,20 @@ async function refreshBanner(offline, french) { document.getElementById("member-banner").innerHTML = `
-
+

- ${data['id'] === "unknown" ? ` - Unknown member (${data['system']['name']} System) - ` : data['id'] === "fusion" ? (data['name'] === "fusion" ? ` - Multiple merged members - ` : data['name']) : data['name']} + + + ${data['id'] === "unknown" ? ` + Unknown member (${data['system']['name']} System) + ` : data['id'] === "fusion" ? (data['name'] === "fusion" ? ` + Multiple merged members + ` : data['name']) : data['name']} +

@@ -176,7 +179,7 @@ async function refreshBanner(offline, french) { ` : ''}
${data['id'] !== "unknown" && data['id'] !== "fusion" ? ` -
+
${french ? (data['relations']['marefriends'].length > 1 ? 'Partenaires ' : 'Partenaire ') : `Marefriend${data['relations']['marefriends'].length > 1 ? 's' : ''}`}: ${data['relations']['marefriends'].length > 1 ? '
' : ''} ${data['relations']['marefriends'].map(relation => ` diff --git a/app/emergency/index.php b/app/emergency/index.php index 395f0d9..d8cfedf 100644 --- a/app/emergency/index.php +++ b/app/emergency/index.php @@ -1,4 +1,4 @@ - + diff --git a/app/fronters/style.css b/app/fronters/style.css index 135500a..cc3a8cb 100644 --- a/app/fronters/style.css +++ b/app/fronters/style.css @@ -8,10 +8,6 @@ grid-template-columns: repeat(6, 1fr) !important; } -@media (max-width: 1399px) { - -} - @media (max-width: 1199px) { .wiaf-grid { grid-template-columns: repeat(4, 1fr) !important; diff --git a/app/index.html b/app/index.html index decc6b7..22ee9a9 100644 --- a/app/index.html +++ b/app/index.html @@ -201,6 +201,29 @@ } } + .list-group-item { + color: #fff; + background-color: #222; + border: 1px solid rgba(255, 255, 255, .125); + } + + .list-group-item.disabled { + color: #fff; + background-color: #222; + border-color: rgba(255, 255, 255, .125); + opacity: .75; + } + + .list-group-item-action:hover { + background-color: #252525; + color: #ddd; + } + + .list-group-item-action:active, .list-group-item-action:focus { + background-color: #272727; + color: #bbb; + } + #member-banner a { color: white; } @@ -220,6 +243,23 @@ grid-template-columns: 1fr !important; text-align: left; } + + #member-icon-mobile { + display: inline-block !important; + } + + #system-info { + grid-template-columns: 1fr !important; + } + + #member-icon, #member-icon-outer { + display: none !important; + } + + #member-relations { + grid-template-columns: 1fr !important; + text-align: left; + } } .tooltip.show { @@ -230,6 +270,10 @@ background: #151515; box-shadow: 3px 4px 10px #ffffff26; } + + html, body, #app { + height: 100%; + } @@ -242,43 +286,38 @@
-
-
-
-

-

 Greetings Name!

- -
-
- - - Fronters - - - - Bits - - - - Planner - - - - Emergency - +
+
+
+ +

In the other system: Some member

-

- -

-
- Demo mode (for Raindrops' therapist) -

- -
-
- +
+

© Equestria.dev Developers · Data updated

diff --git a/app/load.js b/app/load.js index 9e4d3b9..1be0b57 100644 --- a/app/load.js +++ b/app/load.js @@ -46,6 +46,21 @@ let valuesToGet = { limited: false, name: "Switches at Raindrops...", }, + "actions": { + url: "/api/data?f=actions.json", + limited: false, + name: "Actions...", + }, + "rules": { + url: "/api/data?f=rules.json", + limited: false, + name: "Systems rules...", + }, + "nicknames": { + url: "/api/data?f=nicknames.json", + limited: false, + name: "Relations nicknames...", + }, "peh-cloudburst-data": { url: "/api/cloudburst-data", limited: false, @@ -56,6 +71,16 @@ let valuesToGet = { limited: false, name: "Raindrops data...", }, + "peh-cloudburst-scored": { + url: "/api/cloudburst-scored", + limited: false, + name: "Cloudburst ordered members...", + }, + "peh-raindrops-scored": { + url: "/api/raindrops-scored", + limited: false, + name: "Raindrops ordered members...", + }, "peh-cloudburst-banners": { url: "/api/cloudburst-banners", limited: false, @@ -138,13 +163,27 @@ async function getNewValue() { } try { - if (valuesToGet[keys[0]].condition && !(await valuesToGet[keys[0]].condition())) throw new Error(); + if (valuesToGet[keys[0]].condition && !(await valuesToGet[keys[0]].condition())) { + keys.shift(); + + if (!keys[0]) { + await localforage.setItem("refresh", new Date().toISOString()); + await postLoad(); + return; + } + + document.getElementById("progress-inner").style.width = ((index / Object.keys(valuesToGet).length) * 100) + "%"; + index++; + await getNewValue(); + return; + } document.getElementById("loader-message").innerText = valuesToGet[keys[0]].name; await localforage.setItem(keys[0], (await (await fetchPlus(valuesToGet[keys[0]]["url"], { timeout: 3000 })).text())); keys.shift(); if (!keys[0]) { + await localforage.setItem("refresh", new Date().toISOString()); await postLoad(); return; } @@ -155,6 +194,9 @@ async function getNewValue() { await getNewValue(); }, valuesToGet[keys[0]]["limited"] ? 550 : 0); } catch (e) { + console.log("Error while fetching", keys[0]); + console.error(e); + for (let key of Object.keys(valuesToGet)) { if (await localforage.getItem(key) === null) { throw new Error("App requested key '" + key + "' but it can't be retrieved at the moment"); @@ -181,6 +223,8 @@ async function postLoad() { if (key !== "images") localStorage.setItem(key, await localforage.getItem(key)) } + window.images = JSON.parse(await localforage.getItem("images")); + localStorage.setItem("pluralkit-0", localStorage.getItem("pluralkit-raindrops-members")); localStorage.setItem("pluralkit-1", localStorage.getItem("pluralkit-cloudburst-members")); @@ -242,6 +286,13 @@ async function postLoad() { break; } + window.otherSystem = window.data.identity.id === "raindrops" ? "cloudburst" : "raindrops"; + window.otherFronters = window.data["pluralkit-" + otherSystem + "-fronters"]; + + document.getElementById("home-other-system").innerText = otherSystem === "raindrops" ? "Raindrops System" : "Cloudburst System"; + document.getElementById("home-other-name").innerText = window.otherFronters.members[0].display_name ?? window.otherFronters.members[0].name; + document.getElementById("home-other-img").src = window.images.profile[otherSystem === "raindrops" ? "gdapd" : "ynmuc"][window.otherFronters.members[0].id]; + if (!window.connected) { document.getElementById("home-app-planner").classList.add("disabled"); document.getElementById("home-app-emergency").classList.add("disabled"); @@ -261,9 +312,8 @@ async function postLoad() { } } - window.currentMemberData = JSON.parse(localStorage.getItem("peh-" + JSON.parse(localStorage.getItem("identity")).id + "-banners"))[JSON.parse(localStorage.getItem("pluralkit-" + JSON.parse(localStorage.getItem("identity")).id + "-fronters")).members[0].name]; - - //await refreshBanner(true); refreshTooltips(); + document.getElementById("copyright-year").innerText = new Date().getFullYear().toString(); + document.getElementById("update-date").innerText = timeAgo(await localforage.getItem("refresh")); setInterval(async () => { Array.from(document.getElementsByClassName("relative-time")).forEach((el) => { diff --git a/app/planner/index.php b/app/planner/index.php index 30f09dd..b2070da 100644 --- a/app/planner/index.php +++ b/app/planner/index.php @@ -1,4 +1,4 @@ - + -- cgit