From 46251292b5c8b431de66aeff473594ccec60e04c Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Thu, 20 Jul 2023 18:29:09 +0200 Subject: Updated 19 files and added 26 files (automated) --- includes/components/2023ui.inc | 114 ++++++ includes/components/explicit.php | 20 +- includes/components/footer.inc | 10 + includes/components/fullbanner.inc | 2 - includes/components/header.inc | 464 ++++++++++++++++++++- includes/components/mobilenav.inc | 5 +- includes/components/navigation.inc | 814 +++++++++++++++++++------------------ includes/components/pane.inc | 5 +- includes/components/sysbanner.inc | 11 +- includes/flags.json | 3 +- includes/fragments/evening.inc | 245 +++++++++++ includes/fragments/member.inc | 4 +- includes/fragments/system.inc | 4 +- includes/pages.json | 21 + includes/themes.json | 69 ++++ includes/util/banner.inc | 23 +- includes/util/evening.inc | 68 ++++ 17 files changed, 1432 insertions(+), 450 deletions(-) create mode 100644 includes/components/2023ui.inc create mode 100644 includes/fragments/evening.inc create mode 100644 includes/themes.json create mode 100644 includes/util/evening.inc (limited to 'includes') diff --git a/includes/components/2023ui.inc b/includes/components/2023ui.inc new file mode 100644 index 0000000..556a8b5 --- /dev/null +++ b/includes/components/2023ui.inc @@ -0,0 +1,114 @@ + + + + + \ No newline at end of file diff --git a/includes/components/explicit.php b/includes/components/explicit.php index 4c55896..3e7675c 100644 --- a/includes/components/explicit.php +++ b/includes/components/explicit.php @@ -21,16 +21,18 @@ - + #explicit-modal .modal-content { + border: 1px solid rgba(255, 255, 255, .2); + background-color: #111; + } + + + +

+ + .css" rel="preload" as="style"> + .css" rel="preload" as="style"> + .css" rel="stylesheet"> - - + + <?= $title && $title !== "-" ? $title . " · " : "" ?>Cold Haze .png" type="image/png"> - + .css" rel="stylesheet"> - + style="background-color: #000;" style="background-color: var(--palette-1);">
- + @@ -230,6 +239,367 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/functions.inc"; + "); + + echo("Color difference debug\n======================\n\n"); + echo("Member color: #" . $member["color"] . "\n\n"); + } + + $sr = hexdec(substr($member["color"], 0, 2)); + $sg = hexdec(substr($member["color"], 2, 2)); + $sb = hexdec(substr($member["color"], 4, 2)); + + $differencesAll = []; + + foreach ($palettes["list"] as $id => $palette) { + $colors = [ + ...explode(",", $palette["dark"]), + ...explode(",", $palette["light"]) + ]; + + $importantColors = [ + $colors[5], + $colors[9], + $colors[15], + $colors[19] + ]; + $differences = []; + + if (isset($_GET["debug"])) echo("Palette " . $id . ": " . implode(", ", array_map(function ($i) { return "#$i"; }, $importantColors)) . "\n"); + + foreach ($importantColors as $color) { + $r = hexdec(substr($color, 0, 2)); + $g = hexdec(substr($color, 2, 2)); + $b = hexdec(substr($color, 4, 2)); + + $dr = abs($r - $sr); + $dg = abs($g - $sg); + $db = abs($b - $sb); + + $differences[] = $dr + $dg + $db; + } + + $total = array_reduce($differences, function ($a, $b) { return $a + $b; }) / count($differences); + + if (isset($_GET["debug"])) { + echo(" " . implode(", ", $differences) . "\n"); + echo(" " . $total . "\n\n"); + } + + $differencesAll[] = [ + "id" => $id, + "difference" => $total + ]; + } + + usort($differencesAll, function ($a, $b) { + return $a["difference"] - $b["difference"]; + }); + + if (isset($_GET["debug"])) { + echo("Smaller: " . $differencesAll[0]["id"] . ", " . $differencesAll[0]["difference"]); + } + + $selectedPalette = $differencesAll[0]["id"]; + + if (isset($_GET["debug"])) { + echo(""); + die(); + } + } + + global $userPalette; + $userPalette = $palettes["list"][$selectedPalette]; + + function rgb($color) { + return hexdec(substr($color, 0, 2)) . "," . hexdec(substr($color, 2, 2)) . "," . hexdec(substr($color, 4, 2)); + } + + function icon($name, $dark = null, $body = false) { + global $userPalette; + + if (isset($dark)) { + return "/assets/icons/new/" . $name . ".svg?color=" . explode(",", $userPalette[$dark ? "dark" : "light"])[$body ? 6 : 9]; + } else { + return "/assets/icons/new/" . $name . ".svg?color=" . explode(",", $userPalette[isset($_COOKIE["new2023UIDarkMode"]) && $_COOKIE["new2023UIDarkMode"] === "yes" ? "dark" : "light"])[$body ? 6 : 9]; + } + } + + foreach ([ "dark", "light" ] as $theme) { $palette = explode(",", $userPalette[$theme]); ?> + + + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/includes/components/mobilenav.inc b/includes/components/mobilenav.inc index 7b49434..e42e9ab 100644 --- a/includes/components/mobilenav.inc +++ b/includes/components/mobilenav.inc @@ -1,4 +1,4 @@ - +
\ No newline at end of file + + \ No newline at end of file diff --git a/includes/components/navigation.inc b/includes/components/navigation.inc index 1761937..1d24dea 100644 --- a/includes/components/navigation.inc +++ b/includes/components/navigation.inc @@ -1,444 +1,448 @@ "raindrops", - "id" => "gdapd" - ], - [ - "name" => "cloudburst", - "id" => "ynmuc" - ], - [ - "name" => "other", - "id" => $app["other"]["id"] - ] -] as $cacheSystem) { - if (!isset($cache[$cacheSystem["name"]]["public"])) { - $isLoggedInOldState = $isLoggedIn; - $isLowerLoggedInOldState = $isLowerLoggedIn; + if (!isset($cache["raindrops"])) $cache["raindrops"] = []; + if (!isset($cache["cloudburst"])) $cache["cloudburst"] = []; + if (!isset($cache["other"])) $cache["other"] = []; - $isLoggedIn = false; - $isLowerLoggedIn = false; - - $cache[$cacheSystem["name"]]["public"] = array_map(function ($member) { - return [ - "name" => $member['display_name'] ?? $member['name'], - "icon" => getAsset($member["system"], $member["id"], "heads"), - "invert" => false, - "link" => "/$member[name]", - "stepped" => null, - "private" => false - ]; - }, array_filter(scoreOrder(withTravelers(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$cacheSystem[id]/members.json"), true), "$cacheSystem[id]"), "$cacheSystem[id]"), function ($member) { - return $member['name'] !== "unknown" && $member['name'] !== "fusion" && $member['name'] !== "new"; - })); - - $isLoggedIn = $isLoggedInOldState; - $isLowerLoggedIn = $isLowerLoggedInOldState; - } + foreach ([ + [ + "name" => "raindrops", + "id" => "gdapd" + ], + [ + "name" => "cloudburst", + "id" => "ynmuc" + ], + [ + "name" => "other", + "id" => $app["other"]["id"] + ] + ] as $cacheSystem) { + if (!isset($cache[$cacheSystem["name"]]["public"])) { + $isLoggedInOldState = $isLoggedIn; + $isLowerLoggedInOldState = $isLowerLoggedIn; - if (!isset($cache[$cacheSystem["name"]]["private"])) { - $isLoggedInOldState = $isLoggedIn; - $isLowerLoggedInOldState = $isLowerLoggedIn; + $isLoggedIn = false; + $isLowerLoggedIn = false; - $isLoggedIn = true; - $isLowerLoggedIn = false; + $cache[$cacheSystem["name"]]["public"] = array_map(function ($member) { + return [ + "name" => $member['display_name'] ?? $member['name'], + "icon" => getAsset($member["system"], $member["id"], "heads"), + "invert" => false, + "link" => "/$member[name]", + "stepped" => null, + "private" => false + ]; + }, array_filter(scoreOrder(withTravelers(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$cacheSystem[id]/members.json"), true), "$cacheSystem[id]"), "$cacheSystem[id]"), function ($member) { + return $member['name'] !== "unknown" && $member['name'] !== "fusion" && $member['name'] !== "new"; + })); - $cache[$cacheSystem["name"]]["private"] = array_map(function ($member) { - return [ - "name" => $member['display_name'] ?? $member['name'], - "icon" => getAsset($member["system"], $member["id"], "heads"), - "invert" => false, - "link" => "/$member[name]", - "stepped" => null, - "private" => false - ]; - }, array_filter(scoreOrder(withTravelers(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$cacheSystem[id]/members.json"), true), "$cacheSystem[id]"), "$cacheSystem[id]"), function ($member) { - return $member['name'] !== "unknown" && $member['name'] !== "fusion" && $member['name'] !== "new"; - })); + $isLoggedIn = $isLoggedInOldState; + $isLowerLoggedIn = $isLowerLoggedInOldState; + } - $isLoggedIn = $isLoggedInOldState; - $isLowerLoggedIn = $isLowerLoggedInOldState; - } -} + if (!isset($cache[$cacheSystem["name"]]["private"])) { + $isLoggedInOldState = $isLoggedIn; + $isLowerLoggedInOldState = $isLowerLoggedIn; -file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/navigation.json", json_encode($cache)); + $isLoggedIn = true; + $isLowerLoggedIn = false; -$navigation_admin = [ - "admin" => !$isLowerLoggedIn, - "name" => "Private utilities", - "icon" => "/assets/icons/admin.svg", - "invert" => true, - "items" => [ - "alerts" => [ - "name" => null, - "minimal" => true, - "items" => [ - [ - "name" => $pages["emergency"]["name"][$lang["_name"]], - "icon" => "/assets/icons/emergency.svg", + $cache[$cacheSystem["name"]]["private"] = array_map(function ($member) { + return [ + "name" => $member['display_name'] ?? $member['name'], + "icon" => getAsset($member["system"], $member["id"], "heads"), "invert" => false, - "link" => "/-/emergency", - "stepped" => null, - "private" => false - ], - [ - "name" => $pages["wakeup"]["name"][$lang["_name"]], - "icon" => "/assets/icons/wakeup.svg", - "invert" => false, - "link" => "/-/wakeup", - "stepped" => null, - "private" => true - ], - [ - "name" => $pages["pleasure"]["name"][$lang["_name"]], - "icon" => "/assets/icons/pleasure.svg", - "invert" => false, - "link" => "/-/pleasure", + "link" => "/$member[name]", "stepped" => null, "private" => false + ]; + }, array_filter(scoreOrder(withTravelers(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$cacheSystem[id]/members.json"), true), "$cacheSystem[id]"), "$cacheSystem[id]"), function ($member) { + return $member['name'] !== "unknown" && $member['name'] !== "fusion" && $member['name'] !== "new"; + })); + + $isLoggedIn = $isLoggedInOldState; + $isLowerLoggedIn = $isLowerLoggedInOldState; + } + } + + file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/navigation.json", json_encode($cache)); + + $navigation_admin = [ + "admin" => !$isLowerLoggedIn, + "name" => "Private utilities", + "icon" => "/assets/icons/admin.svg", + "invert" => true, + "items" => [ + "alerts" => [ + "name" => null, + "minimal" => true, + "items" => [ + [ + "name" => $pages["emergency"]["name"][$lang["_name"]], + "icon" => "/assets/icons/emergency.svg", + "invert" => false, + "link" => "/-/emergency", + "stepped" => null, + "private" => false + ], + [ + "name" => $pages["wakeup"]["name"][$lang["_name"]], + "icon" => "/assets/icons/wakeup.svg", + "invert" => false, + "link" => "/-/wakeup", + "stepped" => null, + "private" => true + ], + [ + "name" => $pages["pleasure"]["name"][$lang["_name"]], + "icon" => "/assets/icons/pleasure.svg", + "invert" => false, + "link" => "/-/pleasure", + "stepped" => null, + "private" => false + ] ] - ] - ], - "apps" => [ - "name" => $lang["navigation"]["apps"], - "minimal" => false, - "items" => [ - time() >= 1686787200 ? null : [ - "name" => "Front plannerEOL", - "icon" => "/assets/icons/fronting.svg", - "invert" => true, - "link" => "/-/fronting", - "stepped" => null, - "private" => false - ], - [ - "name" => $pages["evening"]["name"][$lang["_name"]] . (time() >= 1686787200 ? "" : "Beta"), - "icon" => "/assets/icons/evening.svg", - "invert" => true, - "link" => "/-/evening", - "stepped" => null, - "private" => false - ], - [ - "name" => $pages["profiles"]["name"][$lang["_name"]], - "icon" => "/assets/icons/profiles.svg", - "invert" => true, - "link" => "/-/profiles", - "stepped" => null, - "private" => false - ], - [ - "name" => $pages["money"]["name"][$lang["_name"]], - "icon" => "/assets/icons/money.svg", - "invert" => true, - "link" => "/-/money", - "stepped" => null, - "private" => true - ], - [ - "name" => $pages["contacts"]["name"][$lang["_name"]], - "icon" => "/assets/icons/contacts.svg", - "invert" => true, - "link" => "/-/contacts", - "stepped" => null, - "private" => true - ], - [ - "name" => $pages["schedules"]["name"][$lang["_name"]], - "icon" => "/assets/icons/schedules.svg", - "invert" => true, - "link" => "/-/schedules", - "stepped" => null, - "private" => false - ], - [ - "name" => $pages["docs"]["name"][$lang["_name"]], - "icon" => "/assets/icons/docs.svg", - "invert" => true, - "link" => "/-/docs", - "stepped" => null, - "private" => true - ], - time() >= 1688169600 ? null : [ - "name" => "DevicesEOL", - "icon" => "/assets/icons/computers.svg", - "invert" => true, - "link" => "/-/computers", - "stepped" => null, - "private" => true - ], - [ - "name" => $pages["travelling"]["name"][$lang["_name"]], - "icon" => "/assets/icons/travelling.svg", - "invert" => true, - "link" => "/-/travelling", - "stepped" => null, - "private" => false - ], - [ - "name" => $pages["stats"]["name"][$lang["_name"]], - "icon" => "/assets/icons/stats.svg", - "invert" => true, - "link" => "/-/stats", - "stepped" => null, - "private" => true - ], - [ - "name" => $pages["pair"]["name"][$lang["_name"]], - "icon" => "/assets/icons/pair.svg", - "invert" => true, - "link" => "/-/pair", - "stepped" => null, - "private" => true - ], - [ - "name" => $pages["sessions"]["name"][$lang["_name"]], - "icon" => "/assets/icons/sessions.svg", - "invert" => true, - "link" => "/-/sessions", - "stepped" => null, - "private" => true - ], - [ - "name" => $pages["logout"]["name"][$lang["_name"]], - "icon" => "/assets/icons/logout.svg", - "invert" => true, - "link" => "/-/logout", - "stepped" => null, - "private" => false + ], + "apps" => [ + "name" => $lang["navigation"]["apps"], + "minimal" => false, + "items" => [ + time() >= 1686787200 ? null : [ + "name" => "Front plannerEOL", + "icon" => "/assets/icons/fronting.svg", + "invert" => true, + "link" => "/-/fronting", + "stepped" => null, + "private" => false + ], + [ + "name" => $pages["evening"]["name"][$lang["_name"]] . (time() >= 1686787200 ? "" : "Beta"), + "icon" => "/assets/icons/evening.svg", + "invert" => true, + "link" => "/-/evening", + "stepped" => null, + "private" => false + ], + [ + "name" => $pages["profiles"]["name"][$lang["_name"]], + "icon" => "/assets/icons/profiles.svg", + "invert" => true, + "link" => "/-/profiles", + "stepped" => null, + "private" => false + ], + [ + "name" => $pages["money"]["name"][$lang["_name"]], + "icon" => "/assets/icons/money.svg", + "invert" => true, + "link" => "/-/money", + "stepped" => null, + "private" => true + ], + [ + "name" => $pages["contacts"]["name"][$lang["_name"]], + "icon" => "/assets/icons/contacts.svg", + "invert" => true, + "link" => "/-/contacts", + "stepped" => null, + "private" => true + ], + [ + "name" => $pages["schedules"]["name"][$lang["_name"]], + "icon" => "/assets/icons/schedules.svg", + "invert" => true, + "link" => "/-/schedules", + "stepped" => null, + "private" => false + ], + [ + "name" => $pages["docs"]["name"][$lang["_name"]], + "icon" => "/assets/icons/docs.svg", + "invert" => true, + "link" => "/-/docs", + "stepped" => null, + "private" => true + ], + time() >= 1688169600 ? null : [ + "name" => "DevicesEOL", + "icon" => "/assets/icons/computers.svg", + "invert" => true, + "link" => "/-/computers", + "stepped" => null, + "private" => true + ], + [ + "name" => $pages["travelling"]["name"][$lang["_name"]], + "icon" => "/assets/icons/travelling.svg", + "invert" => true, + "link" => "/-/travelling", + "stepped" => null, + "private" => false + ], + [ + "name" => $pages["stats"]["name"][$lang["_name"]], + "icon" => "/assets/icons/stats.svg", + "invert" => true, + "link" => "/-/stats", + "stepped" => null, + "private" => true + ], + [ + "name" => $pages["pair"]["name"][$lang["_name"]], + "icon" => "/assets/icons/pair.svg", + "invert" => true, + "link" => "/-/pair", + "stepped" => null, + "private" => true + ], + [ + "name" => $pages["sessions"]["name"][$lang["_name"]], + "icon" => "/assets/icons/sessions.svg", + "invert" => true, + "link" => "/-/sessions", + "stepped" => null, + "private" => true + ], + [ + "name" => $pages["logout"]["name"][$lang["_name"]], + "icon" => "/assets/icons/logout.svg", + "invert" => true, + "link" => "/-/logout", + "stepped" => null, + "private" => false + ] + ] + ], + "sort" => [ + "name" => "Sorted members lists", + "minimal" => false, + "items" => [ + [ + "name" => $pages["splitting"]["name"][$lang["_name"]], + "icon" => "/assets/icons/splitting.svg", + "invert" => true, + "link" => "/-/splitting", + "stepped" => null, + "private" => false + ], + [ + "name" => $pages["byfront"]["name"][$lang["_name"]], + "icon" => "/assets/icons/byfront.svg", + "invert" => true, + "link" => "/-/byfront", + "stepped" => null, + "private" => false + ], + [ + "name" => $pages["alphabet"]["name"][$lang["_name"]], + "icon" => "/assets/icons/alphabet.svg", + "invert" => true, + "link" => "/-/alphabet", + "stepped" => null, + "private" => false + ], + [ + "name" => $pages["s:species"]["name"][$lang["_name"]], + "icon" => "/assets/icons/species.svg", + "invert" => true, + "link" => "/-/byspecies", + "stepped" => null, + "private" => false + ], ] - ] - ], - "sort" => [ - "name" => "Sorted members lists", - "minimal" => false, - "items" => [ - [ - "name" => $pages["splitting"]["name"][$lang["_name"]], - "icon" => "/assets/icons/splitting.svg", - "invert" => true, - "link" => "/-/splitting", - "stepped" => null, - "private" => false - ], - [ - "name" => $pages["byfront"]["name"][$lang["_name"]], - "icon" => "/assets/icons/byfront.svg", - "invert" => true, - "link" => "/-/byfront", - "stepped" => null, - "private" => false - ], - [ - "name" => $pages["alphabet"]["name"][$lang["_name"]], - "icon" => "/assets/icons/alphabet.svg", - "invert" => true, - "link" => "/-/alphabet", - "stepped" => null, - "private" => false - ], - [ - "name" => $pages["s:species"]["name"][$lang["_name"]], - "icon" => "/assets/icons/species.svg", - "invert" => true, - "link" => "/-/byspecies", - "stepped" => null, - "private" => false - ], ] ] - ] -]; -$navigation_global = [ - "admin" => false, - "name" => $lang["navigation"]["general"], - "icon" => "/assets/icons/global.svg", - "invert" => true, - "items" => [ - "main" => [ - "name" => null, - "minimal" => false, - "items" => [ - [ - "name" => $pages["home"]["name"][$lang["_name"]], - "icon" => "/assets/icons/home.svg", - "invert" => true, - "link" => "/", - "stepped" => null, - "private" => false - ], - [ - "name" => $pages["relations"]["name"][$lang["_name"]], - "icon" => "/assets/icons/relations.svg", - "invert" => true, - "link" => "/-/relations", - "stepped" => null, - "private" => false - ], - [ - "name" => $pages["terminology"]["name"][$lang["_name"]], - "icon" => "/assets/icons/terminology.svg", - "invert" => true, - "link" => "/-/terminology", - "stepped" => null, - "private" => false + ]; + $navigation_global = [ + "admin" => false, + "name" => $lang["navigation"]["general"], + "icon" => "/assets/icons/global.svg", + "invert" => true, + "items" => [ + "main" => [ + "name" => null, + "minimal" => false, + "items" => [ + [ + "name" => $pages["home"]["name"][$lang["_name"]], + "icon" => "/assets/icons/home.svg", + "invert" => true, + "link" => "/", + "stepped" => null, + "private" => false + ], + [ + "name" => $pages["relations"]["name"][$lang["_name"]], + "icon" => "/assets/icons/relations.svg", + "invert" => true, + "link" => "/-/relations", + "stepped" => null, + "private" => false + ], + [ + "name" => $pages["terminology"]["name"][$lang["_name"]], + "icon" => "/assets/icons/terminology.svg", + "invert" => true, + "link" => "/-/terminology", + "stepped" => null, + "private" => false + ] ] ] ] - ] -]; -$navigation_cloudburst = [ - "admin" => false, - "name" => "Cloudburst System", - "icon" => getAsset("ynmuc"), - "invert" => false, - "items" => [ - "header" => [ - "name" => null, - "minimal" => false, - "items" => [ - [ - "name" => $lang["navigation"]["about"], - "icon" => "/assets/icons/about.svg", - "invert" => true, - "link" => "/cloudburst", - "stepped" => null, - "private" => false - ], - [ - "name" => $pages["s:history"]["name"][$lang["_name"]], - "icon" => "/assets/icons/history.svg", - "invert" => true, - "link" => "/cloudburst/-/history", - "stepped" => null, - "private" => false + ]; + $navigation_cloudburst = [ + "admin" => false, + "name" => "Cloudburst System", + "icon" => getAsset("ynmuc"), + "invert" => false, + "items" => [ + "header" => [ + "name" => null, + "minimal" => false, + "items" => [ + [ + "name" => $lang["navigation"]["about"], + "icon" => "/assets/icons/about.svg", + "invert" => true, + "link" => "/cloudburst", + "stepped" => null, + "private" => false + ], + [ + "name" => $pages["s:history"]["name"][$lang["_name"]], + "icon" => "/assets/icons/history.svg", + "invert" => true, + "link" => "/cloudburst/-/history", + "stepped" => null, + "private" => false + ] ] + ], + "members" => [ + "name" => $lang["navigation"]["members"], + "minimal" => false, + "items" => $cache["cloudburst"][$isLoggedIn || $isLowerLoggedIn ? "private" : "public"] ] - ], - "members" => [ - "name" => $lang["navigation"]["members"], - "minimal" => false, - "items" => $cache["cloudburst"][$isLoggedIn || $isLowerLoggedIn ? "private" : "public"] ] - ] -]; -$navigation_other = [ - "admin" => !$isLowerLoggedIn, - "name" => $app["other"]["name"], - "icon" => getAsset($app["other"]["id"]), - "invert" => false, - "items" => [ - "header" => [ - "name" => null, - "minimal" => false, - "items" => [ - [ - "name" => $lang["navigation"]["about"], - "icon" => "/assets/icons/about.svg", - "invert" => true, - "link" => "/" . $app["other"]["slug"], - "stepped" => null, - "private" => false - ], - [ - "name" => $pages["s:history"]["name"][$lang["_name"]], - "icon" => "/assets/icons/history.svg", - "invert" => true, - "link" => "/" . $app["other"]["slug"] . "/-/history", - "stepped" => null, - "private" => false + ]; + $navigation_other = [ + "admin" => !$isLowerLoggedIn, + "name" => $app["other"]["name"], + "icon" => getAsset($app["other"]["id"]), + "invert" => false, + "items" => [ + "header" => [ + "name" => null, + "minimal" => false, + "items" => [ + [ + "name" => $lang["navigation"]["about"], + "icon" => "/assets/icons/about.svg", + "invert" => true, + "link" => "/" . $app["other"]["slug"], + "stepped" => null, + "private" => false + ], + [ + "name" => $pages["s:history"]["name"][$lang["_name"]], + "icon" => "/assets/icons/history.svg", + "invert" => true, + "link" => "/" . $app["other"]["slug"] . "/-/history", + "stepped" => null, + "private" => false + ] ] + ], + "members" => [ + "name" => $lang["navigation"]["members"], + "minimal" => false, + "items" => $cache["other"][$isLoggedIn || $isLowerLoggedIn ? "private" : "public"] ] - ], - "members" => [ - "name" => $lang["navigation"]["members"], - "minimal" => false, - "items" => $cache["other"][$isLoggedIn || $isLowerLoggedIn ? "private" : "public"] ] - ] -]; -$navigation_raindrops = [ - "admin" => false, - "name" => "Raindrops System", - "icon" => getAsset("gdapd"), - "invert" => false, - "items" => [ - "header" => [ - "name" => null, - "minimal" => false, - "items" => [ - [ - "name" => $lang["navigation"]["about"], - "icon" => "/assets/icons/about.svg", - "invert" => true, - "link" => "/raindrops", - "stepped" => null, - "private" => false - ], - [ - "name" => $pages["s:history"]["name"][$lang["_name"]], - "icon" => "/assets/icons/history.svg", - "invert" => true, - "link" => "/raindrops/-/history", - "stepped" => null, - "private" => false + ]; + $navigation_raindrops = [ + "admin" => false, + "name" => "Raindrops System", + "icon" => getAsset("gdapd"), + "invert" => false, + "items" => [ + "header" => [ + "name" => null, + "minimal" => false, + "items" => [ + [ + "name" => $lang["navigation"]["about"], + "icon" => "/assets/icons/about.svg", + "invert" => true, + "link" => "/raindrops", + "stepped" => null, + "private" => false + ], + [ + "name" => $pages["s:history"]["name"][$lang["_name"]], + "icon" => "/assets/icons/history.svg", + "invert" => true, + "link" => "/raindrops/-/history", + "stepped" => null, + "private" => false + ] ] + ], + "members" => [ + "name" => $lang["navigation"]["members"], + "minimal" => false, + "items" => $cache["raindrops"][$isLoggedIn || $isLowerLoggedIn ? "private" : "public"] ] - ], - "members" => [ - "name" => $lang["navigation"]["members"], - "minimal" => false, - "items" => $cache["raindrops"][$isLoggedIn || $isLowerLoggedIn ? "private" : "public"] ] - ] -]; + ]; -global $parts; + global $parts; -if (isset($parts) && isset($parts[0]) && $parts[0] === $app["other"]["slug"]) { - $navigation = [ - "other" => $navigation_other, - "cloudburst" => $navigation_cloudburst, - "raindrops" => $navigation_raindrops, - "admin" => $navigation_admin, - "global" => $navigation_global - ]; -} elseif (isset($parts) && isset($parts[0]) && $parts[0] === "cloudburst") { - $navigation = [ - "cloudburst" => $navigation_cloudburst, - "raindrops" => $navigation_raindrops, - "other" => $navigation_other, - "admin" => $navigation_admin, - "global" => $navigation_global - ]; -} elseif (isset($parts) && isset($parts[0]) && $parts[0] === "raindrops") { - $navigation = [ - "raindrops" => $navigation_raindrops, - "cloudburst" => $navigation_cloudburst, - "other" => $navigation_other, - "admin" => $navigation_admin, - "global" => $navigation_global - ]; -} else { - $navigation = [ - "admin" => $navigation_admin, - "global" => $navigation_global, - "cloudburst" => $navigation_cloudburst, - "raindrops" => $navigation_raindrops, - "other" => $navigation_other, - ]; + if (isset($parts) && isset($parts[0]) && $parts[0] === $app["other"]["slug"]) { + $navigation = [ + "other" => $navigation_other, + "cloudburst" => $navigation_cloudburst, + "raindrops" => $navigation_raindrops, + "admin" => $navigation_admin, + "global" => $navigation_global + ]; + } elseif (isset($parts) && isset($parts[0]) && $parts[0] === "cloudburst") { + $navigation = [ + "cloudburst" => $navigation_cloudburst, + "raindrops" => $navigation_raindrops, + "other" => $navigation_other, + "admin" => $navigation_admin, + "global" => $navigation_global + ]; + } elseif (isset($parts) && isset($parts[0]) && $parts[0] === "raindrops") { + $navigation = [ + "raindrops" => $navigation_raindrops, + "cloudburst" => $navigation_cloudburst, + "other" => $navigation_other, + "admin" => $navigation_admin, + "global" => $navigation_global + ]; + } else { + $navigation = [ + "admin" => $navigation_admin, + "global" => $navigation_global, + "cloudburst" => $navigation_cloudburst, + "raindrops" => $navigation_raindrops, + "other" => $navigation_other, + ]; + } } \ No newline at end of file diff --git a/includes/components/pane.inc b/includes/components/pane.inc index 1ecbcdf..a4b2d43 100644 --- a/includes/components/pane.inc +++ b/includes/components/pane.inc @@ -1,4 +1,4 @@ - +
members 0) { - echo(" (+ " . count($travellers) . " " . (count($travellers) > 1 ? $lang["system"]["traveller"] : $lang["system"]["travellers"]) . ")"); + echo(" (+ " . count($travellers) . " " . (count($travellers) > 1 ? $lang["system"]["travellers"] : $lang["system"]["traveller"]) . ")"); } - ?> - - - - + ?>
0): ?>Leader 1 ? "s" : "" ?>: $leader): ?>" class="member-link">"> +
diff --git a/includes/flags.json b/includes/flags.json index 6855dc5..a6373e6 100644 --- a/includes/flags.json +++ b/includes/flags.json @@ -6,7 +6,8 @@ "median": null, "protector": "!!Protector", - "leader": "Leader", + "leader": "Leader (legacy)", + "leader2": "Leader", "fictive": "!!Equestrian", "fictive2": "Fictive (Celeste)", "sexual_features": "Enable sexual features (for ponies below 15)", diff --git a/includes/fragments/evening.inc b/includes/fragments/evening.inc new file mode 100644 index 0000000..851b69f --- /dev/null +++ b/includes/fragments/evening.inc @@ -0,0 +1,245 @@ + 0) { + $thisIndex = array_search($thisMember[0], $switches); + + $frontingStart = $thisMember[0]; + $frontingEnd = $switches[$thisIndex - 1]; + } + + if ($frontingEnd !== null && isset($frontingStart)) { + $i["_lastFronted"] = strtotime($frontingEnd["timestamp"]); + } + } + + return $i; + }, array_values(array_filter(scoreOrderGlobal(), function ($i) { + return $i["_system"] === "ynmuc"; + }))), + ...array_map(function ($i) { + $system = "gdapd"; + $i["_lastFronted"] = -1; + $id = $i["id"]; + $memberData = $i; + + $fronters = array_map(function ($item) { + return $item["id"]; + }, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/fronters.json"), true)["members"]); + + if (in_array($id, $fronters)) { + $i["_lastFronted"] = time(); + } else { + $switches = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/switches.json"), true); + + $thisMember = array_filter($switches, function ($item) use ($memberData) { + return in_array($memberData["id"], $item["members"]); + }); + + $thisMember = array_values($thisMember); + $frontingEnd = null; + + if (count($thisMember) > 0) { + $thisIndex = array_search($thisMember[0], $switches); + + $frontingStart = $thisMember[0]; + $frontingEnd = $switches[$thisIndex - 1]; + } + + if ($frontingEnd !== null && isset($frontingStart)) { + $i["_lastFronted"] = strtotime($frontingEnd["timestamp"]); + } + } + + return $i; + }, array_values(array_filter(scoreOrderGlobal(), function ($i) { + return $i["_system"] === "gdapd"; + }))) + ]; global $pages; global $lang; global $use2023UI; global $ignored; ?> + + + +
+
+ +

Evening schedule

+ +

Evening schedule

+ + + +
+ The evening schedule will replace the fronting schedule starting June 15th. The fronting schedule page contains more information and shows the schedule up to that date. The evening schedule is experimental until then. +
+ + +
+ +

Click on the "Ignore" button to mark an evening as ignored and shift the schedule one day after. You can revert this by clicking on "Unignore".

+
+
    + 0) $times[] = getLastFronted($members, $id); + } + foreach ($a[1] as $id) { + if (getLastFronted($members, $id) > 0) $times[] = getLastFronted($members, $id); + } + + $timeA = time() - min($times); + $times = []; + + foreach ($b[0] as $id) { + if (getLastFronted($members, $id) > 0) $times[] = getLastFronted($members, $id); + } + foreach ($b[1] as $id) { + if (getLastFronted($members, $id) > 0) $times[] = getLastFronted($members, $id); + } + + $timeB = time() - min($times); + + return $timeB - $timeA; + }); $pairs = array_values($pairs); foreach ($pairs as $pair): $times = []; ?> +
  • + + "> + + with + + "> + + () +
  • + +
+
+ + = 1686787200): ?> + +
+ +

+ +
+
+
+ + ">">
+ +
+
+
+
+ + ">">
+ +
+
+
+ 0) $times[] = getLastFronted($members, $id); + } + foreach ($pair[1] as $id) { + if (getLastFronted($members, $id) > 0) $times[] = getLastFronted($members, $id); + } + + $time = time() - min($times); + echo(timeAgo(time() - $time)); + + ?> +
+ +
+ " : "" ?> + +
+
+ \ No newline at end of file diff --git a/includes/fragments/member.inc b/includes/fragments/member.inc index 9ebb4c2..7672529 100644 --- a/includes/fragments/member.inc +++ b/includes/fragments/member.inc @@ -79,8 +79,8 @@ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/ponies/" . $memberID . ".pn diff --git a/includes/pages.json b/includes/pages.json index 9cb2bf5..fd4aae1 100644 --- a/includes/pages.json +++ b/includes/pages.json @@ -1,4 +1,18 @@ { + "account": { + "name": { + "en": "Account and security" + }, + "admin": true, + "limited": true + }, + "alerts": { + "name": { + "en": "Alerts" + }, + "admin": true, + "limited": true + }, "alphabet": { "name": { "en": "By prefix letters" @@ -90,6 +104,13 @@ "admin": true, "limited": true }, + "lists": { + "name": { + "en": "Member lists" + }, + "admin": true, + "limited": true + }, "login": { "name": { "en": "Login" diff --git a/includes/themes.json b/includes/themes.json new file mode 100644 index 0000000..b1af209 --- /dev/null +++ b/includes/themes.json @@ -0,0 +1,69 @@ +{ + "default": 8, + "list": [ + { + "light": "fefbff,f4f2f9,eeeef5,eaeaf3,e8e8f2,e4e5ef,44474f,1b1b1f,ffffff,435e91", + "dark": "1b1b1f,22232a,272931,2a2d36,2c2f39,2f323d,c4c6d0,e3e2e6,0f2f60,adc7ff" + }, + { + "light": "fbfdf8,f0f5ef,e9f0e9,e4ede5,e1ebe3,dde8e0,404943,191c1a,ffffff,266a4a", + "dark": "191c1a,1f2521,222b26,252f29,27312b,29352e,c0c9c1,e1e3df,003822,91d5ad" + }, + { + "light": "fffbff,f6f2f9,f1edf5,ede9f3,ebe7f2,e8e4ef,47464f,1c1b1f,ffffff,5d5791", + "dark": "1c1b1f,24232a,2a2831,2e2c36,302e39,33313d,c9c5d0,e5e1e6,2f295f,c7bfff" + }, + { + "light": "fffbff,f8f2f3,f4edeb,f1e9e6,f0e7e3,ede4de,504539,1f1b16,ffffff,825514", + "dark": "1f1b16,2a231a,30281d,352b1f,382d20,3c3022,d4c4b5,ebe1d9,472a00,f8bb71" + }, + { + "light": "fcfcfc,f7f2f2,f4eced,f1e8e9,f0e5e6,eee2e3,474747,1b1b1b,ffffff,9c4049", + "dark": "1b1b1b,262222,2d2727,332b2b,352c2d,3a2f30,c6c6c6,e2e2e2,5f121e,ffb3b6" + }, + { + "light": "fcfcfc,f6f3ef,f2eee7,efeae1,eee8de,ece4d9,474747,1b1b1b,ffffff,885200", + "dark": "1b1b1b,26231e,2d2721,332b23,352d24,3a3025,c6c6c6,e2e2e2,482900,ffb869" + }, + { + "light": "fcfcfc,f5f3ef,f0eee7,edebe1,ebe9de,e9e6d9,474747,1b1b1b,ffffff,735c00", + "dark": "1b1b1b,25231d,2b281e,302c1f,332e20,373221,c6c6c6,e2e2e2,3c2f00,e8c349" + }, + { + "light": "fcfcfc,f2f4f0,ecefe9,e7ece4,e5eae1,e1e7dd,474747,1b1b1b,ffffff,3b6a1c", + "dark": "1b1b1b,21241f,252a22,292e25,2a3026,2d3428,c6c6c6,e2e2e2,163800,a0d57b" + }, + { + "light": "fcfcfc,eff4f7,e7eff4,e1ebf1,deeaf0,d9e7ee,474747,1b1b1b,ffffff,00639b", + "dark": "1b1b1b,212326,25292d,282d33,292f35,2c333a,c6c6c6,e2e2e2,003353,97cbff" + }, + { + "light": "fcfcfc,f4f3f7,efeef4,ebeaf2,e9e8f1,e6e4f0,474747,1b1b1b,ffffff,6152a6", + "dark": "1b1b1b,232326,29282d,2d2c33,2f2e35,33313a,c6c6c6,e2e2e2,322075,cabeff" + }, + { + "light": "fcfcfc,f5f2f6,f2edf2,efe8f0,ede6ee,ebe3ec,474747,1b1b1b,ffffff,84468d", + "dark": "1b1b1b,262226,2d272d,322a32,342c35,392f3a,c6c6c6,e2e2e2,50145b,f7adfd" + }, + { + "light": "fffbff,f9f1f2,f6eceb,f3e8e5,f2e5e3,f0e2de,4e472a,1f1b0d,ffffff,974811", + "dark": "1f1b0d,2a2213,312717,362b1a,392d1c,3d301e,d2c6a1,ebe2cb,542200,ffb68e" + }, + { + "light": "fafeea,f3f5de,eff0d6,ececd1,ebeace,e8e7c9,414a33,191d11,ffffff,7d5700", + "dark": "191d11,242513,2b2a15,302d16,332f17,373218,c0caac,e0e5d1,422c00,f9bc49" + }, + { + "light": "f9fdff,ecf5f6,e4f1f0,deedec,dbebea,d6e9e7,344a52,121d21,ffffff,006c51", + "dark": "121d21,162628,182c2c,1a3130,1b3332,1d3734,b3cad3,d8e4ea,003829,66dbb2" + }, + { + "light": "fffbff,f2f3fa,eaeef7,e4eaf5,e1e8f4,dce5f2,4b4358,1e1a24,ffffff,0061a3", + "dark": "1e1a24,24222f,282836,2b2c3b,2d2e3d,2f3242,cdc2db,e8dfee,003258,9ecaff" + }, + { + "light": "fffbff,f7f2fa,f2edf7,eee9f5,ece7f4,e9e3f2,58404d,24181f,ffffff,6351a5", + "dark": "24181f,2c202a,312531,352936,372b39,3b2e3d,debecd,f3dde6,341f74,ccbdff" + } + ] +} \ No newline at end of file diff --git a/includes/util/banner.inc b/includes/util/banner.inc index dfda86d..63e30c6 100644 --- a/includes/util/banner.inc +++ b/includes/util/banner.inc @@ -24,6 +24,7 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { global $isLowerLoggedIn; global $lang; global $Parsedown; + global $use2023UI; $french = $lang["_french"]; @@ -295,7 +296,7 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { $badges[] = [ "id" => "fictive", "color" => "info", - "html" => ' Equestrian' + "html" => ' Equestrian' ]; } @@ -303,7 +304,7 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { $badges[] = [ "id" => "fictive2", "color" => "d63384", - "html" => ' Fictive' + "html" => ' Fictive' ]; } @@ -311,7 +312,7 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { $badges[] = [ "id" => "persecutor", "color" => "danger", - "html" => 'Persecutor' + "html" => 'Persecutor' ]; } @@ -319,7 +320,7 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { $badges[] = [ "id" => "nonverbal", "color" => "#6610f2", - "html" => 'Fronts less often' + "html" => 'Fronts less often' ]; } @@ -327,7 +328,7 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { $badges[] = [ "id" => "nonverbal", "color" => "#20c997", - "html" => 'Non verbal IRL' + "html" => 'Non verbal IRL' ]; } @@ -335,7 +336,7 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { $badges[] = [ "id" => "fusion", "color" => "333333", - "html" => 'Fusion' + "html" => 'Fusion' ]; } @@ -343,7 +344,7 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { $badges[] = [ "id" => "host", "color" => "fc6735", - "html" => 'Host' + "html" => 'Host' ]; } @@ -351,7 +352,7 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { $badges[] = [ "id" => "leader", "color" => "d6a833", - "html" => 'Leader' + "html" => 'Leader' ]; } @@ -359,7 +360,7 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { $badges[] = [ "id" => "protector", "color" => "black", - "html" => 'Protector' + "html" => 'Protector' ]; } @@ -375,7 +376,7 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { $badges[] = [ "id" => "younger", "color" => "dark", - "html" => 'Younger' + "html" => 'Younger' ]; } @@ -383,7 +384,7 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { $badges[] = [ "id" => "alcohol", "color" => "secondary", - "html" => 'Alcohol' + "html" => 'Alcohol' ]; } diff --git a/includes/util/evening.inc b/includes/util/evening.inc new file mode 100644 index 0000000..58e511e --- /dev/null +++ b/includes/util/evening.inc @@ -0,0 +1,68 @@ +