code wiki / _hdl_build / nx_video_index_emit.nx
nx_video_index_emit.nx
buildroot/runtime/_hdl_build/nx_video_index_emit.nx
about
nx_video_index_emit.nx -- GENERATED EMITTER (nx_asset_emit_gen). THIS ORGAN IS THE SSOT for
sites/nishifamily/video/index.html -- edit HERE (or regenerate), NEVER the emitted artifact.
argv[1] overrides the target (the drift-kill seam: emit to a compare path + byte-diff).
license_tier: ORIGINAL
dependencies 1 imports · 0 importers
imports: nx_syscalls.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 7 | const P0: *u8 = "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\">\n<base href=\"/video/\">\n<title>Nishi Family Video</title>\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1, viewport-fit=cover, user-scalable=no\">\n<meta name=\"theme-color\" content=\"#0a0a0c\">\n<link rel=\"icon\" href=\"data:,\">\n<style>\n :root { color-scheme: dark; --safe-b: env(safe-area-inset-bottom,0px); --safe-t: env(safe-area-inset-top,0px); }\n * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }\n html, body { margin:0; padding:0; height:100%; background:#000; color:#e7e7e9;\n font:14px/1.45 -apple-system,system-ui,sans-serif; overflow:hidden; }\n\n /* ---------- lobby ---------- */\n #lobby { position:fixed; inset:0; display:flex; flex-direction:column; align-items:center;\n justify-content:center; gap:14px; background:radial-gradient(80vw 60vh at 50% 30%, #14141c, #000); padding:20px; }\n #lobby h1 { font-size:1.6rem; margin:0; }\n #lobby .sub { color:#8a8a92; font-size:.9rem; margin:0 0 10px; }\n #lobby input { background:#15151b; border:1px solid #2c2c36; color:#fff; border-radius:10px;\n padding:12px 16px; font-size:1.05rem; width:min(320px,80vw); text-align:center; }\n #lo" |
| 8 | const P1: *u8 = "bby button { background:#2a4d8f; color:#fff; border:0; border-radius:10px;\n padding:12px 28px; font-size:1.05rem; cursor:pointer; }\n #lobby button:active { transform:scale(.97); }\n #lobby .foot { position:fixed; bottom:calc(var(--safe-b) + 10px); color:#55555e; font-size:.72rem; }\n\n /* ---------- call stage ---------- */\n #stage { position:fixed; inset:0; display:none; }\n #peers { position:absolute; top:calc(var(--safe-t) + 34px); left:0; right:0;\n bottom:calc(var(--safe-b) + 86px); display:grid; gap:6px; padding:6px;\n grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); grid-auto-rows:1fr; align-content:center; }\n .tile { background:#101016; border:1px solid rgba(255,255,255,.08); border-radius:10px;\n position:relative; overflow:hidden; min-height:150px; display:flex; align-items:center; justify-content:center; }\n .tile video, .tile canvas { width:100%; height:100%; object-fit:cover; display:block; background:#0a0a0e; }\n .tile .label { position:absolute; left:8px; top:8px; background:rgba(0,0,0,.55);\n border-radius:5px; padding:2px 8px; font-size:11px; }\n .tile .stats { position:absolute; right:8px; top:8px; background:rgba(0,0,0,.55);\n border-radiu" |
| 9 | const P2: *u8 = "s:5px; padding:2px 8px; font-size:10px; color:#9fd09f; font-variant-numeric:tabular-nums; }\n .tile .stats.bad { color:#e0a06a; }\n /* camera-off = a STATE card, not a frozen last frame (mi/ca ride presence; Discord/Zoom-style) */\n .tile.camoff canvas { filter:brightness(.22) grayscale(1); }\n .tile.camoff .label::after { content:\" \xc2\xb7 camera off\"; color:#c9a26a; }\n /* MIRROR CONTROL (field 2026-07-05 \"turn left shows right\"): double-tap any tile flips it.\n Default: self mirrored (industry standard), remote true-view. Covers pre-mirroring phone cams too. */\n .tile.self.flipx video, .tile.self.flipx canvas { transform:none; }\n .tile.flipx:not(.self) canvas { transform:scaleX(-1); }\n header { position:fixed; top:0; left:0; right:0; height:calc(var(--safe-t) + 34px);\n padding:calc(var(--safe-t) + 7px) 14px 0; display:flex; gap:10px; align-items:center;\n background:linear-gradient(to bottom, rgba(0,0,0,.75), transparent); z-index:5; font-size:.85rem; color:#a8a8b2; }\n #bar { position:fixed; left:0; right:0; bottom:0; padding:10px 12px calc(var(--safe-b) + 12px);\n display:flex; gap:10px; justify-content:center; align-items:center;\n background:linear-gradient(to top," |
| 10 | const P3: *u8 = " rgba(0,0,0,.8), transparent); z-index:5; }\n #bar button { background:#1d1d26; color:#fff; border:1px solid #32323e; border-radius:50%;\n width:52px; height:52px; font-size:21px; cursor:pointer; }\n #bar button.on { background:#2a4d8f; border-color:#2a4d8f; }\n #bar button.danger { background:#8f2a2a; border-color:#8f2a2a; }\n #bar button.rec { background:#1d1d26; }\n #bar button.rec.recording { background:#b03030; animation:pulse 1.2s infinite; }\n @keyframes pulse { 50% { transform:scale(1.08); } }\n\n /* ---------- circles ---------- */\n #circles { position:fixed; inset:0; display:none; flex-direction:column; background:#0a0a0e; z-index:8;\n padding:calc(var(--safe-t) + 14px) 14px calc(var(--safe-b) + 14px); overflow-y:auto; }\n #circles h2 { margin:4px 0 14px; font-size:1.2rem; display:flex; align-items:center; gap:10px; }\n #circles .row { display:flex; gap:8px; align-items:center; margin-bottom:14px; flex-wrap:wrap; }\n #circles .row button { background:#1d1d26; color:#dcdce2; border:1px solid #32323e;\n border-radius:8px; padding:8px 14px; cursor:pointer; font-size:.9rem; }\n #circles .row button.on { background:#2a4d8f; border-color:#2a4d8f; color:#fff; }\n #cgrid { " |
| 11 | const P4: *u8 = "display:grid; grid-template-columns:repeat(auto-fill,minmax(130px,1fr)); gap:12px; }\n .circle { aspect-ratio:1; border-radius:50%; overflow:hidden; background:#15151b;\n border:2px solid #2c2c36; cursor:pointer; position:relative; }\n .circle video, .circle canvas { width:100%; height:100%; object-fit:cover; }\n .circle .who { position:absolute; bottom:8%; left:0; right:0; text-align:center; font-size:10px;\n color:#cfcfd6; text-shadow:0 1px 3px #000; pointer-events:none; }\n #recwrap { position:fixed; inset:0; display:none; align-items:center; justify-content:center;\n flex-direction:column; gap:16px; background:rgba(0,0,0,.92); z-index:12; }\n #recview { width:min(70vw,70vh,420px); height:min(70vw,70vh,420px); border-radius:50%;\n object-fit:cover; border:3px solid #b03030; }\n #recwrap .ctl { display:flex; gap:14px; align-items:center; }\n #recwrap button { background:#1d1d26; color:#fff; border:1px solid #32323e; border-radius:10px;\n padding:10px 20px; font-size:1rem; cursor:pointer; }\n #recwrap button.stop { background:#b03030; border-color:#b03030; }\n #recwrap .privrow { color:#c9a05a; font-size:.9rem; display:flex; gap:8px; align-items:center; }\n #rectimer { f" |
| 12 | const P5: *u8 = "ont-variant-numeric:tabular-nums; color:#e0a0a0; }\n /* ---------- room text chat ---------- */\n #chat { position:fixed; right:0; top:calc(var(--safe-t) + 34px); bottom:calc(var(--safe-b) + 86px);\n width:min(320px,85vw); display:none; flex-direction:column; z-index:6;\n background:rgba(13,13,18,.96); border-left:1px solid #26262f; }\n #chatlog { flex:1; overflow-y:auto; padding:10px; display:flex; flex-direction:column; gap:6px; }\n .cmsg { max-width:85%; background:#191922; border:1px solid #2a2a34; border-radius:10px;\n padding:6px 10px; font-size:.85rem; overflow-wrap:break-word; align-self:flex-start; }\n .cmsg .cwho { display:block; color:#8fa8d0; font-size:.7rem; margin-bottom:2px; }\n .cmsg.mine { align-self:flex-end; background:#22375f; border-color:#2a4d8f; }\n #chatrow { display:flex; gap:8px; padding:8px; border-top:1px solid #26262f; }\n #chatin { flex:1; background:#15151b; border:1px solid #2c2c36; color:#fff; border-radius:8px;\n padding:10px 12px; font-size:.95rem; min-width:0; }\n #chatsend { background:#2a4d8f; color:#fff; border:0; border-radius:8px; padding:0 16px; cursor:pointer; }\n #bar button { position:relative; }\n #chatBadge { position:absolute;" |
| 13 | const P6: *u8 = " top:-4px; right:-4px; background:#b03030; color:#fff; border-radius:9px;\n min-width:18px; height:18px; font-size:11px; line-height:18px; display:none; text-align:center; }\n #toast { position:fixed; left:50%; bottom:calc(var(--safe-b) + 100px); transform:translateX(-50%);\n background:#1d1d26; border:1px solid #32323e; border-radius:10px; padding:8px 16px;\n font-size:.85rem; opacity:0; transition:opacity .25s; pointer-events:none; z-index:20; }\n /* nishi-emit: self-view mirror (selfie feel); sent frame stays un-mirrored */\n .tile.self video, .tile.self canvas { transform: scaleX(-1); }\n /* ---------- LAYOUT MODES (callLayout: the SOTA call framing) ---------- */\n /* SOLO (just you): fill the stage */\n #peers.solo { display:block; padding:0; }\n #peers.solo .tile { position:absolute; inset:0; border:0; border-radius:0; min-height:0; }\n /* DUO (you + one other): remote FULL-SCREEN, you a PiP in the corner -- the 2-person call standard */\n #peers.duo { display:block; padding:0; }\n #peers.duo .tile { position:absolute; inset:0; border:0; border-radius:0; min-height:0; }\n #peers.duo .tile.self {\n inset:auto; right:14px; bottom:14px;\n width:min(30vw,150px); aspect" |
| 14 | const P7: *u8 = "-ratio:4/3; height:auto;\n border-radius:12px; border:2px solid rgba(255,255,255,.28);\n box-shadow:0 4px 20px rgba(0,0,0,.55); z-index:4; cursor:pointer; transition:transform .12s; }\n #peers.duo .tile.self:active { transform:scale(.96); }\n /* tap the PiP to SWAP who is big (FaceTime-style) */\n #peers.duo.swapped .tile { position:absolute; right:14px; bottom:14px; inset:auto;\n width:min(30vw,150px); aspect-ratio:4/3; height:auto; border-radius:12px;\n border:2px solid rgba(255,255,255,.28); box-shadow:0 4px 20px rgba(0,0,0,.55); z-index:4; }\n #peers.duo.swapped .tile.self { position:absolute; inset:0; right:auto; bottom:auto;\n width:auto; aspect-ratio:auto; border:0; border-radius:0; z-index:1; cursor:default; }\n /* EMBED mode (iframe on a 3rd-party site, ?embed=1): trim the marketing chrome for a clean widget */\n body.embed #lobby .foot { display:none; }\n body.embed #lobby h1 { font-size:1.3rem; }\n body.embed #lobby .sub { font-size:.82rem; }\n</style>\n</head>\n<body>\n\n<div id=\"lobby\">\n <h1>Nishi Family Video</h1>\n <p class=\"sub\">private family calls + video circles — served bits-up by the Nishi stack</p>\n <input id=\"room\" placeholder=\"room name (e.g. fa" |
| 15 | const P8: *u8 = "mily)\" autocomplete=\"off\" maxlength=\"24\">\n <input id=\"name\" placeholder=\"your name\" autocomplete=\"off\" maxlength=\"16\">\n <button id=\"join\">Join call</button>\n <button id=\"circlesBtn\" style=\"background:#1d1d26;border:1px solid #32323e;\">Video circles</button>\n <div class=\"foot\">pure Nishi from the hardware layer up — every media byte rides the family NAS's own TLS + relay, no WebRTC, no third-party anything</div>\n</div>\n\n<div id=\"stage\">\n <header><span id=\"roomLabel\"></span><span id=\"netLabel\" style=\"margin-left:auto\"></span></header>\n <div id=\"peers\"></div>\n <div id=\"chat\">\n <div id=\"chatlog\"></div>\n <div id=\"chatrow\">\n <input id=\"chatin\" placeholder=\"message the room\" maxlength=\"500\" autocomplete=\"off\">\n <button id=\"chatsend\">send</button>\n </div>\n </div>\n <div id=\"bar\">\n <button id=\"muteBtn\" class=\"on\" title=\"microphone\">🎤</button>\n <button id=\"camBtn\" class=\"on\" title=\"camera\">🎥</button>\n <button id=\"shareBtn\" title=\"share screen\">🖥</button>\n <button id=\"chatBtn\" title=\"room chat\">💬<span id=\"chatBadge\"></span></button>\n <button id=\"circleBtn\" class=\"rec\" title=\"record a circle\">⚫</button>\n <" |
| 16 | const P9: *u8 = "button id=\"inviteBtn\" title=\"copy invite link\">🔗</button>\n <button id=\"leaveBtn\" class=\"danger\" title=\"leave\">✕</button>\n </div>\n</div>\n\n<div id=\"circles\">\n <h2><button id=\"circlesBack\" style=\"background:none;border:0;color:#8a8a92;font-size:1.3rem;cursor:pointer\">←</button>\n Video circles <span id=\"circForRoom\" style=\"color:#8a8a92;font-size:.85rem\"></span></h2>\n <div class=\"row\">\n <button id=\"circRecBtn\">⚫ record new</button>\n <button id=\"circPubBtn\" class=\"on\">shared</button>\n <button id=\"circPrivBtn\">private archive</button>\n <span style=\"color:#6a6a74;font-size:.78rem\">private circles are saved to the family archive automatically — only people who know the room can review them</span>\n </div>\n <div id=\"cgrid\"></div>\n</div>\n\n<div id=\"recwrap\">\n <video id=\"recview\" autoplay playsinline muted></video>\n <div class=\"privrow\"><input type=\"checkbox\" id=\"recPriv\"><label for=\"recPriv\">private (auto-archive for reviewing later)</label></div>\n <div class=\"ctl\">\n <span id=\"rectimer\">0:00 / 1:00</span>\n <button id=\"recStop\" class=\"stop\">finish & send</button>\n <button id=\"recCancel\">cancel</button>\n </div>\n</div>\n\n<di" |
| 17 | const P10: *u8 = "v id=\"toast\"></div>\n\n<!-- CACHE-BUST (field 2026-07-05): a stale cached client = no vc = room stuck on JPEG + old bugs. Bump ?v= every client deploy (with BUILD + ver.txt). -->\n<script src=\"app.v2.js?v=761\"></script>\n</body>\n</html>\n" |
functions
| 19 | func ep(fd: i64, s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(fd,s,n); return n } |
| 21 | func main(argc: i64, argv: *i64) -> i64 |