Presentation

From Kevin-Liu-01/Claude-of-Tanks · View interactive version

Presentation is an AI agent skill from the GitHub repository Kevin-Liu-01/Claude-of-Tanks. Maintain lightweight public navigation, media loading, archive presentation, and public-site contracts.

How to use this skill

Skill file

claude-of-tanks / src/presentation

Purpose

<!-- agent-docs:fill:purpose -->

Present the game on public landing/manual/gallery surfaces without importing

the heavy game boot graph. Preserve accessible browsing and restrained media cost.

Mental model & key files

<!-- agent-docs:fill:model -->

publicNav.ts and its CSS own responsive public navigation and deferred star

counts. publicPages.ts coordinates hero/shot rails, mounts the page's videos

through the shared player and owns the Play hand-off. mediaPlayer.ts is the

site's one playback policy (brand-ui SPEC 8.3: near-margin source, 50/10

visibility, 10 s release, one transfer at a time, 2 desktop / 1 phone, 150 ms

hover, AV1 → VP9 → H.264, nothing by itself under reduced motion or data

saving, abortPageMedia before navigating into the game); the fleet takes,

the topic headers and the Filming viewer use it too. responsivePicture.ts

writes stills with rungs, sizes, explicit size, LQIP/tone and the 640 rung

under data saving. Both import nothing and never enter the game's boot graph.

home.css is the landing's stylesheet in the Vite graph (hashed under

/assets/, cached immutably); every public stylesheet lays out at first paint

from media queries at responsiveLayout.ts's band edges, never the

body[data-cot-*] hooks the boot module writes after it runs

(src/ui/viewportQueries.test-support.mjs, checked by mobileLayout.selftest.mjs).

mediaArchive.ts renders the packaged showcase manifest and lightbox;

captureRecipes.ts links media to reproducible Scene Studio recipes.

publicShell.ts renders the public site's one bar and footer; tools/public-shell.mjs

writes them, with the inline symbol block, into every public entry (or checks

that each carries exactly that). The landing's blocks between <!--home:NAME-->

markers come from tools/home-premiere.mjs (run the shell writer after it); the

404 (notFound.ts) searches the fleet and the manual's prebuilt index

(src/docs/docsSearch.ts). localizedHtml.ts makes each /cn document at build:

the data-i18n hosts in Chinese, the manual's prerendered chapters

(src/docs/topicPrerender.zh-CN.json), body links kept under /cn

(localizeLinks; hreflang links untouched), the zh-CN type floor

(src/ui/zhTypeFloor.ts) and the localized structured data. It also writes every

public page's share clip (og:video, its family's from shareVideoForRoute in

siteMetadata.ts) with og:type video.other, in both languages; heads name none.

node tools/share-tags.mjs [--dist=dist] [--json] lists every page's og:* and

twitter:* tags as a build serves them (diff two builds' lists to review a change).

Adjacent selftests also cover root public HTML, SEO metadata, copy, analytics,

and loading policy; those contracts extend beyond this directory.

Patterns to follow / invariants

<!-- agent-docs:fill:patterns -->

only a dialog or a wall uses loads with its module at that boundary, never as a

head <link> (the manual's archive sheet, 247).

node tools/public-shell.mjs --write; landing blocks: node tools/home-premiere.mjs --write.

surfaces they outrank every component's colour (the primary buttons' dark ink).

(<meta name="cot-i18n-catalog">); keep `node tools/i18n-page-catalogs.mjs

--check` clean when adding a page or a key pattern (docs/LOCALIZATION.md

"Page catalogs").

document visibility when deciding autoplay and source retention.

media briefly across scroll reversals to avoid repeated downloads/decodes.

restoration. Reuse the shared responsive layout owner.

Preserve self-hosted telemetry opt-out and locally packaged subresources.

lazily after idle through src/analytics.ts and the 404 runtime; it never

reaches the game entry. It sends from the production host only, queues

Consent Mode first, and strips query strings. analytics.selftest.mjs

enforces all of this.

Common tasks → first action

<!-- agent-docs:fill:tasks -->

node src/presentation/publicNav.selftest.mjs.

and responsivePicture.selftest.mjs; the media receipts are

tools/media-fallback, media-freshness, media-page-unique and

media-r5/site-video-budget (*.selftest.mjs); after npm run build,

npm run media:motion-savedata proves zero video bytes under reduced motion

and Save-Data and the Play hand-off in a real browser.

type [data-rung=phone|wide]>` in ladder order (AV1, VP9, H.264) with

data-poster; a retiring collection goes in media-freshness's RETIRING with

the replacement that ends it.

seoMetadata.selftest.mjs, and analytics.selftest.mjs as applicable.

changing cards, filters, or their shared manual integration.

publishing or re-rendering pictures under public/media, run

node tools/media-library/build.mjs --write and commit the library with them.

A new folder gets a rule in tools/media-library/sources.mjs (its pictures'

collection, set and caption from its manifest or the catalogs, and a

picture's clip from its moving take) or a reason to stay out, films included;

media-library.selftest.mjs fails until then. The viewer plays a clip only

on its play control's press, through mediaPlayer.ts (mode: 'click').

Gotchas

<!-- agent-docs:fill:gotchas -->

Passing a source-contract selftest does not prove the responsive pixels or

media playback lifecycle. The player rides in the fleet takes' chunk

(vite.config.ts group): as its own chunk it adds an entry to the game entry's

preload list; keep it import-free. Do not eagerly fetch the complete archive on the

landing page or import src/main.ts to obtain public product information.

backdrop-filter (and transform, filter) on the bar makes it the containing

block of its position:fixed descendants: the phone menu sized itself to the

56 px bar until the bar dropped its blur while the menu is open (publicNav.css).

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.