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>
|
||||
|
||||
Reference in New Issue
Block a user