Public landing page live map; docs for Discord, live embeds, email

This commit is contained in:
Claude committed 2026-10-01 01:52:54 +00:00
1 parent cd985a1a7b
commit aae0a5a5ff
11 files changed
+195 -10

No files matched your search

+11 -9
View File
@@ -9,7 +9,7 @@
// click on a player does through the `player` snippet.
let {
info = null, overlay = null, tileUrl, avatarUrl, selfUuid = null, error = '', initialDimension = '',
player, toolbar, onplayer
player, toolbar, onplayer, available = { claims: true, pins: true, players: true }
}: {
info: MapInfo | null;
overlay: MapOverlay | null;
@@ -23,6 +23,8 @@
/** Extra buttons for the top bar. */
toolbar?: Snippet;
onplayer?: (p: LivePlayer | null) => void;
/** Which layers exist for this viewer (the public map may hide some). */
available?: MapLayers;
} = $props();
let canvas: HTMLCanvasElement;
@@ -97,23 +99,23 @@
<span class="chip solo">{dims[0].label}</span>
{/if}
<div class="chips" aria-label="Layers">
<button class="chip" class:on={layers.claims} onclick={() => (layers.claims = !layers.claims)} title="Guild land">
{#if available.claims}<button class="chip" class:on={layers.claims} onclick={() => (layers.claims = !layers.claims)} title="Guild land">
<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"><path d="M4 4h16v16H4z" /><path d="M4 12h16M12 4v16" /></svg> Claims <b>{claimsHere}</b>
</button>
<button class="chip" class:on={layers.pins} onclick={() => (layers.pins = !layers.pins)} title="Spawn, warps, markets and shops">
</button>{/if}
{#if available.pins}<button class="chip" class:on={layers.pins} onclick={() => (layers.pins = !layers.pins)} title="Spawn, warps, markets and shops">
<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"><path d="M12 21s7-6.2 7-11.5A7 7 0 0 0 5 9.5C5 14.8 12 21 12 21z" /><circle cx="12" cy="9.5" r="2.4" /></svg> Places <b>{pinsHere}</b>
</button>
<button class="chip" class:on={layers.players} onclick={() => (layers.players = !layers.players)} title="Players online">
</button>{/if}
{#if available.players}<button class="chip" class:on={layers.players} onclick={() => (layers.players = !layers.players)} title="Players online">
<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="8" r="3.5" /><path d="M5 20c.8-4 3.5-6 7-6s6.2 2 7 6" /></svg> Players <b>{here.length}</b>
</button>
</button>{/if}
</div>
{#if toolbar}{@render toolbar()}{/if}
</div>
<div class="right">
<button class="chip" class:on={listOpen} onclick={() => (listOpen = !listOpen)} disabled={!everyone.length}>
{#if available.players}<button class="chip" class:on={listOpen} onclick={() => (listOpen = !listOpen)} disabled={!everyone.length}>
<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01" /></svg> Online <b>{everyone.length}</b>
</button>
</button>{/if}
{#if listOpen && everyone.length}
<ul class="plist" aria-label="Players online">
{#each everyone as p (p.uuid)}