feat: add prelaunch site controls and refresh branding
This commit is contained in:
@@ -1,23 +1,32 @@
|
||||
<script lang="ts">
|
||||
import { page } from '$app/state';
|
||||
import BrandLockup from '$lib/components/BrandLockup.svelte';
|
||||
import PendingForm from '$lib/components/PendingForm.svelte';
|
||||
import { onMount, tick } from 'svelte';
|
||||
import type { Snippet } from 'svelte';
|
||||
|
||||
let { user, isacAccess, notificationSummary, children }: {
|
||||
let { user, isacAccess, notificationSummary, siteAccess, children }: {
|
||||
user: { username: string; displayName: string; role: string; avatarUrl: string } | null;
|
||||
isacAccess: boolean;
|
||||
notificationSummary: { unread: number };
|
||||
siteAccess: { comingSoonEnabled: boolean; sections: Record<string, boolean> };
|
||||
children: Snippet;
|
||||
} = $props();
|
||||
|
||||
const links = [
|
||||
{ href: '/news', label: 'News' },
|
||||
{ href: '/database', label: 'Database' },
|
||||
{ href: '/builds', label: 'Builds' },
|
||||
{ href: '/guides', label: 'Guides' },
|
||||
{ href: '/builder', label: 'Builder' }
|
||||
const allLinks = [
|
||||
{ href: '/news', label: 'News', key: 'news' },
|
||||
{ href: '/database', label: 'Database', key: 'database' },
|
||||
{ href: '/builds', label: 'Builds', key: 'builds' },
|
||||
{ href: '/guides', label: 'Guides', key: 'guides' },
|
||||
{ href: '/builder', label: 'Builder', key: 'builder' }
|
||||
];
|
||||
const links = $derived(allLinks.filter((link) => siteAccess.sections[link.key]));
|
||||
const launchSupportPages = ['/contact', '/dmca', '/terms', '/sign-in'];
|
||||
const homeHref = $derived(
|
||||
siteAccess.comingSoonEnabled && launchSupportPages.some((path) => page.url.pathname === path || page.url.pathname.startsWith(`${path}/`))
|
||||
? '/coming-soon'
|
||||
: '/'
|
||||
);
|
||||
|
||||
let showCookieNotice = $state(false);
|
||||
let mobileOpen = $state(false);
|
||||
@@ -102,8 +111,8 @@
|
||||
<svelte:window onkeydown={handleNavigationKey} onclick={closeAccountFromOutside}/>
|
||||
|
||||
<header class="site-header">
|
||||
<a class="brand" href="/" aria-label="SHD.build home">
|
||||
<span class="brand-mark"><i></i><b>SHD</b></span><span class="brand-name">SHD<span>.build</span><small>RESURGENCE COMMUNITY</small></span>
|
||||
<a class="brand" href={homeHref} aria-label="SHD.build home">
|
||||
<BrandLockup />
|
||||
</a>
|
||||
<nav aria-label="Main navigation">
|
||||
{#each links as link}
|
||||
@@ -162,8 +171,8 @@
|
||||
<div class="mobile-nav-layer">
|
||||
<button class="mobile-nav-backdrop" type="button" aria-label="Close navigation" onclick={closeMobileNavigation}></button>
|
||||
<nav id="mobile-navigation" class="mobile-navigation" aria-label="Mobile navigation" bind:this={mobilePanel}>
|
||||
<div class="mobile-nav-heading"><div><span>SHD COMMUNITY</span><strong>NAVIGATION</strong></div><b>ONLINE</b></div>
|
||||
<a class:active={page.url.pathname === '/'} href="/"><small>00</small><span>Home</span><b>›</b></a>
|
||||
<div class="mobile-nav-heading"><div><span>SHD NETWORK</span><strong>NAVIGATION</strong></div><b>ONLINE</b></div>
|
||||
<a class:active={page.url.pathname === '/' || page.url.pathname === '/coming-soon'} href={homeHref}><small>00</small><span>Home</span><b>›</b></a>
|
||||
{#each links as link, index}
|
||||
<a class:active={page.url.pathname.startsWith(link.href)} href={link.href}><small>{String(index + 1).padStart(2, '0')}</small><span>{link.label}</span><b>›</b></a>
|
||||
{/each}
|
||||
@@ -186,9 +195,8 @@
|
||||
|
||||
<footer class="site-footer">
|
||||
<div>
|
||||
<a class="brand footer-brand" href="/" aria-label="SHD.build home">
|
||||
<span class="brand-mark"><i></i><b>SHD</b></span>
|
||||
<span class="brand-name">SHD<span>.build</span><small>RESURGENCE COMMUNITY</small></span>
|
||||
<a class="brand footer-brand" href={homeHref} aria-label="SHD.build home">
|
||||
<BrandLockup size="footer" />
|
||||
</a>
|
||||
<p>Independent builds, guides, game data, news, and community intelligence for The Division Resurgence.</p>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
<script lang="ts">
|
||||
let { size = '100%' }: { size?: string } = $props();
|
||||
</script>
|
||||
|
||||
<svg class="brand-emblem" viewBox="0 0 100 100" aria-hidden="true" style:width={size} style:height={size}>
|
||||
<g fill="none" stroke="#f6a821" stroke-width="12" stroke-linecap="butt">
|
||||
<path d="M73 20A38 38 0 0 0 15 63"/>
|
||||
<path d="M85 37A38 38 0 0 1 55 88"/>
|
||||
<path d="M42 87A38 38 0 0 1 18 70"/>
|
||||
</g>
|
||||
<rect x="72" y="23" width="10" height="10" fill="#f6a821"/>
|
||||
<path d="M62 35H35V65H62M68 43V57" fill="none" stroke="#ecebe5" stroke-width="9" stroke-linecap="butt" stroke-linejoin="miter"/>
|
||||
</svg>
|
||||
|
||||
<style>
|
||||
.brand-emblem {
|
||||
display: block;
|
||||
flex: 0 0 auto;
|
||||
overflow: visible;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,79 @@
|
||||
<script lang="ts">
|
||||
import BrandEmblem from '$lib/components/BrandEmblem.svelte';
|
||||
|
||||
let {
|
||||
size = 'header',
|
||||
descriptor = 'RESURGENCE DATA & TOOLS'
|
||||
}: {
|
||||
size?: 'header' | 'footer' | 'launch';
|
||||
descriptor?: string;
|
||||
} = $props();
|
||||
</script>
|
||||
|
||||
<span class="brand-lockup brand-lockup--{size}">
|
||||
<span class="brand-lockup__emblem"><BrandEmblem /></span>
|
||||
<span class="brand-lockup__copy">
|
||||
<span class="brand-lockup__name"><span>SHD</span><b>.build</b></span>
|
||||
<small>{descriptor}</small>
|
||||
</span>
|
||||
</span>
|
||||
|
||||
<style>
|
||||
.brand-lockup {
|
||||
--brand-emblem-size: 38px;
|
||||
--brand-name-size: 20px;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 11px;
|
||||
min-width: max-content;
|
||||
}
|
||||
.brand-lockup__emblem {
|
||||
display: block;
|
||||
width: var(--brand-emblem-size);
|
||||
height: var(--brand-emblem-size);
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
.brand-lockup__copy {
|
||||
display: grid;
|
||||
gap: 3px;
|
||||
}
|
||||
.brand-lockup__name {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
color: var(--shd-text);
|
||||
font-size: var(--brand-name-size);
|
||||
font-weight: 900;
|
||||
letter-spacing: -.025em;
|
||||
line-height: .82;
|
||||
}
|
||||
.brand-lockup__name b {
|
||||
color: var(--shd-orange);
|
||||
font-weight: inherit;
|
||||
}
|
||||
.brand-lockup small {
|
||||
color: var(--shd-text-muted);
|
||||
font-size: 9px;
|
||||
font-weight: 800;
|
||||
letter-spacing: .13em;
|
||||
line-height: 1;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.brand-lockup--footer {
|
||||
--brand-emblem-size: 36px;
|
||||
--brand-name-size: 18px;
|
||||
}
|
||||
.brand-lockup--launch {
|
||||
--brand-emblem-size: 42px;
|
||||
--brand-name-size: 22px;
|
||||
}
|
||||
@media (max-width: 430px) {
|
||||
.brand-lockup--header,
|
||||
.brand-lockup--launch {
|
||||
--brand-emblem-size: 36px;
|
||||
}
|
||||
.brand-lockup--header .brand-lockup__copy,
|
||||
.brand-lockup--launch .brand-lockup__copy {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user