diff options
Diffstat (limited to 'includes/pane.inc')
-rw-r--r-- | includes/pane.inc | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/includes/pane.inc b/includes/pane.inc index 6aa7f98..e95747e 100644 --- a/includes/pane.inc +++ b/includes/pane.inc @@ -1,5 +1,27 @@ -<?php global $isLoggedIn; global $isUserLoggedIn; global $pages; global $navigation; $byColor = getMembersByColor(); ?> +<?php global $isLoggedIn; global $isUserLoggedIn; global $pages; global $navigation; $byColor = getMembersByColor($_SERVER['HTTP_HOST'] === "fr.equestria.horse"); global $lang; global $pages; ?> +<?php if ($_SERVER['HTTP_HOST'] === "fr.equestria.horse"): ?> +<div id="pane-header-background" style="background-image: linear-gradient(90deg, <?php + +$index = 0; +$list = array_map(function ($i) { return $i["color"]; }, $byColor); +$length = count($list); + +foreach ($list as $color) { + $perc = ($index / $length) * 100; + echo("#${color}33 $perc%"); + + $index++; + if ($index < $length) echo(", "); +} + +?>)"> + <a href="/" id="pane-header" class="login-link-clickable" style="color: white; text-decoration: none; padding: 20px; display: block; text-align: center; border-bottom: 1px solid rgba(255, 255, 255, .25);"> + <img src="/assets/logo/newlogo2.png" alt="" style="width:32px;vertical-align: middle;margin-right:5px;"> + <span style="vertical-align: middle; font-weight: bold;">Cold Haze</span> + </a> +</div> +<?php else: ?> <div id="pane-header-background" style="background-image: linear-gradient(90deg, <?php $index = 0; @@ -23,15 +45,16 @@ foreach ($list as $color) { <?php if ($isLoggedIn || $isUserLoggedIn): ?> <a onclick="toggleGlobalSearch();" id="login-link" class="login-link-clickable"> - Search in the website... + <?= $lang["navigation"]["search"] ?> </a> <?php elseif (!$isLoggedIn && !$isUserLoggedIn): ?> <a href="/-/login" id="login-link" class="login-link-clickable"> <?php global $_PROFILE; ?> <img alt="" src="/assets/icons/login.svg" style="filter:invert(1);width:24px;vertical-align: middle;"> - <span style="vertical-align: middle;">Not logged in</span> + <span style="vertical-align: middle;"><?= $lang["navigation"]["login"] ?></span> </a> <?php endif; ?> +<?php endif; ?> <?php foreach ($navigation as $id => $item): if (!$item["admin"] || $isLoggedIn): ?> @@ -46,12 +69,12 @@ foreach ($list as $color) { <?php if (isset($category["name"])): ?> <div class="pane-group-category-title"><?= $category["name"] ?></div> <?php endif; ?> - <?php foreach ($category["items"] as $link): ?> + <?php foreach ($category["items"] as $link): if (isset($link)): ?> <a class="pane-group-item" href="<?= $link["link"] ?>"> <img src="<?= $link["icon"] ?>" <?php if ($link["invert"]): ?>class="dropdown-icon"<?php endif; ?> alt="" style="width:24px; border-radius: 5px; vertical-align: middle;"> <?php if (!$category["minimal"]): ?><span style="vertical-align: middle;<?= isset($link["stepped"]) ? "color: $link[stepped];" : "" ?>"><?= isset($link["stepped"]) ? "<b>$link[name]</b>" : $link["name"] ?></span><?php endif; ?> </a> - <?php endforeach; ?> + <?php endif; endforeach; ?> </div> <?php endforeach; ?> </div> |