MC/website/scripts/build-dunemarks.mjs
Dev 6deb4a2e7d DuneRealms V2 clean baseline
Owner-authorised history reset; current source tree preserved exactly.
2026-11-13 00:05:14 +01:00

15 lines
3.9 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import {readFileSync,writeFileSync} from 'node:fs';
const web=new URL('../web/',import.meta.url);
const series=[[1,'Stilgar','Desert stewardship and water cisterns'],[5,'Aliah','Ceremonial archives and celestial instruments'],[100,'Mira Vesk','Cartography, caravans and reservoirs'],[1000,'Ghanima','Imperial astronomy and gardens'],[5000,'Leto','An imagined game victory over House Harkonnen']];
const cards=series.map(([value,name,scene])=>`<figure class="dunemark-banknote" id="dunemark-${value}"><a href="assets/dunemark-${value}.webp" target="_blank" rel="noopener"><img src="assets/dunemark-${value}.webp" alt="Front and reverse of the ${value}-Dunemark note: Minecraft-style ${name}, ${scene.toLowerCase()}, and the original imperial seal" loading="lazy" width="1920" height="818"></a><figcaption><img class="currency-note-icon" src="assets/dunemark-${value}-icon-128.png" alt="${value}-Dunemark GUI icon" width="48" height="48"><strong>${value.toLocaleString('en')} Dunemarks · ${name}</strong> — ${scene}. Vaerkring Reserve.<br><a href="assets/dunemark-${value}-icon-64.png" download>64px transparent GUI icon</a> · <a href="assets/dunemark-${value}-icon-128.png" download>128px icon</a> · <a href="assets/dunemark-${value}.webp" download>Full note artwork</a></figcaption></figure>`).join('');
const zero='<h3>0 Dunemarks · In the search for Leto II</h3><p>A separate commemorative design. Not an in-game denomination, item, reward or redeemable note.</p><figure class="dunemark-banknote" id="dunemark-0"><a href="assets/dunemark-0-commemorative.webp" target="_blank" rel="noopener"><img src="assets/dunemark-0-commemorative.webp" alt="Commemorative zero-Dunemark front and reverse: Minecraft-style Leto II and a lantern-lit desert search party beneath twin moons" loading="lazy" width="1920" height="819"></a><figcaption>In the search for Leto II · Commemorative design · No cash value. <a href="assets/dunemark-0-commemorative.webp" download>Download the design →</a></figcaption></figure>';
const intro=`<section class="dunemark-art" id="dunemark-art"><div class="dunemark-heading"><img src="assets/imperial-seal-128.png" width="72" height="72" alt="Original imperial seal: crown, desert sun and dunes"><div><p class="eyebrow">VAERKRING RESERVE</p><h2>The Dunemark collection</h2></div></div><p>Five denominations, five distinctive designs. Parchment, deep teal and imperial gold connect the series; each note has its own Minecraft-style portrait, reverse scene and colour accents. The original crown, sun and dunes seal appears on every denomination.</p><p>${series.map(([v])=>`<a href="exchange.html#dunemark-${v}">${v.toLocaleString('en')} Dunemarks</a>`).join(' · ')}</p>${cards}${zero}<p>These are decorative game-currency designs with no cash value. They do not grant a balance, function as bearer tokens or replace the server’s currency ledger. The character editions are unofficial Dune fan artwork; the 5,000 scene is an imagined game interpretation, not a claim of book accuracy. No merchandise licence or rights-holder approval is implied.</p><p><a href="assets/imperial-seal.png" download>Download the original imperial seal →</a> · <a href="downloads/Dunemarks-ResourcePack-1.21.4.zip" download>Java GUI resource pack →</a></p></section>`;
const manualFile=new URL('manual-data.json',web),chapters=JSON.parse(readFileSync(manualFile,'utf8'));
const currency=chapters.find(chapter=>chapter.id==='solaris-spice-sales-and-guild-travel');
if(!currency)throw Error('Currency chapter missing');
currency.body=currency.body.replace(/<section class="dunemark-art"[\s\S]*?<\/section>/g,'');
currency.body=intro+currency.body;
writeFileSync(manualFile,JSON.stringify(chapters)+'\n');
const exchangeFile=new URL('exchange.html',web);let html=readFileSync(exchangeFile,'utf8').replace(/<section class="dunemark-art"[\s\S]*?<\/section>/g,'');
html=html.replace('</main>',intro+'</main>');writeFileSync(exchangeFile,html);
console.log('Built five Vaerkring Reserve denominations, icons and imperial seal');