Unify shared chrome and add colour-coded V2 workspace publication badges

This commit is contained in:
unimatrixgit 2026-11-15 00:38:46 +01:00
commit ee6e8be908
11 changed files with 68 additions and 8 deletions

View file

@ -18,7 +18,7 @@ import {initializeCompanyRegistry,listPublicCompanies} from './company-registry.
import {initializeShareLedger} from './share-ledger.mjs';
import {createPublicNews} from './news.mjs';
const root=new URL('./public/',import.meta.url);
const security={'X-Content-Type-Options':'nosniff','Referrer-Policy':'strict-origin-when-cross-origin','Content-Security-Policy':"default-src 'self'; frame-src https://cp.dunerealms.com; img-src 'self' https://cp.dunerealms.com https://support.dunerealms.com https://forums.dunerealms.com data:; style-src 'self' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; script-src 'self'; connect-src 'self' https://cp.dunerealms.com; base-uri 'self'; object-src 'none'; frame-ancestors 'self'"};
const security={'X-Content-Type-Options':'nosniff','Referrer-Policy':'strict-origin-when-cross-origin','Content-Security-Policy':"default-src 'self'; frame-src https://cp.dunerealms.com; img-src 'self' https://www.dunerealms.com https://cp.dunerealms.com https://support.dunerealms.com https://forums.dunerealms.com data:; style-src 'self' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; script-src 'self'; connect-src 'self' https://cp.dunerealms.com; base-uri 'self'; object-src 'none'; frame-ancestors 'self'"};
export function createApplication(db,settings={}) {
const origin=new URL(settings.PUBLIC_ORIGIN||'https://dunerealms.com').origin;
const auth=createAuth(db,origin);

View file

@ -1,3 +1,4 @@
import {SHARED_HEADER} from './portal-navigation.mjs';
import {PACKAGES,BANK_VERSION} from '../node/postbank-catalogue.mjs';
import {CREDIT_PRODUCTS,CREDIT_VERSION} from '../node/postbank-credit-model.mjs';
import {createHash} from 'node:crypto';
@ -5,5 +6,5 @@ export function bankRatesPage(){
const version=createHash('sha256').update(JSON.stringify([PACKAGES,CREDIT_PRODUCTS])).digest('hex').slice(0,10);
const packages=PACKAGES.map(p=>`<tr><th>${p.name}</th><td>${p.kinds.join(' / ')}</td><td>${(p.monthly/100).toFixed(2)} DM</td><td>${p.extra}</td><td>${p.extra?(p.extraFee/100).toFixed(2)+' DM':'—'}</td><td>${p.instant}</td></tr>`).join('');
const credit=CREDIT_PRODUCTS.filter(p=>!p.revolving).map(p=>`<tr><th>${p.name}</th><td>${(p.annualBps/100).toFixed(2)}%</td><td>${p.min}–${p.max} DM</td><td>${p.terms?p.terms.join(', '):'Up to '+p.maxMonths} months</td></tr>`).join('');
return `<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Rates &amp; Charges | Imperial Postbank</title><meta name="description" content="Public Imperial Postbank package fees, credit rates and service conditions in Dunemarks."><link rel="stylesheet" href="/bank-rates.css"><script src="/portal-navigation.js" defer></script></head><body><header><a href="/">DuneRealms</a></header><main><section class="hero"><img src="/assets/imperial-postbank-v2.png" alt="Imperial Postbank"><div><p class="eyebrow">YOUR MONEY. CLEAR TERMS.</p><h1>Rates &amp; Charges</h1><p>A clear guide to your banking costs.</p><span class="stamp">PUBLIC TARIFF GUIDE · ${version}</span></div></section><nav class="sections" aria-label="Tariff sections"><a href="#packages">Accounts &amp; packages</a><a href="#credit">Credit rates</a><a href="#services">Services &amp; taxes</a></nav><aside class="notice"><strong>Alpha service notice</strong><p>All amounts are fictional Dunemarks (DM). Published monthly package prices are not yet collected automatically. This is a game economy, not a real-money banking service.</p></aside><section id="packages"><span class="eyebrow">01 / EVERYDAY BANKING</span><h2>Accounts &amp; packages</h2><p>One current account is included in each package.</p><div class="table-wrap"><table><thead><tr><th>Package</th><th>Client</th><th>Monthly price</th><th>Extra current accounts¹</th><th>Each / month¹</th><th>Instant quota / month</th></tr></thead><tbody>${packages}</tbody></table></div><p class="fine">¹ Published additional-account limits and prices, subject to feature availability. Flow includes a savings account. Start has no instant payments. Instant quotas are server usage limits.</p></section><section id="credit"><span class="eyebrow">02 / BORROWING</span><h2>Credit rates</h2><p>Annual rates for new applications. Your accepted contract and repayment schedule govern your loan.</p><div class="table-wrap"><table><thead><tr><th>Product</th><th>Annual rate</th><th>Principal range</th><th>Available terms</th></tr></thead><tbody>${credit}</tbody></table></div><p class="fine">Launch grants are repayable at 0% interest. Ordinary loans require review and 25% blocked DM collateral. Eligibility, available funding and refinancing conditions apply. Existing fixed-rate contracts retain their agreed rate. Revolving credit is not available.</p></section><section id="services"><span class="eyebrow">03 / TRANSPARENCY</span><h2>Services &amp; taxes</h2><div class="service-grid"><article><h3>Monthly statements</h3><strong>Free</strong><p>Automatically archived PDF statements after month-end.</p></article><article><h3>Balance Guard</h3><strong>1.00 DM / month</strong><p>Published optional price per eligible account. Preference saving is available; protection and charging are not active yet.</p></article><article><h3>Tax policy</h3><strong>Not yet published</strong><p>VAT and account-tax rates await central configuration. No unconfirmed rate is presented as active.</p></article></div></section><section class="document"><div><h2>Your tariff guide</h2><p>Generated from the bank catalogues on each build. Version ${version}. Package terms: ${BANK_VERSION}. Credit terms: ${CREDIT_VERSION}.</p><p class="fine">Catalogue references identify source terms, not a new effective date. Administrative rate editing and automatic downloadable PDF publication are planned. You can print or save this guide as PDF now.</p></div><button onclick="window.print()">Print / Save as PDF</button></section><p class="fine">No private account or transaction data is published here.</p></main><footer><a href="/">DuneRealms</a><a href="/rates-and-charges.html">Rates &amp; Charges</a><a href="https://support.dunerealms.com/">Contact support</a></footer></body></html>`;
return `<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Rates &amp; Charges | Imperial Postbank</title><meta name="description" content="Public Imperial Postbank package fees, credit rates and service conditions in Dunemarks."><link rel="stylesheet" href="/bank-rates.css"><link rel="stylesheet" href="/portal-navigation.css"><script src="/portal-navigation.js" defer></script></head><body>${SHARED_HEADER}<main><section class="hero"><img src="/assets/imperial-postbank-v2.png" alt="Imperial Postbank"><div><p class="eyebrow">YOUR MONEY. CLEAR TERMS.</p><h1>Rates &amp; Charges</h1><p>A clear guide to your banking costs.</p><span class="stamp">PUBLIC TARIFF GUIDE · ${version}</span></div></section><nav class="sections" aria-label="Tariff sections"><a href="#packages">Accounts &amp; packages</a><a href="#credit">Credit rates</a><a href="#services">Services &amp; taxes</a></nav><aside class="notice"><strong>Alpha service notice</strong><p>All amounts are fictional Dunemarks (DM). Published monthly package prices are not yet collected automatically. This is a game economy, not a real-money banking service.</p></aside><section id="packages"><span class="eyebrow">01 / EVERYDAY BANKING</span><h2>Accounts &amp; packages</h2><p>One current account is included in each package.</p><div class="table-wrap"><table><thead><tr><th>Package</th><th>Client</th><th>Monthly price</th><th>Extra current accounts¹</th><th>Each / month¹</th><th>Instant quota / month</th></tr></thead><tbody>${packages}</tbody></table></div><p class="fine">¹ Published additional-account limits and prices, subject to feature availability. Flow includes a savings account. Start has no instant payments. Instant quotas are server usage limits.</p></section><section id="credit"><span class="eyebrow">02 / BORROWING</span><h2>Credit rates</h2><p>Annual rates for new applications. Your accepted contract and repayment schedule govern your loan.</p><div class="table-wrap"><table><thead><tr><th>Product</th><th>Annual rate</th><th>Principal range</th><th>Available terms</th></tr></thead><tbody>${credit}</tbody></table></div><p class="fine">Launch grants are repayable at 0% interest. Ordinary loans require review and 25% blocked DM collateral. Eligibility, available funding and refinancing conditions apply. Existing fixed-rate contracts retain their agreed rate. Revolving credit is not available.</p></section><section id="services"><span class="eyebrow">03 / TRANSPARENCY</span><h2>Services &amp; taxes</h2><div class="service-grid"><article><h3>Monthly statements</h3><strong>Free</strong><p>Automatically archived PDF statements after month-end.</p></article><article><h3>Balance Guard</h3><strong>1.00 DM / month</strong><p>Published optional price per eligible account. Preference saving is available; protection and charging are not active yet.</p></article><article><h3>Tax policy</h3><strong>Not yet published</strong><p>VAT and account-tax rates await central configuration. No unconfirmed rate is presented as active.</p></article></div></section><section class="document"><div><h2>Your tariff guide</h2><p>Generated from the bank catalogues on each build. Version ${version}. Package terms: ${BANK_VERSION}. Credit terms: ${CREDIT_VERSION}.</p><p class="fine">Catalogue references identify source terms, not a new effective date. Administrative rate editing and automatic downloadable PDF publication are planned. You can print or save this guide as PDF now.</p></div><button onclick="window.print()">Print / Save as PDF</button></section><p class="fine">No private account or transaction data is published here.</p></main><footer><a href="/">DuneRealms</a><a href="/rates-and-charges.html">Rates &amp; Charges</a><a href="https://support.dunerealms.com/">Contact support</a></footer></body></html>`;
}

View file

@ -1,3 +1,4 @@
import {SHARED_CHROME_STYLE} from './shared-chrome-style.mjs';
import{CANONICAL_MENU_SCRIPT}from'./main-menu.mjs';
import{recordPageUpdates,menuBadgeScript}from'./menu-updates.mjs';
import {RELEASE_SCRIPT,RELEASE_CSS} from './release-branding.mjs';
@ -5,7 +6,7 @@ import {BUTTON_CSS,BUTTON_SCRIPT} from './dune-buttons.mjs';
import {readFileSync,writeFileSync,readdirSync} from 'node:fs';
import {updatePortalNavigation,PORTAL_CSS,PORTAL_SCRIPT,CONTEXT_SCRIPT,CONTEXT_CSS} from './portal-navigation.mjs';
const web=new URL('../web/',import.meta.url);
writeFileSync(new URL('portal-navigation.css',web),PORTAL_CSS+CONTEXT_CSS+BUTTON_CSS+RELEASE_CSS);
writeFileSync(new URL('portal-navigation.css',web),PORTAL_CSS+CONTEXT_CSS+BUTTON_CSS+RELEASE_CSS+SHARED_CHROME_STYLE);
recordPageUpdates();
writeFileSync(new URL('portal-navigation.js',web),PORTAL_SCRIPT+CONTEXT_SCRIPT+BUTTON_SCRIPT+RELEASE_SCRIPT+menuBadgeScript()+CANONICAL_MENU_SCRIPT);
writeFileSync(new URL('dune-actions.css',web),BUTTON_CSS);

View file

@ -27,3 +27,7 @@ console.log('Shared header installed in CP and native integration templates');
// The Clan center serves local copies to retain the same masthead styles.
const clans='/home/dunerealms/htdocs/clans.dunerealms.com';
if(existsSync(clans+'/index.html')){writeFileSync(clans+'/dune-navigation.css',PORTAL_CSS+CONTEXT_CSS+BUTTON_CSS+RELEASE_CSS);writeFileSync(clans+'/dune-navigation.js',PORTAL_SCRIPT+CONTEXT_SCRIPT+BUTTON_SCRIPT+RELEASE_SCRIPT);}
// Persistent shared nginx aliases read these exact files on every site.
const chrome='/var/lib/dunerealms-public-rates';
if(existsSync(chrome)){for(const file of ['portal-navigation.js','portal-navigation.css','menu-new-items.json'])copyFileSync(release+'/web/'+file,chrome+'/'+file);}

View file

@ -1,7 +1,7 @@
import{readFileSync,writeFileSync}from'node:fs';import{execFileSync}from'node:child_process';import{fileURLToPath}from'node:url';import path from'node:path';import{RELEASE_VERSION}from'./release-branding.mjs';
export function pagesForChanges(paths){const pages=new Set();for(let p of paths){p=p.replaceAll('\\','/');if(/website\/node\/staff-roster\.mjs$/.test(p))pages.add('https://www.dunerealms.com/staff.html');if(/website\/node\/memorials\.mjs$|website\/node\/public\/memorial\./.test(p))pages.add('https://www.dunerealms.com/');if(/website\/control-panel\//.test(p)||/website\/node\/(auth|permissions|account-admin|account-archive|honours|profile)\.mjs$/.test(p))pages.add('https://cp.dunerealms.com/');if(/website\/integrations\/azuriom\//.test(p))pages.add('https://www.dunerealms.com/shop.html');if(/website\/integrations\/osticket\//.test(p))pages.add('https://support.dunerealms.com/');if(/website\/web\/([a-z-]+)\.html$/.test(p)){const name=p.match(/([^/]+)\.html$/)[1];pages.add('https://www.dunerealms.com/'+(['index','portal'].includes(name)?'':name+'.html'));}}return[...pages].sort();}
export function recordPageUpdates({root=fileURLToPath(new URL('../',import.meta.url)),paths,version=RELEASE_VERSION}={}){if(!/^\d+(?:\.\d+){3}$/.test(version))throw Error('Invalid release');const repo=path.resolve(root,'..');if(paths===undefined){let changed='';try{const gitRoot=execFileSync('git',['rev-parse','--show-toplevel'],{cwd:repo,encoding:'utf8',stdio:['ignore','pipe','ignore']}).trim();if(path.resolve(gitRoot)===repo)changed=execFileSync('git',['diff','--name-only','HEAD'],{cwd:repo,encoding:'utf8'}).trim();}catch(error){if(error?.status!==128&&error?.status!==129&&error?.code!=='ENOENT')throw error;}paths=changed?changed.split('\n'):[];}const file=path.join(root,'web/menu-new-items.json'),data=JSON.parse(readFileSync(file,'utf8'));const pages=pagesForChanges(paths);for(const href of pages){let entry=data.items.find(x=>x.href===href);if(!entry){entry={href};data.items.push(entry);}entry.updatedIn=version;entry.badge=entry.introducedIn===version?'NEW':'UPDATE';}writeFileSync(file,JSON.stringify(data,null,2)+'\n');return pages;}
export function menuBadgeScript(){const data=JSON.parse(readFileSync(new URL('../web/menu-new-items.json',import.meta.url),'utf8'));return `\n/* Central automatic release menu badges */\n(()=>{let items=${JSON.stringify(data.items)};function mark(){const release=document.querySelector('.dune-release-badge')?.textContent.match(/\\d+(?:\\.\\d+){3}/)?.[0];if(!release)return;for(const a of document.querySelectorAll('header nav[aria-label="Main navigation"] a')){const item=items.find(x=>x.href===a.href),label=item?.introducedIn===release?'NEW':item?.updatedIn===release?'UPDATE':null;let tag=a.querySelector('.dune-new-overlay');if(label){if(!tag){tag=document.createElement('span');tag.className='dune-new-overlay';a.append(tag);}if(tag.textContent!==label)tag.textContent=label;tag.classList.toggle('dune-update-overlay',label==='UPDATE');tag.setAttribute('aria-label',label==='NEW'?'New this release':'Updated this release');}else if(tag)tag.remove();}}fetch('https://www.dunerealms.com/menu-new-items.json',{cache:'no-store'}).then(r=>r.ok?r.json():null).then(data=>{if(Array.isArray(data?.items)){items=data.items;mark();}}).catch(()=>{});mark();new MutationObserver(mark).observe(document.body,{childList:true,subtree:true,characterData:true});})();\n`;}
export function menuBadgeScript(){const data=JSON.parse(readFileSync(new URL('../web/menu-new-items.json',import.meta.url),'utf8'));return `\n/* Central automatic release menu badges */\n(()=>{let items=${JSON.stringify(data.items)};function mark(){const release=document.querySelector('.dune-release-badge')?.textContent.match(/\\d+(?:\\.\\d+){3}/)?.[0];for(const a of document.querySelectorAll('header nav[aria-label="Main navigation"] a,#portals .portal[data-id]')){const href=a.matches('#portals .portal')?'https://cp.dunerealms.com/#'+a.dataset.id:a.href;const item=items.find(x=>x.href===href),label=['NEW','UPDATE'].includes(item?.badge)?item.badge:item?.introducedIn===release?'NEW':item?.updatedIn===release?'UPDATE':null;let tag=a.querySelector('.dune-new-overlay');if(label){if(!tag){tag=document.createElement('span');tag.className='dune-new-overlay';a.append(tag);}if(tag.textContent!==label)tag.textContent=label;tag.classList.toggle('dune-update-overlay',label==='UPDATE');tag.setAttribute('aria-label',label==='NEW'?'New this release':'Updated this release');}else if(tag)tag.remove();}}fetch('https://www.dunerealms.com/menu-new-items.json',{cache:'no-store'}).then(r=>r.ok?r.json():null).then(data=>{if(Array.isArray(data?.items)){items=data.items;mark();}}).catch(()=>{});mark();new MutationObserver(mark).observe(document.body,{childList:true,subtree:true,characterData:true});})();\n`;}
export function withMenuBadges(s){return s.replace(/\n?\/\* Central automatic release menu badges \*\/[\s\S]*?(?=\n\/\*|$)/,'').replace(/\(\(\)=>\{const items=\[[\s\S]*?new MutationObserver\(mark\)\.observe\(document.body,\{childList:true,subtree:true,characterData:true\}\);\}\)\(\);/,'')+menuBadgeScript();}
export function patchMenuBadges(root=fileURLToPath(new URL('../',import.meta.url))){const file=path.join(root,'web/portal-navigation.js');writeFileSync(file,withMenuBadges(readFileSync(file,'utf8')));}
if(process.argv[1]&&path.resolve(process.argv[1])===fileURLToPath(import.meta.url)){const pages=recordPageUpdates();patchMenuBadges();console.log('Central release badges updated for '+pages.length+' changed pages.');}

View file

@ -0,0 +1 @@
export const SHARED_CHROME_STYLE="\n/* Shared chrome must not inherit native forum/support link decorations. */\nheader.dune-site-header nav[aria-label=\"Main navigation\"] a,header.dune-site-header .wordmark,.dune-shared-footer a{text-decoration:none!important}header.dune-site-header nav[aria-label=\"Main navigation\"] a{font-family:Arial,sans-serif!important;line-height:1.35!important}.dune-shared-footer{font-family:Arial,sans-serif!important}.dune-shared-footer a:hover{text-decoration:underline!important}\n\n#portals .portal{position:relative}#portals .portal>.dune-new-overlay{position:absolute;top:9px;right:10px;padding:3px 8px;border:1px solid #c7a65c;border-radius:12px;background:#bba05c;color:#10251f;font:700 10px/1.2 Arial,sans-serif;letter-spacing:.06em}#portals .portal>.dune-update-overlay{background:#1b4d43;color:#bfe4d3;border-color:#6ba58e}\n\n/* One V2 banking-style surface, seven recognisable workspace accents. */\n#portals .portal{--workspace-accent:#d2b66d;isolation:isolate;overflow:hidden;background:linear-gradient(145deg,color-mix(in srgb,var(--workspace-accent) 15%,#142e24),#10251f)!important;border-color:color-mix(in srgb,var(--workspace-accent) 70%,#475841)!important;box-shadow:inset 0 1px 0 #ffffff0b,0 4px 12px #0002}\n#portals .portal::before{content:'';position:absolute;inset:0;z-index:-1;background:radial-gradient(ellipse at 85% 0%,color-mix(in srgb,var(--workspace-accent) 17%,transparent),transparent 65%);pointer-events:none}\n#portals .portal[data-id=\"realm\"]{--workspace-accent:#8dcbb1}#portals .portal[data-id=\"bureau\"]{--workspace-accent:#cbb680}#portals .portal[data-id=\"forge\"]{--workspace-accent:#a9a1d6}#portals .portal[data-id=\"politics\"]{--workspace-accent:#d0a56b}#portals .portal[data-id=\"post\"]{--workspace-accent:#86bacd}#portals .portal[data-id=\"bank\"]{--workspace-accent:#e1c66c}#portals .portal[data-id=\"market\"]{--workspace-accent:#cb9b7d}\n#portals .portal>span:not(.dune-new-overlay){color:var(--workspace-accent)}#portals .portal.active,#portals .portal[aria-current=\"page\"]{outline:2px solid var(--workspace-accent);outline-offset:-2px}#portals .portal:focus-visible{outline:3px solid #fff1c1;outline-offset:3px}\n";

View file

@ -21,3 +21,5 @@ test('Explicit changed paths still update menu badges without Git metadata',()=>
const data=JSON.parse(readFileSync(manifest,'utf8'));assert.equal(data.items[0].updatedIn,'1.0.0.4');
}finally{rmSync(repo,{recursive:true,force:true});}
});
test('V2 workspace tiles use the shared manifest even with the simple Alpha header',()=>{const s=menuBadgeScript();assert(s.includes('#portals .portal[data-id]'));assert(s.includes("'https://cp.dunerealms.com/#'+a.dataset.id"));assert(!s.includes('if(!release)return'));new Function(s);});

View file

@ -56,6 +56,46 @@
"href": "https://cp.dunerealms.com/#kits-exchange",
"introducedIn": "1.0.0.5",
"badge": "NEW"
},
{
"href": "https://cp.dunerealms.com/#realm",
"badge": "NEW",
"introducedIn": "v2-api"
},
{
"href": "https://cp.dunerealms.com/#bureau",
"badge": "NEW",
"introducedIn": "v2-api"
},
{
"href": "https://cp.dunerealms.com/#forge",
"badge": "NEW",
"introducedIn": "v2-api"
},
{
"href": "https://cp.dunerealms.com/#politics",
"badge": "NEW",
"introducedIn": "v2-api"
},
{
"href": "https://cp.dunerealms.com/#post",
"badge": "NEW",
"introducedIn": "v2-api"
},
{
"href": "https://cp.dunerealms.com/#bank",
"badge": "NEW",
"introducedIn": "v2-api"
},
{
"href": "https://cp.dunerealms.com/#market",
"badge": "NEW",
"introducedIn": "v2-api"
},
{
"href": "https://www.dunerealms.com/rates-and-charges.html",
"updatedIn": "1.0.1.0",
"badge": "UPDATE"
}
]
}

View file

@ -116,3 +116,14 @@ header.dune-site-header .dune-memorial .dune-memorial-dedication blockquote{back
/* Native applications must use the same link spacing as the public header. */
header.dune-site-header>nav[aria-label="Main navigation"]>a{display:inline-flex!important;align-items:center!important;gap:8px!important}@media(min-width:1241px){header.dune-site-header>button.menu-toggle{display:none!important}}
/* Shared chrome must not inherit native forum/support link decorations. */
header.dune-site-header nav[aria-label="Main navigation"] a,header.dune-site-header .wordmark,.dune-shared-footer a{text-decoration:none!important}header.dune-site-header nav[aria-label="Main navigation"] a{font-family:Arial,sans-serif!important;line-height:1.35!important}.dune-shared-footer{font-family:Arial,sans-serif!important}.dune-shared-footer a:hover{text-decoration:underline!important}
#portals .portal{position:relative}#portals .portal>.dune-new-overlay{position:absolute;top:9px;right:10px;padding:3px 8px;border:1px solid #c7a65c;border-radius:12px;background:#bba05c;color:#10251f;font:700 10px/1.2 Arial,sans-serif;letter-spacing:.06em}#portals .portal>.dune-update-overlay{background:#1b4d43;color:#bfe4d3;border-color:#6ba58e}
/* One V2 banking-style surface, seven recognisable workspace accents. */
#portals .portal{--workspace-accent:#d2b66d;isolation:isolate;overflow:hidden;background:linear-gradient(145deg,color-mix(in srgb,var(--workspace-accent) 15%,#142e24),#10251f)!important;border-color:color-mix(in srgb,var(--workspace-accent) 70%,#475841)!important;box-shadow:inset 0 1px 0 #ffffff0b,0 4px 12px #0002}
#portals .portal::before{content:'';position:absolute;inset:0;z-index:-1;background:radial-gradient(ellipse at 85% 0%,color-mix(in srgb,var(--workspace-accent) 17%,transparent),transparent 65%);pointer-events:none}
#portals .portal[data-id="realm"]{--workspace-accent:#8dcbb1}#portals .portal[data-id="bureau"]{--workspace-accent:#cbb680}#portals .portal[data-id="forge"]{--workspace-accent:#a9a1d6}#portals .portal[data-id="politics"]{--workspace-accent:#d0a56b}#portals .portal[data-id="post"]{--workspace-accent:#86bacd}#portals .portal[data-id="bank"]{--workspace-accent:#e1c66c}#portals .portal[data-id="market"]{--workspace-accent:#cb9b7d}
#portals .portal>span:not(.dune-new-overlay){color:var(--workspace-accent)}#portals .portal.active,#portals .portal[aria-current="page"]{outline:2px solid var(--workspace-accent);outline-offset:-2px}#portals .portal:focus-visible{outline:3px solid #fff1c1;outline-offset:3px}

View file

@ -48,9 +48,6 @@
/* DuneGit repository footer link */
(()=>{function link(){const foot=document.querySelector('.dune-shared-footer');if(!foot)return;const nav=foot.querySelector('nav');if(!nav)return;let a=nav.querySelector('[data-dune-git-footer]');if(!a){a=document.createElement('a');a.dataset.duneGitFooter='1';nav.append(a);}a.href='https://www.dunerealms.com/git/unimatrix/MC';a.textContent='DuneGit';}link();new MutationObserver(link).observe(document.body,{childList:true});addEventListener('hashchange',link);})();
/* Central automatic release menu badges */
(()=>{let items=[{"href":"https://cp.dunerealms.com/#shop","introducedIn":"1.0.0.2","badge":"NEW"},{"href":"https://wiki.dunerealms.com/","introducedIn":"1.0.0.2","badge":"NEW"},{"href":"https://clans.dunerealms.com/","introducedIn":"1.0.0.2","badge":"NEW"},{"href":"https://cp.dunerealms.com/","badge":"NEW","introducedIn":"1.0.0.3"},{"href":"https://cp.dunerealms.com/#exchange","updatedIn":"1.0.0.2","badge":"UPDATE"},{"href":"https://support.dunerealms.com/","updatedIn":"1.0.0.3","badge":"UPDATE"},{"href":"https://www.dunerealms.com/staff.html","updatedIn":"1.0.0.3","badge":"UPDATE"},{"href":"https://www.dunerealms.com/","badge":"NEW","introducedIn":"1.0.0.3","updatedIn":"1.0.0.3"},{"href":"https://www.dunerealms.com/shop.html","updatedIn":"1.0.0.3","badge":"UPDATE"}];function mark(){const release=document.querySelector('.dune-release-badge')?.textContent.match(/\d+(?:\.\d+){3}/)?.[0];if(!release)return;for(const a of document.querySelectorAll('header nav[aria-label="Main navigation"] a')){const item=items.find(x=>x.href===a.href),label=item?.introducedIn===release?'NEW':item?.updatedIn===release?'UPDATE':null;let tag=a.querySelector('.dune-new-overlay');if(label){if(!tag){tag=document.createElement('span');tag.className='dune-new-overlay';a.append(tag);}if(tag.textContent!==label)tag.textContent=label;tag.classList.toggle('dune-update-overlay',label==='UPDATE');tag.setAttribute('aria-label',label==='NEW'?'New this release':'Updated this release');}else if(tag)tag.remove();}}fetch('https://www.dunerealms.com/menu-new-items.json',{cache:'no-store'}).then(r=>r.ok?r.json():null).then(data=>{if(Array.isArray(data?.items)){items=data.items;mark();}}).catch(()=>{});mark();new MutationObserver(mark).observe(document.body,{childList:true,subtree:true,characterData:true});})();
/* Dune canonical menu begin */
(()=>{if(window.top!==window.self)return;const MAIN_MENU=[["Home","https://www.dunerealms.com/","nav-home-v2.webp"],["Shop","https://www.dunerealms.com/shop.html","nav-exchange-full-v2.webp"],["Boards","https://forums.dunerealms.com/","nav-boards-v2.webp"],["Staff roster","https://www.dunerealms.com/staff.html","nav-staff-v2.webp"],["Discord","https://www.dunerealms.com/discord.html","nav-discord-v2.webp"],["Exchange","https://www.dunerealms.com/exchange.html","nav-exchange-v2.webp"],["Kit Exchange","https://www.dunerealms.com/kits.html","items/office_water.png"],["Support center","https://support.dunerealms.com/","nav-support-v2.webp"],["Account center","https://cp.dunerealms.com/","nav-account-v2.webp"],["Clan center","https://clans.dunerealms.com/","nav-clan-v2.webp"],["Dunopedia","https://wiki.dunerealms.com/","nav-manual-v2.webp"]];const canonicalMenuHref=function canonicalMenuHref(value){const u=new URL(value,'https://www.dunerealms.com');if(u.hostname==='dunerealms.com')u.hostname='www.dunerealms.com';if(u.hostname==='www.dunerealms.com'&&/^\/(manual|wiki)\.html$/.test(u.pathname))return'https://wiki.dunerealms.com/';if(u.hostname==='cp.dunerealms.com'&&u.pathname==='/'){if(u.hash==='#shop')return'https://www.dunerealms.com/shop.html';if(u.hash==='#exchange')return'https://www.dunerealms.com/exchange.html';}if(['forums','support','cp','clans','wiki'].some(h=>u.hostname===h+'.dunerealms.com'))return u.origin+'/';return u.origin+(u.pathname==='/index.html'?'/':u.pathname);};const normalizeMainMenus=function normalizeMainMenus(doc,currentUrl,links=MAIN_MENU){let changes=0;const set=(node,key,value)=>{if(node.getAttribute(key)!==value){node.setAttribute(key,value);changes++;}};
for(const nav of doc.querySelectorAll('header nav[aria-label="Main navigation"]')){const old=[...nav.querySelectorAll('a')],ordered=[];for(const[name,href,icon]of links){let a=old.find(x=>!ordered.includes(x)&&canonicalMenuHref(x.href)===href);if(!a){a=doc.createElement('a');changes++;}set(a,'href',href);let image=a.querySelector('img');if(!image){image=doc.createElement('img');a.insertBefore(image,a.firstChild);changes++;}set(image,'src','https://www.dunerealms.com/assets/'+icon);set(image,'alt','');set(image,'width','34');set(image,'height','34');let label=[...a.children].find(x=>x.tagName==='SPAN'&&!x.classList.contains('dune-new-overlay')&&!x.classList.contains('dune-sales-overlay'));if(!label){label=doc.createElement('span');a.append(label);changes++;}set(label,'data-dune-nav-label','1');if(label.textContent!==name){label.textContent=name;changes++;}for(const n of [...a.childNodes])if(n.nodeType===3){n.remove();changes++;}const active=canonicalMenuHref(currentUrl)===href;if(active)set(a,'aria-current','page');else if(a.hasAttribute('aria-current')){a.removeAttribute('aria-current');changes++;}ordered.push(a);}
@ -63,3 +60,6 @@
(()=>{function sync(){const nav=document.querySelector('.dune-shared-footer nav');if(!nav)return;let a=nav.querySelector('[data-dune-api-footer]');if(!a){a=document.createElement('a');a.dataset.duneApiFooter='1';nav.append(a);}a.href='https://www.dunerealms.com/api.html';a.textContent='Developer API';}sync();new MutationObserver(sync).observe(document.body,{childList:true});})();
(()=>{function sync(){const nav=document.querySelector('.dune-shared-footer nav');if(!nav||nav.querySelector('[data-bank-rates]'))return;const a=document.createElement('a');a.dataset.bankRates='1';a.href='https://www.dunerealms.com/rates-and-charges.html';a.textContent='Rates & Charges';nav.append(a);}sync();new MutationObserver(sync).observe(document.body,{childList:true,subtree:true});})();
/* Central automatic release menu badges */
(()=>{let items=[{"href":"https://cp.dunerealms.com/#shop","introducedIn":"1.0.0.2","badge":"NEW"},{"href":"https://wiki.dunerealms.com/","introducedIn":"1.0.0.2","badge":"NEW"},{"href":"https://clans.dunerealms.com/","introducedIn":"1.0.0.2","badge":"NEW"},{"href":"https://cp.dunerealms.com/","badge":"NEW","updatedIn":"1.0.1.0","introducedIn":"1.0.1.0"},{"href":"https://cp.dunerealms.com/#exchange","updatedIn":"1.0.0.2","badge":"UPDATE"},{"href":"https://support.dunerealms.com/","updatedIn":"1.0.0.3","badge":"UPDATE"},{"href":"https://www.dunerealms.com/staff.html","updatedIn":"1.0.0.5","badge":"UPDATE"},{"href":"https://www.dunerealms.com/","badge":"NEW","introducedIn":"1.0.0.3","updatedIn":"1.0.0.3"},{"href":"https://www.dunerealms.com/shop.html","updatedIn":"1.0.0.5","badge":"UPDATE"},{"href":"https://www.dunerealms.com/kits.html","introducedIn":"1.0.0.5","badge":"NEW"},{"href":"https://cp.dunerealms.com/#kits-exchange","introducedIn":"1.0.0.5","badge":"NEW"},{"href":"https://cp.dunerealms.com/#realm","badge":"NEW","introducedIn":"v2-api"},{"href":"https://cp.dunerealms.com/#bureau","badge":"NEW","introducedIn":"v2-api"},{"href":"https://cp.dunerealms.com/#forge","badge":"NEW","introducedIn":"v2-api"},{"href":"https://cp.dunerealms.com/#politics","badge":"NEW","introducedIn":"v2-api"},{"href":"https://cp.dunerealms.com/#post","badge":"NEW","introducedIn":"v2-api"},{"href":"https://cp.dunerealms.com/#bank","badge":"NEW","introducedIn":"v2-api"},{"href":"https://cp.dunerealms.com/#market","badge":"NEW","introducedIn":"v2-api"},{"href":"https://www.dunerealms.com/rates-and-charges.html","updatedIn":"1.0.1.0","badge":"UPDATE"}];function mark(){const release=document.querySelector('.dune-release-badge')?.textContent.match(/\d+(?:\.\d+){3}/)?.[0];for(const a of document.querySelectorAll('header nav[aria-label="Main navigation"] a,#portals .portal[data-id]')){const href=a.matches('#portals .portal')?'https://cp.dunerealms.com/#'+a.dataset.id:a.href;const item=items.find(x=>x.href===href),label=['NEW','UPDATE'].includes(item?.badge)?item.badge:item?.introducedIn===release?'NEW':item?.updatedIn===release?'UPDATE':null;let tag=a.querySelector('.dune-new-overlay');if(label){if(!tag){tag=document.createElement('span');tag.className='dune-new-overlay';a.append(tag);}if(tag.textContent!==label)tag.textContent=label;tag.classList.toggle('dune-update-overlay',label==='UPDATE');tag.setAttribute('aria-label',label==='NEW'?'New this release':'Updated this release');}else if(tag)tag.remove();}}fetch('https://www.dunerealms.com/menu-new-items.json',{cache:'no-store'}).then(r=>r.ok?r.json():null).then(data=>{if(Array.isArray(data?.items)){items=data.items;mark();}}).catch(()=>{});mark();new MutationObserver(mark).observe(document.body,{childList:true,subtree:true,characterData:true});})();

File diff suppressed because one or more lines are too long