1#!/usr/bin/env node2// Render the source page's decorative layer ("plate") with all text and chosen images3// hidden, then cut it into one PNG per Harmony band (header / sections / footer).4//5// node scripts/copy/render-plate.mjs <url> <outDir> --cuts header:0:65,main:65:1195,footer:1195:12546// [--width 1920] [--keep <img-src-substring>,…] [--prefix plate] [--scale 2]7//8// --cuts name:yStart:yEnd in source page pixels (from measure-source.mjs). One PNG per cut:9// <outDir>/<prefix>-<name>.png, exactly (width x (yEnd-yStart)).10// --width render width. Use the canvas width + 640 (1920 for a 1280 canvas) when the11// source is a centred fixed-width layout, so full-bleed strips still cover a12// wide viewport. Prefer ONE full-page cut set as a 'fill' background of a single13// auto-height section (it then scales with the page); see COPY-SITE.md.
55 const walk = (root) => { for (const e of root.querySelectorAll('*')) { if (getComputedStyle(e).position === 'fixed') { e.style.setProperty('display', 'none', 'important'); n++; } if (e.shadowRoot) walk(e.shadowRoot); } };