medieval-kit/viewer.html
CRT 0dd4ea6001 Give the published page a card
A link to the site showed a URL and a blank square. It now carries a title, a
description, a canonical URL, an icon and a full set of OpenGraph and Twitter
tags, so a page nobody has opened yet arrives as something you can look at.

Two of those tags have to be ABSOLUTE and it is not a style question: a
scraper fetching the page has no base to resolve `/cover.png` against and
drops it silently. `build-site.ts` now copies the images into the output as
well, because an `og:image` pointing at this host has to have the file ON this
host — a card that 404s shows nothing, and nothing about the page itself looks
wrong while it happens.

The cover is a real 1200x630 render rather than a crop of a square one, which
took a change to the renderer worth having anyway. `newFrame` and
`frameCamera` both took a width and a height already; only `renderOne` was
insisting they be equal. And with a non-square frame the old camera fit showed
its flaw: it fitted the bounding SPHERE, which is one number and wrong for
anything not roughly round. The kit scene is wide and flat, so its sphere is
far taller than the scene is, and fitting that into the vertical field left the
models in a band across the middle with empty air above and below — most of a
1.91:1 card. It now fits the BOX, iteratively, because perspective is not
linear in distance: place the camera, project the eight corners, move by how
far the worst one lands past the edge. Two passes is inside a pixel.

That change improves every render, not just the card: on the contact sheet
every model is visibly larger in its cell and nothing crops.

`check-docs` now watches `viewer.html` too. Its description quotes the model
count and the triangle total, which is the same sentence that went stale three
times in the READMEs before that check existed — and a stale number in a card
is worse than one in a README, because nobody reading the card can see the kit
to know it is wrong. The description says "37" rather than "thirty-seven" for
exactly that reason: a word is not a number the check can find.

Also repointing the npm README's two images from `raw.githubusercontent.com`
to the live site. They were pointing into a private repository and would have
404'd on npmjs.com; now they do not depend on the repository being readable at
all.
2026-08-27 07:34:59 +00:00

62 lines
3 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@medieval-kit · procedural lowpoly medieval models</title>
<meta
name="description"
content="37 lowpoly medieval models generated from TypeScript you install and own — barrels, tools, a forge, a windmill. 30,390 triangles for the whole kit."
/>
<link rel="canonical" href="https://medieval.crt.fyi/" />
<link rel="icon" type="image/png" href="/icon.png" />
<meta name="theme-color" content="#0b0e12" />
<!--
The card. Every one of these is here because something reads it and shows
the page to somebody who has not opened it yet, and the default without
them is the URL and a blank square.
The image is ABSOLUTE, which is not a style choice: a scraper fetching
this page has no base to resolve "/cover.png" against and will drop it.
Same for the URL. And `og:image` is a real 1200x630 render of the whole
kit rather than a crop of a square one — the renderer will produce any
aspect now, and a card is 1.91:1, so a square image loses either the
windmill off the top or the props off the bottom.
-->
<meta property="og:type" content="website" />
<meta property="og:site_name" content="medieval-kit" />
<meta property="og:url" content="https://medieval.crt.fyi/" />
<meta property="og:title" content="@medieval-kit · procedural lowpoly medieval models" />
<meta
property="og:description"
content="37 lowpoly medieval models generated from TypeScript you install and own — barrels, tools, a forge, a windmill. 30,390 triangles for the whole kit."
/>
<meta property="og:image" content="https://medieval.crt.fyi/cover.png" />
<meta property="og:image:type" content="image/png" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta
property="og:image:alt"
content="37 lowpoly medieval models arranged in one scene: a windmill and an oak-framed market stall behind, a forge, a grindstone and a cart wheel in the middle, barrels, crates and hand tools at the front."
/>
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="@medieval-kit · procedural lowpoly medieval models" />
<meta
name="twitter:description"
content="37 lowpoly medieval models generated from TypeScript you install and own. Open the viewer and turn any of them over."
/>
<meta name="twitter:image" content="https://medieval.crt.fyi/cover.png" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Archivo:wght@400;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap"
/>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/viewer.ts"></script>
</body>
</html>