feat: add announcement

v1-dev
Raymond 2025-02-26 22:15:56 -05:00 committed by Azalea
parent df395a613f
commit 586d108d32
2 changed files with 24 additions and 0 deletions

View File

@ -8,6 +8,7 @@
import type { AquaNetUser } from "./libs/generalTypes"; import type { AquaNetUser } from "./libs/generalTypes";
import Settings from "./pages/User/Settings.svelte"; import Settings from "./pages/User/Settings.svelte";
import { pfp } from "./libs/ui" import { pfp } from "./libs/ui"
import { ANNOUNCEMENT } from "./libs/config";
console.log(`%c console.log(`%c
┏━┓ ┳━┓━┓┏━ ┏━┓ ┳━┓━┓┏━
@ -36,6 +37,11 @@
<span>AquaNet</span> <span>AquaNet</span>
</a> </a>
{/if} {/if}
{#if ANNOUNCEMENT}
<div class="announcement">
<strong>Notice</strong>: {ANNOUNCEMENT}
</div>
{/if}
<a href="/home">home</a> <a href="/home">home</a>
<div on:click={() => alert("Coming soon™")} on:keydown={e => e.key === "Enter" && alert("Coming soon™")} <div on:click={() => alert("Coming soon™")} on:keydown={e => e.key === "Enter" && alert("Coming soon™")}
role="button" tabindex="0">maps</div> role="button" tabindex="0">maps</div>
@ -78,6 +84,22 @@
border-radius: vars.$border-radius border-radius: vars.$border-radius
object-fit: cover object-fit: cover
.announcement
position: absolute
left: 50%
transform: translate(-50%, 0)
top: 0
width: 50%
height: 100%
display: flex
justify-content: center
align-content: center
z-index: -1
background: linear-gradient(90deg, #6f0f0f00 0%, vars.$c-shadow 50%, #6f0f0f00 100%)
font-size: 1.125em
text-decoration: none !important
color: inherit !important
.pfp .pfp
width: 2rem width: 2rem
height: 2rem height: 2rem

View File

@ -16,6 +16,8 @@ export const FADE_OUT = { duration: 200 }
export const FADE_IN = { delay: 400 } export const FADE_IN = { delay: 400 }
export const DEFAULT_PFP = '/assets/imgs/no_profile.png' export const DEFAULT_PFP = '/assets/imgs/no_profile.png'
export const ANNOUNCEMENT = '' // If set, will add an announcement to the top bar. Keep it short.
// Documentation for Userbox mode can be found in `docs/aquabox-url-mode.md` // Documentation for Userbox mode can be found in `docs/aquabox-url-mode.md`
// Please note that if this is set, it must be manually unset by users in Chuni Settings -> Update Userbox -> Switch to URL mode -> (empty value) -> Enter key // Please note that if this is set, it must be manually unset by users in Chuni Settings -> Update Userbox -> Switch to URL mode -> (empty value) -> Enter key
export const USERBOX_DEFAULT_URL = "" export const USERBOX_DEFAULT_URL = ""