interplane.Get Omega
Read in your language

aienux

Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.

Brought by drakestapleton

branch main Branches Tags History

aienux / docs / design / tools / make-found.mjs

66 lines · 3671 bytes Raw Blame History
1// make-found.mjs -- writes 05b-what-allen-found.html, the constellation of found parts, into the current directory.
2// cd docs/design/screens && node ../tools/make-found.mjs
3import { writeFileSync } from "node:fs";
4// the parts, placed round Allen (960, 432) like the kernel's notes constellation; example values
5const C = [960, 432];
6const parts = [
7 ["Screen", "2560 by 1440, 144 a second", 600, 170],
8 ["Graphics", "RTX 4070, 12 GB", 960, 96],
9 ["Processor", "Ryzen 7 7800X3D, 8 cores", 1320, 170],
10 ["Memory", "32 GB", 1620, 430],
11 ["Storage", "1 TB fast, 2 TB", 1480, 668],
12 ["Network", "wired, connected", 1160, 760],
13 ["Sound", "speakers and a microphone", 760, 760],
14 ["Keyboard and mouse", "working", 470, 640],
15 ["Nearby", "2 AienOS computers, a printer", 300, 430],
16];
17const threads = parts.map(([, , x, y0]) => {
18 const y = y0 < C[1] - 100 ? y0 + 66 : y0; // parts above Allen: meet the thread under their words
19 const dx = x - C[0], dy = y - C[1], d = Math.hypot(dx, dy), r0 = 150; // start outside Allen's light
20 return `<line x1="${(C[0] + dx / d * r0).toFixed(0)}" y1="${(C[1] + dy / d * r0).toFixed(0)}" x2="${(x - dx / d * 14).toFixed(0)}" y2="${(y - dy / d * 14).toFixed(0)}"/>`;
21}).join("\n ");
22const stars = parts.map(([l, v, x, y], i) => `<div class="part rise" data-at="${300 + i * 110}" style="left:${x - 200}px;top:${y - 8}px">
23 <span class="star"></span>
24 <span class="plabel" data-af="small">${l}</span>
25 <span class="pvalue" data-af="body">${v}</span>
26 </div>`).join("\n ");
27writeFileSync("05b-what-allen-found.html", `<!doctype html>
28<html lang="en">
29<head>
30<meta charset="utf-8">
31<meta name="viewport" content="width=device-width, initial-scale=1">
32<title>Screen 5: what Allen found</title>
33<link rel="stylesheet" href="screens.css">
34<style>
35 /* the computer as a constellation round Allen: one star per part, a thread of light to him (mind.c threads) */
36 .threads { position: absolute; inset: 0; }
37 .threads line { stroke: rgb(var(--allen-colors-glow-rgb) / .22); stroke-width: 1.2; stroke-linecap: round;
38 stroke-dasharray: 600; stroke-dashoffset: 600;
39 animation: draw 900ms var(--allen-motion-ease-out) forwards; }
40 .threads line:nth-child(n) { animation-delay: calc(var(--i, 0) * 110ms + 200ms); }
41 @keyframes draw { to { stroke-dashoffset: 0; } }
42 .part { position: absolute; width: 400px; display: grid; justify-items: center; row-gap: 8px; }
43 .star { width: 9px; height: 9px; border-radius: 50%; background: var(--allen-colors-heart-core);
44 box-shadow: 0 0 10px var(--allen-colors-warm), 0 0 26px rgb(var(--allen-colors-glow-rgb) / .5); }
45 .plabel { color: var(--allen-colors-hint); }
46 .pvalue { color: var(--allen-colors-primary); }
47 @media (prefers-reduced-motion: reduce) { .threads line { animation: none; stroke-dashoffset: 0; } }
48</style>
49</head>
50<body>
51<div class="board sky">
52 <div class="tag">5 ยท what Allen found (example values; drawn as a constellation round Allen)</div>
53 <svg class="threads" width="1920" height="1080" viewBox="0 0 1920 1080" aria-hidden="true">
54 ${threads.split("\n ").map((l, i) => l.replace("<line", `<line style="--i:${i}"`)).join("\n ")}
55 </svg>
56 ${stars}
57 <p class="says center rise" style="top: 848px" data-at="1400" data-af="voice">This is your computer as I see it.</p>
58 <div class="buttons" style="top: 918px">
59 <div class="button lit rise" data-at="1700" data-href="06-consent.html"><span data-af="body">Next</span></div>
60 </div>
61</div>
62<script src="allen-font.js"></script>
63<script src="screen.js"></script>
64</body>
65</html>
66`);