code wiki / _hdl_build / nx_reader_zoom_emit.nx

nx_reader_zoom_emit.nx

buildroot/runtime/_hdl_build/nx_reader_zoom_emit.nx

30785 B228 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind orphan librarytopic reader
docsdependenciesstructsconstsfunctions

about

nx_reader_zoom_emit.nx -- EMITS the sovereign INTELLIGENT-ZOOM viewer (census SC17 auto-zoom-to-panel + the ZUM tiled-zoom gap; ComiXology-class guided view). Organ-EMITTED per doctrine (SC58: no hand-dropped HTML; the zero-JS TEXT reader stays untouched -- this is the comic/scan MODE, where zoom+pan interactivity IS the product). Written to BOTH web_assets/nx_zoom_reader.html (durable demo) AND knowledge/staging/media/zoom.html (served ungated by the reader daemon at /zoom, like /reader + /cbx -- the shell holds no book data; every DATA fetch carries the no-cookie X-Nishi-Session token from sessionStorage.nx_sess, and tiles load via fetch->blob->objectURL because an <img src> cannot carry the header). modes: ?slug=<slug>[&page=N][&rtl=0|1] = the real reader (cbx.json page list via /api/book; lazy /api/zoomprep on a missing pyramid; page prev/next with guided continuity: past the last panel -> next page's first panel; before the first -> prev page's last panel; background-preps the next page) ?base=<dir-url> = direct demo over any nx_reader_page_prep output dir reading: SCROLL (webtoon long-strip, fit-width full pages, IntersectionObserver lazy load) is the default daily-driver; ZOOM is the guided/tiled DZI viewer. Toggle persists in localStorage (nx_rd_mode). Zoom viewer: only-visible-tile fetch per zoom level (DZI-class) . pinch/wheel/drag . double-tap a panel = INTELLIGENT zoom to that panel's rect . tap-zones (l/r page turn, mid controls) . fit page/width . 0-panel pages fall back to whole-page zoom. The emitted file contains NO double-quote characters (single-quote HTML/JS throughout) and the emitter REFUSES to write on any sovereignty violation (a stray double quote or an external <script src). Deterministic: same organ -> byte-identical files. license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_reader_zoom_emit.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

structs

none

consts

20const K_MAGIC_131072: i64 = 131072

functions

22func za(dst: *u8, o: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { dst[o + i] = s[i]; i = i + 1 } return o + i }
called by 1: zr_build
25func zr_build(dst: *u8) -> i64
196func zr_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
197func zr_w(s: *u8) -> i64 { sys_write(1, s, zr_slen(s)); return 0 }
198func zr_save(path: *u8, buf: *u8, n: i64) -> i64
206func main() -> i64