~ knotless Search/
↑↓ move↵ open⇧↵ all results

chadtmiller.com/hud

A remote MCP server that shows atproto records as interactive UI inside MCP Apps hosts

0
0
95 lines · 2.2 KB Raw History
<script lang="ts">
	import type { Snippet } from 'svelte';

	/**
	 * The workspace's layout, without its data: the tabs along the top, a
	 * notice under them while there is one, the strip map centred under
	 * those, the stage below filling the rest (the strips, or the overview),
	 * a toast at the top right over the stage, on a phone what plays across
	 * the foot (a desktop's is in the tabs), and whatever opens over all of
	 * it.
	 */
	let {
		tabs,
		notice,
		map,
		stage,
		toast,
		playing,
		overlays
	}: { tabs: Snippet; notice?: Snippet; map: Snippet; stage: Snippet; toast: Snippet; playing?: Snippet; overlays: Snippet } = $props();
</script>

<div class="page">
	{@render tabs()}
	<div class="notice">{@render notice?.()}</div>
	<div class="map">{@render map()}</div>
	<div class="stage">
		{@render stage()}
		<div class="toast">{@render toast()}</div>
	</div>
	{#if playing}<div class="playing">{@render playing()}</div>{/if}
</div>
{@render overlays()}

<style>
	.page {
		display: grid;
		grid-template-rows: var(--tabs) auto var(--map) minmax(0, 1fr) auto;
		grid-template-columns: minmax(0, 1fr);
		height: 100%;
	}

	/* Clear of the strip map under it, while there is one. */
	.notice:not(:empty) {
		margin-bottom: var(--space-1-5);
	}

	.map {
		display: flex;
		justify-content: center;
		align-items: center;
		min-width: 0;
		padding: 0 var(--space-4);
	}

	.stage {
		position: relative;
		min-height: 0;
	}

	/* Over the strip's foot, in the middle, where it covers no column's header. */
	.toast {
		position: absolute;
		bottom: calc(var(--space-4) + env(safe-area-inset-bottom));
		left: 50%;
		z-index: var(--z-menu);
		transform: translateX(-50%);
	}

	.playing {
		display: none;
	}

	@media (max-width: 640px) {
		.toast {
			right: var(--space-2);
			left: var(--space-2);
			display: flex;
			justify-content: center;
			transform: none;
		}

		/* The foot's player keeps clear of the screen's own foot already. */
		.page:has(> .playing) .toast {
			bottom: var(--space-4);
		}

		/* Above the screen's own foot (a home indicator). */
		.playing {
			display: block;
			padding-bottom: env(safe-area-inset-bottom);
			background: var(--panel);
		}
	}
</style>