summaryrefslogtreecommitdiff
path: root/includes/components/header.inc
diff options
context:
space:
mode:
Diffstat (limited to 'includes/components/header.inc')
-rw-r--r--includes/components/header.inc326
1 files changed, 13 insertions, 313 deletions
diff --git a/includes/components/header.inc b/includes/components/header.inc
index 5ab13dc..9409917 100644
--- a/includes/components/header.inc
+++ b/includes/components/header.inc
@@ -1,13 +1,8 @@
<?php global $title; global $pages; global $readOnly;
$start = microtime(true);
-$useNewUI = !isset($_GET['old']);
-$use2023UI = !isset($_GET["no2023"]);
+$use2023UI = $useNewUI = true;
global $use2023UI;
-if (!isset($_COOKIE["new2023UIctaFirstVisit"])) {
- setcookie("new2023UIctaFirstVisit", time(), time() + 86400*365, "/", "", true, true);
-}
-
$isNormallyLoggedIn = false;
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn; global $isUserLoggedIn; global $isLowerLoggedIn;
@@ -19,23 +14,6 @@ if ($readOnly && $isLoggedIn || $readOnly && $isUserLoggedIn) {
$pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pages.json"), true);
-if (!function_exists("error")) {
- function error($errno, $errstr, $file, $line) {
- echo('
- <!-- -->">
- <div class="alert alert-danger" style="text-align: left;">
- <b>Error ' . $errno . ':</b> ' . $errstr . ' [' . $file . ':' . $line . ']
- </div>');
- }
-}
-
-if (isset($_GET['errors'])) {
- ini_set('display_errors', '1');
- ini_set('display_startup_errors', '1');
- error_reporting(E_ALL);
- set_error_handler("error", E_ALL);
-}
-
global $_MemberName;
global $_MemberPage;
global $_SystemName;
@@ -49,11 +27,9 @@ $page = $pages[$toplevel] ?? [
require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/util/travelling.inc"; global $travelling;
require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/util/score.inc";
-require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/util/pronouns.inc";
-require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/util/bitset.inc";
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/functions.inc";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/banner.inc";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/rainbow.inc";
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/functions.inc";
?>
<!doctype html>
@@ -62,184 +38,19 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/functions.inc";
<script>
document.cookie = "new2023UIDarkMode=" + (window.matchMedia("(prefers-color-scheme: dark)").matches ? "yes" : "no") + "; max-age=" + (60*60*24*365) + "; path=/; samesite; secure";
</script>
- <link href="/assets/logo/custom<?= $use2023UI ? "-2023" : "" ?>.css" rel="preload" as="style">
- <link href="/assets/logo/light<?= $use2023UI ? "-2023" : "" ?>.css" rel="preload" as="style">
- <link href="/assets/logo/custom<?= $use2023UI ? "-2023" : "" ?>.css" rel="stylesheet">
+ <link href="/assets/logo/custom-2023.css" rel="preload" as="style">
+ <link href="/assets/logo/light-2023.css" rel="preload" as="style">
+ <link href="/assets/logo/custom-2023.css" rel="stylesheet">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js"></script>
- <title><?= $title && $title !== "-" ? $title . " · " : "" ?>Cold Haze</title>
- <link rel="shortcut icon" href="/assets/logo/<?php if ($use2023UI): ?>newlogo-ng<?php else: ?>newlogo<?= $isLoggedIn || $isLowerLoggedIn ? "3" : "" ?><?php endif; ?>.png" type="image/png">
- <link href="/assets/logo/light<?= $use2023UI ? "-2023" : "" ?>.css" rel="stylesheet">
+ <title><?= $title && $title !== "-" ? $title . " · " : "" ?>Ponycule</title>
+ <link rel="shortcut icon" href="/assets/logo/newlogo-ng.png" type="image/png">
+ <link href="/assets/logo/light-2023.css" rel="stylesheet">
</head>
-<body<?php if (!$use2023UI): ?> style="background-color: #000;"<?php else: ?> style="background-color: var(--palette-1);"<?php endif; ?>>
- <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/components/navigation.inc"; global $navigation; ?>
-
- <?php if (!$useNewUI): ?>
- <div style="margin-top: 60px;" id="top-of-page"></div>
- <?php endif; ?>
-
- <?php if ($useNewUI && !$use2023UI): ?>
- <aside id="navigation-pane">
- <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/components/pane.inc"; ?>
- </aside>
-
- <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/components/mobilenav.inc"; ?>
-
- <style>
- body {
- margin-left: 300px;
- }
-
- .modal.show {
- left: 300px;
- width: calc(100% - 300px);
- }
-
- .modal {
- left: 150px;
- }
-
- nav {
- display: none !important;
- }
-
- #navigation-pane {
- z-index: 9999;
- background: black;
- position: fixed;
- top: 0;
- left: 0;
- bottom: 0;
- width: 300px;
- border-right: 1px solid rgba(255, 255, 255, .25);
- overflow: auto;
- }
-
- #title-bar {
- position: fixed;
- top: 0;
- left: 300px;
- right: 0;
- height: 34px;
- background: rgba(0, 0, 0, .75);
- z-index: 9999;
- padding: 5px;
- text-align: center;
- backdrop-filter: blur(10px);
- -webkit-backdrop-filter: blur(10px);
- border-bottom: 1px solid rgba(255, 255, 255, .25);
- }
-
- #mobile-navigation {
- display: none;
- position: fixed;
- bottom: 0;
- left: 0;
- right: 0;
- height: 48px;
- background: rgba(0, 0, 0, .75);
- backdrop-filter: blur(30px);
- -webkit-backdrop-filter: blur(30px);
- border-top: 1px solid rgba(255, 255, 255, .25);
- z-index: 999999;
- }
-
- @media (max-width: 1360px) {
- .modal.show {
- left: 250px !important;
- width: calc(100% - 250px) !important;
- }
-
- .modal {
- left: 125px !important;
- }
-
- #title-bar {
- left: 250px !important;
- }
-
- #navigation-pane {
- width: 250px !important;
- }
-
- body {
- margin-left: 250px !important;
- }
-
- #system-banner-container, #member-banner-container {
- width: 100% !important;
- }
- }
-
- @media (max-width: 1300px) {
- .modal.show {
- left: 200px !important;
- width: calc(100% - 200px) !important;
- }
-
- .modal {
- left: 100px !important;
- }
-
- #title-bar {
- left: 200px !important;
- }
-
- #navigation-pane {
- width: 200px !important;
- }
-
- body {
- margin-left: 200px !important;
- }
- }
-
- @media (max-width: 1195px) {
- .modal.show {
- left: 0 !important;
- width: 100% !important;
- }
-
- .modal {
- left: 0 !important;
- }
-
- #title-bar {
- left: 0 !important;
- }
-
- #navigation-pane {
- display: none !important;
- }
-
- body {
- margin-left: 0 !important;
- }
-
- #mobile-navigation {
- display: block !important;
- }
- }
-
- @media (max-width: 700px) {
- #title-bar-parts-mobile {
- display: inline !important;
- }
-
- #title-bar-parts-desktop {
- display: none;
- }
-
- #title-bar {
- text-align: left;
- }
- }
- </style>
- <?php endif; ?>
-
- <?php if ($use2023UI) {
+<body style="background-color: var(--palette-1);">
+ <?php
$palettes = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/themes.json"), true);
$selectedPalette = $palettes["default"];
@@ -658,119 +469,8 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/functions.inc";
}
}
</style>
- <?php }
- } ?>
-
- <?php if ($use2023UI): ?>
- <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/components/2023ui.inc"; ?>
- <?php endif; ?>
-
-<?php if (isset($_GET["mini"]) || str_contains($_SERVER["HTTP_USER_AGENT"], "+ColdHazeDesktop")) {
- ?>
- <style>
- #navigation-pane, #title-bar, #footer, #titlebar-separator, #mobile-navigation, #global-search-container {
- display: none !important;
- }
-
- body {
- margin-left: 0 !important;
- }
- </style>
-<?php } if (str_contains($_SERVER["HTTP_USER_AGENT"], "+ColdHazeDesktop")) { ?>
-<style>
- body {
- background: #222 !important;
- }
-
- .container {
- margin-left: 10px;
- margin-right: 10px;
- max-width: calc(100vw - 20px);
- }
-
- h2 {
- display: none;
- }
-</style>
-<?php }
-
-if (
- (($isLoggedIn || $isLowerLoggedIn) && !$use2023UI && isset($_COOKIE["enable2023UIcta"]) && $_COOKIE["enable2023UIcta"] === "yes") ||
- (isset($_COOKIE["force2023UIcta"]) && $_COOKIE["force2023UIcta"] === "yes" && !$use2023UI) ||
- (($isLoggedIn || $isLowerLoggedIn) && isset($_PROFILE) && !$use2023UI)
-) { ?>
- <div class="modal fade" id="new-ui-cta">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-body">
- <img src="/assets/logo/light.svg" style="width: 100%; margin-bottom: 20px;" class="cta-light">
- <img src="/assets/logo/dark.svg" style="width: 100%; margin-bottom: 20px;" class="cta-dark">
- <style>
- @media (prefers-color-scheme: light) {
- .cta-dark {
- display: none;
- }
- }
-
- @media (prefers-color-scheme: dark) {
- .cta-light {
- display: none;
- }
-
- #new-ui-cta .modal-header {
- border-bottom: 1px solid #353738;
- }
-
- #new-ui-cta .modal-content {
- border: 1px solid rgba(255, 255, 255, .2);
- background-color: #111;
- }
- }
- </style>
- <h3 style="text-align: center;">There is more to it</h3>
- <p style="text-align: center;">Cold Haze is getting a new shape. Help us improve it by testing it early before it is made publicly available.</p>
- <p style="text-align: center;">The new design is colorful, clean, modern, simple, fast, and gives you access to what you need the most.</p>
- <div style="text-align: center;"><a class="btn btn-primary" href="/api/2023ui">Try it now</a> <a data-bs-dismiss="modal" onclick="localStorage.setItem('dismissed2023cta', '')" class="btn btn-outline-secondary">Maybe later</a></div>
- <hr>
- <div class="small text-muted">Some features are not available in the new design. <a href="https://bugs.equestria.dev/articles/CH-A-1/New-design-FAQ" target="_blank">Learn more.</a></div>
- <!-- Equestria.dev makes no guarantee whatsoever that, after turning on this experimental feature, Cold Haze will continue working as intended. Access to emergency features might be unavailable while this option is turned on. Temporarily turning it off is possible using the "no2023" URL parameter. -->
- </div>
- </div>
- </div>
- </div>
-
- <script>
- if (localStorage.getItem("dismissed2023cta") === null) {
- let modal = new bootstrap.Modal(document.getElementById("new-ui-cta"));
- modal.show();
- }
- </script>
-<?php }
-
-if ($use2023UI && isset($_GET["ui2023intro"])) { ?>
- <div class="modal fade" id="new-ui-success">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-body" style="text-align: center;">
- <img src="<?= icon("wave", false) ?>" class="light-only" style="height: 56px; margin: 10px 0;">
- <img src="<?= icon("wave", true) ?>" class="dark-only" style="height: 56px; margin: 10px 0;">
- <h3 style="text-align: center;">Welcome to a new experience</h3>
- <p style="text-align: center;">The new design is now activated and you can use it now.</p>
- <p style="text-align: center;">Please remember that it is currently experimental and you should report any issue you encounter.</p>
- <div style="text-align: center;"><a data-bs-dismiss="modal" onclick="localStorage.setItem('dismissed2023cta', '')" class="btn btn-outline-primary">Done</a></div>
- <hr>
- <div class="small text-muted">Some features are not available in the new design. <a href="">Learn more.</a></div>
- </div>
- </div>
- </div>
- </div>
-
- <script>
- let modal = new bootstrap.Modal(document.getElementById("new-ui-success"));
- modal.show();
- </script>
-<?php }
+ <?php } ?>
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/components/explicit.php";
-$GLOBALS["ColdHazePerformance"]["header"] = (microtime(true) - $start) * 1000; $start = microtime(true); ?>
+ <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/components/2023ui.inc"; ?>
+<?php $GLOBALS["ColdHazePerformance"]["header"] = (microtime(true) - $start) * 1000; $start = microtime(true); ?>
<main id="app" style="background-color: var(--palette-0);"> \ No newline at end of file