mirror of
https://github.com/elicpeter/nyx.git
synced 2026-07-18 21:21:03 +02:00
feat: Add asset mirroring for nyxscan.dev landing site and update favicon
This commit is contained in:
parent
e830fd0a7e
commit
e8f1c64dc9
2 changed files with 49 additions and 3 deletions
|
|
@ -70,6 +70,9 @@ const SCAN_ROOT = process.env.SCAN_ROOT || '/tmp/nyx-demo-app';
|
||||||
const OUT_DIR = process.env.OUT_DIR || '/Users/elipeter/nyx/assets/screenshots';
|
const OUT_DIR = process.env.OUT_DIR || '/Users/elipeter/nyx/assets/screenshots';
|
||||||
const FRAMER = process.env.FRAMER || '/Users/elipeter/nyx/scripts/frame-screenshots.py';
|
const FRAMER = process.env.FRAMER || '/Users/elipeter/nyx/scripts/frame-screenshots.py';
|
||||||
const NYX_BIN = process.env.NYX_BIN || '/Users/elipeter/nyx/target/release/nyx';
|
const NYX_BIN = process.env.NYX_BIN || '/Users/elipeter/nyx/target/release/nyx';
|
||||||
|
// Sibling marketing site that mirrors a small subset of these assets.
|
||||||
|
// Set NYXSCAN_DIR=skip to disable the mirror step.
|
||||||
|
const NYXSCAN_DIR = process.env.NYXSCAN_DIR || '/Users/elipeter/nyxscan.dev/assets/screenshots';
|
||||||
const VIEW = { width: 1440, height: 900 };
|
const VIEW = { width: 1440, height: 900 };
|
||||||
const COLOR_SCHEME = 'light';
|
const COLOR_SCHEME = 'light';
|
||||||
|
|
||||||
|
|
@ -590,6 +593,45 @@ function applyFrames(captured, { natural = false } = {}) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Mirror the small subset of assets used by the nyxscan.dev landing site
|
||||||
|
// so its screenshots can't drift from the canonical ones in this repo.
|
||||||
|
// Mirrors the *_raw originals (unframed) — nyxscan.dev draws its own
|
||||||
|
// frame/hero treatment in CSS and does not want the in-repo brand frame.
|
||||||
|
// Regenerates webp variants for the PNGs (used by hero <picture>/image-set).
|
||||||
|
// Skips silently when NYXSCAN_DIR=skip, the dir is missing, or cwebp is
|
||||||
|
// not on PATH; this is a convenience step, not a hard requirement.
|
||||||
|
const NYXSCAN_MIRROR = [
|
||||||
|
['docs/serve-overview_raw.png', 'overview.png'],
|
||||||
|
['docs/serve-finding-detail_raw.png', 'finding-detail.png'],
|
||||||
|
['cli-scan_raw.gif', 'cli-scan.gif'],
|
||||||
|
];
|
||||||
|
function syncNyxscanDev() {
|
||||||
|
if (NYXSCAN_DIR === 'skip') return;
|
||||||
|
if (!existsSync(NYXSCAN_DIR)) {
|
||||||
|
console.error(`[nyxscan] skip — ${NYXSCAN_DIR} does not exist`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let cwebpAvailable = true;
|
||||||
|
try {
|
||||||
|
execFileSync('cwebp', ['-version'], { stdio: 'ignore' });
|
||||||
|
} catch {
|
||||||
|
cwebpAvailable = false;
|
||||||
|
console.error('[nyxscan] cwebp not on PATH — copying PNGs only, webp will be stale');
|
||||||
|
}
|
||||||
|
for (const [srcRel, dstName] of NYXSCAN_MIRROR) {
|
||||||
|
const src = join(OUT_DIR, srcRel);
|
||||||
|
if (!existsSync(src)) continue;
|
||||||
|
const dst = join(NYXSCAN_DIR, dstName);
|
||||||
|
copyFileSync(src, dst);
|
||||||
|
console.error(`[nyxscan] ${srcRel} -> ${dstName}`);
|
||||||
|
if (cwebpAvailable && dstName.endsWith('.png')) {
|
||||||
|
const webp = dst.slice(0, -4) + '.webp';
|
||||||
|
execFileSync('cwebp', ['-quiet', '-q', '82', dst, '-o', webp], { stdio: 'inherit' });
|
||||||
|
console.error(`[nyxscan] ${dstName.slice(0, -4)}.webp`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Main -----------------------------------------------------------------------
|
// Main -----------------------------------------------------------------------
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
|
|
@ -684,6 +726,8 @@ async function main() {
|
||||||
const cli = CLI_PNGS.map((p) => join(OUT_DIR, p));
|
const cli = CLI_PNGS.map((p) => join(OUT_DIR, p));
|
||||||
applyFrames(cli, { natural: true });
|
applyFrames(cli, { natural: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
syncNyxscanDev();
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
if (browser) await browser.close();
|
if (browser) await browser.close();
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" role="img" aria-label="Nyx">
|
||||||
<rect width="32" height="32" rx="6" fill="#1a1a2e"/>
|
<rect width="64" height="64" rx="12" fill="#08090b"/>
|
||||||
<text x="16" y="23" font-family="system-ui" font-size="20" font-weight="bold" fill="#e94560" text-anchor="middle">N</text>
|
<path d="M15 34h34" stroke="#72f3d7" stroke-width="5" stroke-linecap="round"/>
|
||||||
|
<path d="M22 24h20" stroke="#93e48b" stroke-width="4" stroke-linecap="round"/>
|
||||||
|
<path d="M25 44h14" stroke="#e9c46a" stroke-width="4" stroke-linecap="round"/>
|
||||||
</svg>
|
</svg>
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 248 B After Width: | Height: | Size: 395 B |
Loading…
Add table
Add a link
Reference in a new issue