diff --git a/website/scripts/install-shared-header.mjs b/website/scripts/install-shared-header.mjs index 299e3d3e..61e3e9cf 100644 --- a/website/scripts/install-shared-header.mjs +++ b/website/scripts/install-shared-header.mjs @@ -30,4 +30,4 @@ if(existsSync(clans+'/index.html')){writeFileSync(clans+'/dune-navigation.css',P // 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);} +if(existsSync(chrome)){for(const file of ['portal-navigation.js','portal-navigation.css','menu-new-items.json','release.json'])copyFileSync(release+'/web/'+file,chrome+'/'+file);} diff --git a/website/scripts/menu-updates.mjs b/website/scripts/menu-updates.mjs index e3cfd1a2..c127501f 100644 --- a/website/scripts/menu-updates.mjs +++ b/website/scripts/menu-updates.mjs @@ -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,newPages=[],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);if(paths.length){for(const item of data.items)delete item.badge;}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=newPages.includes(href)?'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];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: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: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('/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.');} diff --git a/website/scripts/portal-navigation.mjs b/website/scripts/portal-navigation.mjs index d94f6cdb..88c7ad0e 100644 --- a/website/scripts/portal-navigation.mjs +++ b/website/scripts/portal-navigation.mjs @@ -36,7 +36,7 @@ export function pageContextFor(value,links=PORTAL_LINKS){ const link=links.find(x=>x[0]===name); return !link?{label:typeof document!=='undefined'?(document.querySelector('h1')?.textContent.trim()||'Field guide'):'Field guide',icon:'nav-manual-full-v2.webp'}:{label:link[0],icon:link[2].replace('-v2.webp','-full-v2.webp')}; } -export const CONTEXT_SCRIPT=`(()=>{if(window.top!==window.self){document.documentElement.classList.add('dune-embedded');return;}const links=${JSON.stringify(PORTAL_LINKS)},choose=${pageContextFor.toString()};let welcomeName='traveller';fetch('https://cp.dunerealms.com/api/welcome',{credentials:'include',cache:'no-store'}).then(r=>r.ok?r.json():null).then(data=>{if(typeof data?.username==='string'&&data.username.length<=32){welcomeName=data.username;render();}}).catch(()=>{});function render(){if(location.hostname==='support.dunerealms.com')document.body.classList.add('dune-support');const item=choose(location.href,links);let worlds=document.querySelector('.world-status');if(!worlds){worlds=document.createElement('aside');worlds.className='world-status';worlds.setAttribute('aria-label','Live server status');const heading=document.createElement('h2');heading.textContent='Worlds online';const list=document.createElement('ul');list.className='world-status-list';const note=document.createElement('p');note.className='world-status-note';note.textContent='Checking the caravan network…';worlds.append(heading,list,note);}worlds.remove();document.querySelector('.dune-page-marker')?.remove();if(!item)return;const header=document.querySelector('.dune-site-header');if(!header)return;const panel=document.createElement('section');panel.className='dune-page-marker';panel.setAttribute('aria-label','Welcome to '+item.label);const image=document.createElement('img');image.src='https://www.dunerealms.com/assets/'+item.icon;image.alt='';image.width=160;image.height=160;const text=document.createElement('div'),small=document.createElement('small'),title=document.createElement('p');small.textContent='THE CARAVAN GUIDE';title.textContent='Welcome, '+welcomeName+', to the '+item.label+'.';const lore=document.createElement('small');const quotes={DuneGit:['Every invention begins with a mark in the caravan ledger.','Share your craft; a good idea can travel beyond the dunes.','Build with care, and leave a trail others can follow.'],Webmail:['A sealed message carries your voice across the dunes.'],Home:['The caravan gathers here; the latest word travels with the wind.','Rest beneath our banners and hear what stirs beyond the dunes.','Every journey begins with news from the road.'],Boards:['A shared tale can light the way for another traveller.','Trade your stories beneath the awning; every voice has a place.','Listen well: the quietest traveller may know the safest passage.'],Exchange:['Weigh your Dunemarks carefully; a fair bargain outlasts a fortune.','Count the coin, inspect the wares, and leave with honour.','Even in a sea of sand, a good bargain is worth finding.'],Discord:['Tune to the caravan frequency; familiar voices shorten the crossing.','Across the dunes, a friendly voice is its own shelter.','The signal is clear. Join the conversation beyond the horizon.'],'Manual/wiki':['A well-read field guide saves more water than a hurried journey.','Learn the trail before you challenge the dunes.','Turn the page; knowledge is the lightest provision you can carry.'],'Staff roster':['A watchful crew keeps the caravan moving.','Every banner is stronger with a trusted hand behind it.','Meet the keepers of the caravan and the worlds beyond.'],'Support center':['Set down your burden; the caravan clerks are here to help.','A troubled journey deserves a patient listener.','Bring us the details, and we will help find the next step.'],'Account center':['Your journey has a place in the caravan ledger.','Keep your records in order and your next crossing within reach.','Behind every banner stands a traveller with a story of their own.'],'Clan center':['Raise your banner; the strongest caravan travels together.','Choose your companions well, and no horizon is too distant.','A shared purpose binds a clan more firmly than any crest.']};const choices=quotes[item.label]||['May your water last and your journey bring good fortune.'];const key=location.hostname+location.pathname+location.hash;let seed=0;for(const character of key)seed=(seed*31+character.charCodeAt(0))>>>0;lore.textContent=choices[seed%choices.length];text.append(lore);const npc=document.createElement('img');npc.src='https://www.dunerealms.com/assets/nav-account-v2.webp';npc.alt='Caravan guide';npc.style.cssText='width:48px;height:48px;object-fit:contain';text.prepend(npc);text.append(small,title);if(worlds&&!worlds.querySelector('.dune-join-box')){const join=document.createElement('div');join.className='dune-join-box';const address=document.createElement('code');address.textContent='play.dunerealms.com';const button=document.createElement('button');button.type='button';button.textContent='Join now';button.setAttribute('aria-label','Join now: copy Minecraft server address');const help=document.createElement('p');help.className='dune-join-help';help.textContent='Java & Bedrock · copy the server address';help.setAttribute('role','status');button.addEventListener('click',async()=>{try{await navigator.clipboard.writeText('play.dunerealms.com');button.textContent='Copied ✓';help.textContent='Address copied · choose Add Server in Java or Bedrock.';}catch{help.textContent='In Minecraft Java, add a server with address play.dunerealms.com.';}});const ports=document.createElement('div');ports.className='dune-join-ports';for(const [edition,port]of [['Bedrock','19132'],['Java','25565']]){const box=document.createElement('span'),label=document.createElement('small'),value=document.createElement('code');label.textContent=edition+' port';value.textContent=port;const icon=document.createElement('img');icon.className='edition-icon';icon.alt='';icon.width=12;icon.height=12;icon.src='https://www.dunerealms.com/assets/edition-'+(edition==='Java'?'java':'bedrock')+'.svg';box.append(icon,label,value);ports.append(box);}join.append(address,button,ports,help);worlds.append(join);}if(worlds&&!worlds.querySelector('.world-network-art')){worlds.querySelector('.eyebrow')?.remove();const plate=document.createElement('img');plate.className='world-network-art';plate.src='https://www.dunerealms.com/assets/vaerkring-network-title-v1.webp';plate.alt='Vaerkring Network';plate.width=280;plate.height=80;worlds.prepend(plate);}panel.append(image,text);if(worlds)panel.append(worlds);header.after(panel);if(!document.querySelector('.dune-shared-footer')){const old=document.querySelector('body>footer,.site-footer'),foot=old||document.createElement('footer');foot.className='dune-shared-footer';foot.replaceChildren();const brand=document.createElement('a');brand.href='https://www.dunerealms.com/';brand.textContent='✦ dunerealms.com';brand.className='dune-footer-brand';const links=document.createElement('nav');links.setAttribute('aria-label','Footer navigation');for(const [label,href]of [['Manual/wiki','https://wiki.dunerealms.com/'],['Support','https://support.dunerealms.com/'],['Account','https://cp.dunerealms.com/'],['DuneGit','https://www.dunerealms.com/git/unimatrix/MC'],['Disclaimer & contact','https://www.dunerealms.com/wiki.html']]){const a=document.createElement('a');a.textContent=label;a.href=href;links.append(a);}const note=document.createElement('small');note.textContent='Independent fan project · Not affiliated with Dune rights holders, Mojang or Microsoft.';foot.append(brand,links);const host=document.createElement('a');host.className='dune-hosting-badge';host.href='https://www.hetzner.com/';host.target='_blank';host.rel='noopener noreferrer';host.setAttribute('aria-label','Powered by Hetzner — visit Hetzner');const server=document.createElement('span');server.className='dune-hosting-art';server.textContent='▤';server.setAttribute('aria-hidden','true');const hostText=document.createElement('span');const powered=document.createElement('span');powered.textContent='POWERED BY';const hostLogo=document.createElement('img');hostLogo.src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxODEuNDIgMjIuMjQiPjxkZWZzPjxzdHlsZT4uY2xzLTF7ZmlsbDojZDUwYzJkO308L3N0eWxlPjwvZGVmcz48dGl0bGU+RWxlbWVudCAxPC90aXRsZT48ZyBpZD0iRWJlbmVfMiIgZGF0YS1uYW1lPSJFYmVuZSAyIj48ZyBpZD0iTG9nb19QdXIiIGRhdGEtbmFtZT0iTG9nbyBQdXIiPjxnIGlkPSJMb2dvIj48ZyBpZD0iSEVUWk5FUiI+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNMTc0LjA1LDE0LjEyYTEwLjIyLDEwLjIyLDAsMCwwLDQuNTMtMmwwLDBhNi4xNSw2LjE1LDAsMCwwLDEuNjgtNC43OCw3LjcxLDcuNzEsMCwwLDAtMS4xNC00LjA2QTYuNDcsNi40NywwLDAsMCwxNzMuODQuMDlsLTEuMDksMEwxNzAuMiwwLDE1OC42NiwwYy0uNywwLTEsLjI5LTEsMVYyMS4yMmMwLC43LjI5LDEsMSwxaDNjLjcsMCwxLS4yOSwxLTF2LTYuN2gzLjY3YTMuNDgsMy40OCwwLDAsMSwyLjE3LjkxbDUuODIsNS44NWEzLjA4LDMuMDgsMCwwLDAsMiwuOTJoNC40N2MuNywwLC44Ny0uNDEuMzgtLjkxWm0tLjc2LTQuM0gxNjIuNjRWNC43MmgxMC42NWEyLjEzLDIuMTMsMCwwLDEsMS44NywyLjE1di43OUEyLjE0LDIuMTQsMCwwLDEsMTczLjI5LDkuODJaIi8+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNMTUzLDE3LjUySDEzNi40N1YxMy4zNWgxMy4xOWMuNywwLDEtLjI5LDEtMVY5LjkyYzAtLjct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yOSwxLTFWMUM3NS4xOC4zMiw3NC44OSwwLDc0LjE5LDBaIi8+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNNDcuOTEsMTcuNTJIMzEuNDFWMTMuMzVINDQuNmMuNywwLDEtLjI5LDEtMVY5LjkyYzAtLjctLjI4LTEtMS0xSDMxLjQxVjQuNzZoMTYuNWMuNywwLDEtLjI5LDEtMVYxYzAtLjctLjI5LTEtMS0xSDI3LjMzYy0uNywwLTEsLjI5LTEsMVYyMS4yNGMwLC43LjI5LDEsMSwxSDQ3LjkxYy43LDAsMS0uMjksMS0xVjE4LjUxQzQ4LjksMTcuODEsNDguNjEsMTcuNTIsNDcuOTEsMTcuNTJaIi8+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNMjEuNjMsMEgxOC41MmMtLjcsMC0xLC4yOS0xLDFWOC44N0g1LjEzVjFjMC0uNy0uMjktMS0xLTFIMUMuMjksMCwwLC4yOSwwLDFWMjEuMjVjMCwuNzEuMjksMSwxLDFINC4xM2MuNywwLDEtLjI4LDEtMXYtOGgxMi40djhjMCwuNy4yOSwxLDEsMWgzLjExYy43LDAsMS0uMjksMS0xVjFDMjIuNjIuMzIsMjIuMzMsMCwyMS42MywwWiIvPjwvZz48L2c+PC9nPjwvZz48L3N2Zz4=";hostLogo.alt='Hetzner';hostLogo.width=120;hostLogo.height=20;hostText.append(powered,hostLogo);host.append(server,hostText);host.title='Hosting infrastructure · Logo: Hetzner Online GmbH';foot.append(host);foot.append(note);const legal=document.querySelector('.legal-notice');if(legal){const details=document.createElement('details'),summary=document.createElement('summary');summary.textContent='Unofficial fan project';details.className='dune-footer-legal';details.append(summary,legal);foot.append(details);}if(['www.dunerealms.com','dunerealms.com'].includes(location.hostname)&&['/','/index.html'].includes(location.pathname)){const box=document.createElement('div');box.className='dune-footer-parental';const heading=document.createElement('strong');heading.textContent='Parents & guardians';const copy=document.createElement('span');copy.textContent='Parental consent or a child’s account-data request? Contact our support team.';const link=document.createElement('a');link.href='https://support.dunerealms.com/open.php';link.textContent='Parental help →';box.append(heading,copy,link);foot.append(box);}if(!old)document.body.append(foot);}const pin=()=>document.documentElement.style.setProperty('--dune-nav-height',header.getBoundingClientRect().height+'px');pin();if(!header.dataset.pinObserved){new ResizeObserver(pin).observe(header);header.dataset.pinObserved='1';}}render();async function refreshWorlds(){try{const response=await fetch('https://www.dunerealms.com/api/worlds',{cache:'no-store',credentials:'omit',signal:AbortSignal.timeout(7000)});if(!response.ok)throw Error();const data=await response.json(),panel=document.querySelector('.dune-page-marker .world-status');if(!panel)return;const list=panel.querySelector('.world-status-list');list.replaceChildren();const glyphs={Arrakduin:'serevan',Kaladam:'pelareth',Giedermark:'varkesh',Kaiterhof:'orivane','Sigmadraken IV':'nivareth'};list.setAttribute('role','table');list.setAttribute('aria-label','World and connection status');for(const server of data.servers){const row=document.createElement('li'),name=document.createElement('span'),state=document.createElement('span'),icon=document.createElement('img');const display=server.name==='Velocity'?'Proxi':server.name;row.setAttribute('role','row');name.setAttribute('role','cell');name.className='world-name';name.title=display;icon.alt='';icon.width=14;icon.height=14;icon.src=glyphs[server.name]?'https://www.dunerealms.com/assets/planet-glyphs/'+glyphs[server.name]+'.svg':server.name==='Velocity'?'https://www.dunerealms.com/assets/network-proxy.svg':'https://www.dunerealms.com/assets/nav-home-v2.webp';name.append(icon,document.createTextNode(display));const status=server.state==='online'?'Online':server.state==='offline'?'Offline':'Unknown';state.setAttribute('role','cell');state.setAttribute('aria-label',status);state.title=status;state.className='world-state traffic-light '+server.state;for(const color of ['red','amber','green']){const lamp=document.createElement('i');lamp.className='lamp-'+color;lamp.setAttribute('aria-hidden','true');state.append(lamp);}row.append(name,state);list.append(row);}panel.querySelector('.world-status-note').textContent=data.available?'Live check · updates every 30s':'Status check unavailable';}catch{const note=document.querySelector('.dune-page-marker .world-status-note');if(note)note.textContent='Status check unavailable · retrying';}}refreshWorlds();setInterval(()=>{if(!document.hidden)refreshWorlds();},30000);addEventListener('hashchange',()=>{render();refreshWorlds();});})();`; +export const CONTEXT_SCRIPT=`(()=>{if(window.top!==window.self){document.documentElement.classList.add('dune-embedded');return;}const links=${JSON.stringify(PORTAL_LINKS)},choose=${pageContextFor.toString()};let welcomeName='traveller';fetch('https://cp.dunerealms.com/api/welcome',{credentials:'include',cache:'no-store'}).then(r=>r.ok?r.json():null).then(data=>{if(typeof data?.username==='string'&&data.username.length<=32){welcomeName=data.username;render();}}).catch(()=>{});function render(){if(location.hostname==='support.dunerealms.com')document.body.classList.add('dune-support');const item=choose(location.href,links);let worlds=document.querySelector('.world-status');if(!worlds){worlds=document.createElement('aside');worlds.className='world-status';worlds.setAttribute('aria-label','Live server status');const heading=document.createElement('h2');heading.textContent='Worlds online';const list=document.createElement('ul');list.className='world-status-list';const note=document.createElement('p');note.className='world-status-note';note.textContent='Checking the caravan network…';worlds.append(heading,list,note);}worlds.remove();document.querySelector('.dune-page-marker')?.remove();if(!item)return;const header=document.querySelector('.dune-site-header');if(!header)return;const panel=document.createElement('section');panel.className='dune-page-marker';panel.setAttribute('aria-label','Welcome to '+item.label);const image=document.createElement('img');image.src='https://www.dunerealms.com/assets/'+item.icon;image.alt='';image.width=160;image.height=160;const text=document.createElement('div'),small=document.createElement('small'),title=document.createElement('p');small.textContent='THE CARAVAN GUIDE';title.textContent='Welcome, '+welcomeName+', to the '+item.label+'.';const lore=document.createElement('small');const quotes={DuneGit:['Every invention begins with a mark in the caravan ledger.','Share your craft; a good idea can travel beyond the dunes.','Build with care, and leave a trail others can follow.'],Webmail:['A sealed message carries your voice across the dunes.'],Home:['The caravan gathers here; the latest word travels with the wind.','Rest beneath our banners and hear what stirs beyond the dunes.','Every journey begins with news from the road.'],Boards:['A shared tale can light the way for another traveller.','Trade your stories beneath the awning; every voice has a place.','Listen well: the quietest traveller may know the safest passage.'],Exchange:['Weigh your Dunemarks carefully; a fair bargain outlasts a fortune.','Count the coin, inspect the wares, and leave with honour.','Even in a sea of sand, a good bargain is worth finding.'],Discord:['Tune to the caravan frequency; familiar voices shorten the crossing.','Across the dunes, a friendly voice is its own shelter.','The signal is clear. Join the conversation beyond the horizon.'],'Manual/wiki':['A well-read field guide saves more water than a hurried journey.','Learn the trail before you challenge the dunes.','Turn the page; knowledge is the lightest provision you can carry.'],'Staff roster':['A watchful crew keeps the caravan moving.','Every banner is stronger with a trusted hand behind it.','Meet the keepers of the caravan and the worlds beyond.'],'Support center':['Set down your burden; the caravan clerks are here to help.','A troubled journey deserves a patient listener.','Bring us the details, and we will help find the next step.'],'Account center':['Your journey has a place in the caravan ledger.','Keep your records in order and your next crossing within reach.','Behind every banner stands a traveller with a story of their own.'],'Clan center':['Raise your banner; the strongest caravan travels together.','Choose your companions well, and no horizon is too distant.','A shared purpose binds a clan more firmly than any crest.']};const choices=quotes[item.label]||['May your water last and your journey bring good fortune.'];const key=location.hostname+location.pathname+location.hash;let seed=0;for(const character of key)seed=(seed*31+character.charCodeAt(0))>>>0;lore.textContent=choices[seed%choices.length];text.append(lore);const npc=document.createElement('img');npc.src='https://www.dunerealms.com/assets/nav-account-v2.webp';npc.alt='Caravan guide';npc.style.cssText='width:48px;height:48px;object-fit:contain';text.prepend(npc);text.append(small,title);if(worlds&&!worlds.querySelector('.dune-join-box')){const join=document.createElement('div');join.className='dune-join-box';const address=document.createElement('code');address.textContent='play.dunerealms.com';const button=document.createElement('button');button.type='button';button.textContent='Join now';button.setAttribute('aria-label','Join now: copy Minecraft server address');const help=document.createElement('p');help.className='dune-join-help';help.textContent='Java & Bedrock · copy the server address';help.setAttribute('role','status');button.addEventListener('click',async()=>{try{await navigator.clipboard.writeText('play.dunerealms.com');button.textContent='Copied ✓';help.textContent='Address copied · choose Add Server in Java or Bedrock.';}catch{help.textContent='In Minecraft Java, add a server with address play.dunerealms.com.';}});const ports=document.createElement('div');ports.className='dune-join-ports';for(const [edition,port]of [['Bedrock','19132'],['Java','25565']]){const box=document.createElement('span'),label=document.createElement('small'),value=document.createElement('code');label.textContent=edition+' port';value.textContent=port;const icon=document.createElement('img');icon.className='edition-icon';icon.alt='';icon.width=12;icon.height=12;icon.src='https://www.dunerealms.com/assets/edition-'+(edition==='Java'?'java':'bedrock')+'.svg';box.append(icon,label,value);ports.append(box);}join.append(address,button,ports,help);worlds.append(join);}if(worlds&&!worlds.querySelector('.world-network-art')){worlds.querySelector('.eyebrow')?.remove();const plate=document.createElement('img');plate.className='world-network-art';plate.src='https://www.dunerealms.com/assets/vaerkring-network-title-v1.webp';plate.alt='Vaerkring Network';plate.width=280;plate.height=80;worlds.prepend(plate);}panel.append(image,text);if(worlds)panel.append(worlds);header.after(panel);if(!document.querySelector('.dune-shared-footer')){const old=document.querySelector('body>footer,.site-footer'),foot=old||document.createElement('footer');foot.className='dune-shared-footer';foot.replaceChildren();const brand=document.createElement('a');brand.href='https://www.dunerealms.com/';brand.textContent='✦ dunerealms.com';brand.className='dune-footer-brand';const links=document.createElement('nav');links.setAttribute('aria-label','Footer navigation');for(const [label,href]of [['Manual/wiki','https://wiki.dunerealms.com/'],['Support','https://support.dunerealms.com/'],['Account','https://cp.dunerealms.com/'],['DuneGit','https://www.dunerealms.com/git/unimatrix/MC'],['Disclaimer & contact','https://www.dunerealms.com/wiki.html']]){const a=document.createElement('a');a.textContent=label;a.href=href;links.append(a);}const note=document.createElement('small');note.textContent='Independent fan project · Not affiliated with Dune rights holders, Mojang or Microsoft.';foot.append(brand,links);const host=document.createElement('a');host.className='dune-hosting-badge';host.href='https://www.hetzner.com/';host.target='_blank';host.rel='noopener noreferrer';host.setAttribute('aria-label','Powered by Hetzner — visit Hetzner');const server=document.createElement('span');server.className='dune-hosting-art';server.textContent='▤';server.setAttribute('aria-hidden','true');const hostText=document.createElement('span');const powered=document.createElement('span');powered.textContent='POWERED BY';const hostLogo=document.createElement('img');hostLogo.src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxODEuNDIgMjIuMjQiPjxkZWZzPjxzdHlsZT4uY2xzLTF7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5LTEtMS0xSDI3LjMzYy0uNywwLTEsLjI5LTEsMVYyMS4yNGMwLC43LjI5LDEsMSwxSDQ3LjkxYy43LDAsMS0uMjksMS0xVjE4LjUxQzQ4LjksMTcuODEsNDguNjEsMTcuNTIsNDcuOTEsMTcuNTJaIi8+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNMjEuNjMsMEgxOC41MmMtLjcsMC0xLC4yOS0xLDFWOC44N0g1LjEzVjFjMC0uNy0uMjktMS0xLTFIMUMuMjksMCwwLC4yOSwwLDFWMjEuMjVjMCwuNzEuMjksMSwxLDFINC4xM2MuNywwLDEtLjI4LDEtMXYtOGgxMi40djhjMCwuNy4yOSwxLDEsMWgzLjExYy43LDAsMS0uMjksMS0xVjFDMjIuNjIuMzIsMjIuMzMsMCwyMS42MywwWiIvPjwvZz48L2c+PC9nPjwvZz48L3N2Zz4=";hostLogo.alt='Hetzner';hostLogo.width=120;hostLogo.height=20;hostText.append(powered,hostLogo);host.append(server,hostText);host.title='Hosting infrastructure · Logo: Hetzner Online GmbH';foot.append(host);foot.append(note);const legal=document.querySelector('.legal-notice');if(legal){const details=document.createElement('details'),summary=document.createElement('summary');summary.textContent='Unofficial fan project';details.className='dune-footer-legal';details.append(summary,legal);foot.append(details);}if(['www.dunerealms.com','dunerealms.com'].includes(location.hostname)&&['/','/index.html'].includes(location.pathname)){const box=document.createElement('div');box.className='dune-footer-parental';const heading=document.createElement('strong');heading.textContent='Parents & guardians';const copy=document.createElement('span');copy.textContent='Parental consent or a child’s account-data request? Contact our support team.';const link=document.createElement('a');link.href='https://support.dunerealms.com/open.php';link.textContent='Parental help →';box.append(heading,copy,link);foot.append(box);}if(!old)document.body.append(foot);}const pin=()=>document.documentElement.style.setProperty('--dune-nav-height',header.getBoundingClientRect().height+'px');pin();if(!header.dataset.pinObserved){new ResizeObserver(pin).observe(header);header.dataset.pinObserved='1';}}render();async function refreshWorlds(){try{const response=await fetch('/api/worlds',{cache:'no-store',credentials:'omit',signal:AbortSignal.timeout(7000)});if(!response.ok)throw Error();const data=await response.json(),panel=document.querySelector('.dune-page-marker .world-status');if(!panel)return;const list=panel.querySelector('.world-status-list');list.replaceChildren();const glyphs={Arrakduin:'serevan',Kaladam:'pelareth',Giedermark:'varkesh',Kaiterhof:'orivane','Sigmadraken IV':'nivareth'};list.setAttribute('role','table');list.setAttribute('aria-label','World and connection status');for(const server of data.servers){const row=document.createElement('li'),name=document.createElement('span'),state=document.createElement('span'),icon=document.createElement('img');const display=server.name==='Velocity'?'Proxi':server.name;row.setAttribute('role','row');name.setAttribute('role','cell');name.className='world-name';name.title=display;icon.alt='';icon.width=14;icon.height=14;icon.src=glyphs[server.name]?'https://www.dunerealms.com/assets/planet-glyphs/'+glyphs[server.name]+'.svg':server.name==='Velocity'?'https://www.dunerealms.com/assets/network-proxy.svg':'https://www.dunerealms.com/assets/nav-home-v2.webp';name.append(icon,document.createTextNode(display));const status=server.state==='online'?'Online':server.state==='offline'?'Offline':'Unknown';state.setAttribute('role','cell');state.setAttribute('aria-label',status);state.title=status;state.className='world-state traffic-light '+server.state;for(const color of ['red','amber','green']){const lamp=document.createElement('i');lamp.className='lamp-'+color;lamp.setAttribute('aria-hidden','true');state.append(lamp);}row.append(name,state);list.append(row);}panel.querySelector('.world-status-note').textContent=data.available?'Live check · updates every 30s':'Status check unavailable';}catch{const note=document.querySelector('.dune-page-marker .world-status-note');if(note)note.textContent='Status check unavailable · retrying';}}refreshWorlds();setInterval(()=>{if(!document.hidden)refreshWorlds();},30000);addEventListener('hashchange',()=>{render();refreshWorlds();});})();`; export const CONTEXT_CSS=`.dune-page-marker>.world-status{max-width:325px!important;min-width:245px!important;flex-basis:245px!important;padding:8px 12px!important;border:1px solid #8a7845!important;border-radius:4px;box-shadow:inset 0 0 0 3px #0b2117,0 3px 9px #0003}.dune-page-marker .world-status h2{font:600 16px/1.25 system-ui!important;margin:3px 0 7px!important;color:#ead399}.dune-page-marker .world-status .eyebrow{font:700 8px/1.4 system-ui!important;letter-spacing:.12em!important;margin:0 0 3px!important;color:#b6c5aa}.dune-page-marker .world-status-list{gap:1px 8px!important}.dune-page-marker .world-status-list li{font:10px/1.35 system-ui!important;padding:2px 0!important;border-bottom:1px solid #58654444}.dune-page-marker .world-state{font-size:9px!important;white-space:nowrap}.dune-page-marker .world-status-note{font:8px/1.4 system-ui!important;margin:5px 0 0!important}.dune-join-box{padding:6px 7px!important;margin-top:7px!important;gap:5px 7px!important}.dune-join-box>code{font-size:10px!important}.dune-join-box button{padding:5px 8px!important;font-size:10px!important}.dune-join-ports{gap:5px!important}.dune-join-ports>span{padding:3px 4px!important}.dune-join-ports small{font-size:8px!important}.dune-join-ports code{font-size:9px!important}.dune-page-marker .dune-join-help{font-size:8px!important;line-height:1.35!important}@media(max-width:1000px){.dune-page-marker>.world-status{max-width:none!important;flex-basis:100%!important}}.dune-join-ports{grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;gap:6px}.dune-join-ports>span{display:flex;align-items:center;justify-content:space-between;gap:7px;padding:4px 6px;background:#10251b;border:1px solid #62704a;border-radius:2px}.dune-join-ports small{font:9px/1.4 system-ui!important;color:#bcc8ae!important}.dune-join-ports code{font-size:11px;color:#ead49a}.dune-join-box{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:7px 10px;margin-top:10px;padding:9px 10px;background:#1f3728;border:1px solid #98854e;border-radius:3px}.dune-join-box code{font:600 12px/1.5 ui-monospace,monospace;color:#f0dfad;background:none;padding:0;overflow-wrap:anywhere}.dune-join-box button{border:1px solid #dfc479;background:linear-gradient(#d9bd74,#b9974c);color:#12241a;padding:7px 12px;border-radius:2px;font:700 11px/1.3 system-ui;cursor:pointer;white-space:nowrap}.dune-join-box button:hover{filter:brightness(1.1)}.dune-join-box button:focus-visible{outline:2px solid #c5e4b8;outline-offset:3px}.dune-page-marker .dune-join-help{grid-column:1/-1;font:10px/1.4 system-ui!important;color:#bdcbb4!important;margin:0!important;letter-spacing:normal!important}.dune-embedded .dune-page-marker,.dune-embedded .dune-shared-footer,.dune-embedded #footer,.dune-embedded footer{display:none!important}.dune-page-marker .world-status .eyebrow,.dune-page-marker .world-status-note{font:11px/1.5 system-ui!important;letter-spacing:normal!important}.dune-footer-legal,.dune-footer-parental{flex-basis:100%;font:12px/1.6 system-ui}.dune-footer-legal summary{cursor:pointer;color:#d6ba76}.dune-footer-legal .legal-notice{max-width:none!important;margin:10px 0 0!important;padding:12px 0!important;background:none!important;border:0!important;font:11px/1.6 system-ui}.dune-footer-parental{display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px;border-top:1px solid #425a45;padding-top:10px;color:#bdc7b8}.dune-footer-parental strong,.dune-footer-parental a{color:#dfc17c}.dune-shared-footer{display:flex!important;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px 24px!important;padding:18px max(24px,4%)!important;background:#10271f!important;border-top:1px solid #74663f!important;border-bottom:0!important;margin-top:20px;box-sizing:border-box}.dune-hosting-badge{display:inline-flex!important;align-items:center;gap:12px;padding:9px 15px!important;border:1px solid #a88e4b!important;border-radius:7px;background:linear-gradient(135deg,#294636,#0d241b)!important;box-shadow:inset 0 0 0 3px #d1b66b12,0 3px 8px #0003;text-decoration:none!important}.dune-hosting-badge>span:last-child{display:grid;gap:5px}.dune-hosting-badge span span{font:9px/1.2 system-ui;letter-spacing:.2em;color:#e4c77f}.dune-hosting-badge img{display:block;width:120px!important;height:20px!important;object-fit:contain;background:#fff;border-radius:3px;padding:6px 8px}.dune-hosting-art{font-size:38px;line-height:1;color:#d5b66b;text-shadow:2px 2px #081c14;border:1px solid #857847;padding:2px 7px;border-radius:4px}.dune-hosting-badge:hover{border-color:#f0d488!important;box-shadow:0 0 15px #dfbb4c22}.dune-shared-footer .dune-footer-brand{font:700 19px/1.4 system-ui;letter-spacing:0;color:#dfbe78}.dune-shared-footer nav{display:flex!important;position:static!important;flex-direction:row!important;flex-wrap:wrap;gap:10px 20px!important;padding:0!important;background:none!important;border:0!important;font:12px/1.5 system-ui}.dune-shared-footer nav a{color:#dfc17c!important;text-decoration:none!important;padding:0!important;min-height:0!important;background:none!important;border:0!important}.dune-shared-footer small{flex-basis:100%;border:0!important;padding:0!important;font:10px/1.5 system-ui;letter-spacing:0!important;text-align:left!important;color:#b7c3b5}.dune-page-marker{gap:20px!important;min-height:165px!important;padding-top:10px!important;padding-bottom:10px!important}.dune-page-marker>img{width:130px!important;height:140px!important;flex-basis:130px!important}.dune-page-marker p{margin:8px 0!important;font-size:21px!important}.dune-page-marker>.world-status{padding:10px 16px!important}.dune-page-marker .world-status-list{gap:3px 12px!important}#footer:not(footer){padding-top:12px!important;padding-bottom:12px!important}@media(max-width:650px){.dune-page-marker>img{width:80px!important;height:90px!important;flex-basis:80px!important}.dune-shared-footer{gap:8px!important;padding:15px 20px!important}}footer,.site-footer{background-repeat:no-repeat!important;background-size:cover!important;background-position:center!important}html,body{background-color:#0d211b!important;background-image:none!important}header.dune-site-header::after{display:none!important;content:none!important}header.dune-site-header{position:static!important;top:auto!important}.dune-page-marker{position:static!important;top:auto!important;border-bottom:3px double #b49a5c!important;box-shadow:0 5px 10px #0005}html{scroll-padding-top:0}@media(max-height:650px){.dune-page-marker{min-height:120px!important;padding-top:6px!important;padding-bottom:6px!important}.dune-page-marker>img{height:90px!important;width:90px!important;flex-basis:90px!important}.dune-page-marker p{font-size:17px!important}.dune-page-marker .world-status-list{gap:0 12px!important}.dune-page-marker>.world-status{padding:6px 12px!important}}.dune-page-marker>.world-status{position:static!important;transform:none!important;inset:auto!important;flex:1 1 320px;max-width:430px;width:auto!important;min-width:260px;margin:0 0 0 auto!important;padding:14px 20px!important;box-sizing:border-box;background:#0d211b;border:1px solid #586844;border-radius:6px}.dune-page-marker .world-status h2{font:600 20px/1.3 system-ui;margin:4px 0 10px}.dune-page-marker .world-status .eyebrow{font-size:10px;margin:0}.dune-page-marker .world-status-list{display:grid;grid-template-columns:1fr 1fr;gap:5px 16px;margin:0;padding:0;list-style:none}.dune-page-marker .world-status-list li{display:flex;justify-content:space-between;gap:8px;font:12px/1.5 system-ui;padding:2px 0}.dune-page-marker .world-status>p:last-child{font:11px/1.5 system-ui;margin:8px 0 0}@media(max-width:1000px){.dune-page-marker{flex-wrap:wrap}.dune-page-marker>.world-status{flex-basis:100%;max-width:none;margin:8px 0 0!important}}body.dune-support #landing_page .main-content,body.dune-support #content .main-content{background:#142d26!important;color:#e6dfca!important;padding:20px;box-sizing:border-box;border:1px solid #50624d}body.dune-support #content p,body.dune-support #content h1,body.dune-support #content h2{color:#e6dfca}body.dune-support #content input,body.dune-support #content select,body.dune-support #content textarea{background:#10261f;color:#eee3c7;border:1px solid #718266}header.dune-site-header[hidden]{display:none!important}.dune-page-marker{display:flex;align-items:center;gap:26px;width:100%;min-height:206px;margin:0;padding:14px max(5%,24px);background:#122c23;border-top:1px solid #596345;border-bottom:1px solid #596345;color:#e9d5aa;box-sizing:border-box;text-align:left}.dune-page-marker>img{display:block;width:164px;height:178px;object-fit:contain;flex:0 0 164px}.dune-page-marker>div{max-width:470px;text-align:center}.dune-page-marker div>img{display:inline-block;width:48px;height:48px;object-fit:contain}.dune-page-marker small{display:block;font:12px/1.5 system-ui;letter-spacing:normal;color:#cbb978}.dune-page-marker p{font:600 25px/1.35 system-ui;margin:10px 0;color:#eee3c7}@media(max-width:650px){.dune-page-marker{padding:14px 5%;min-height:160px;gap:14px}.dune-page-marker>img{width:90px;height:120px;flex-basis:90px}.dune-page-marker p{font-size:18px}.dune-page-marker small{font-size:11px}.dune-page-marker div>img{width:40px;height:40px}} .dune-page-marker .world-network-art{display:block;width:100%!important;height:62px!important;object-fit:contain;margin:0 auto 3px} .dune-page-marker .world-status h2{font:700 10px/1.4 system-ui!important;text-transform:uppercase;letter-spacing:.14em;margin:2px 0 5px!important;color:#cbb37a} diff --git a/website/scripts/release-branding.mjs b/website/scripts/release-branding.mjs index d81ad489..cfbeae6e 100644 --- a/website/scripts/release-branding.mjs +++ b/website/scripts/release-branding.mjs @@ -1,3 +1,3 @@ -export const RELEASE_VERSION='1.0.1.0'; +export const RELEASE_VERSION='1.0.0.5'; export const RELEASE_CSS=`\n.dune-release-badge{display:block;width:max-content;max-width:100%;margin:5px auto 0;padding:4px 12px;border:1px solid #ba9952;border-radius:20px;background:linear-gradient(120deg,#102d25,#263c2a);color:#ead190;font:600 11px/1.4 system-ui,sans-serif;letter-spacing:.09em;text-align:center;white-space:nowrap;box-shadow:0 2px 8px #0003}.dune-release-badge::before{content:'✦';margin-right:6px;color:#cda64f}\n`; -export const RELEASE_SCRIPT=`\n(()=>{const stamp=()=>{const brand=document.querySelector('.dune-site-header .wordmark');if(!brand)return false;if(!brand.querySelector('.dune-release-badge')){const badge=document.createElement('span');badge.className='dune-release-badge';badge.textContent='Alpha 1.0.1.0';brand.append(badge);}return true;};if(!stamp()){const observer=new MutationObserver(()=>{if(stamp())observer.disconnect();});observer.observe(document.documentElement,{childList:true,subtree:true});}})();\n`; +export const RELEASE_SCRIPT=`\n(()=>{const stamp=()=>{const brand=document.querySelector('.dune-site-header .wordmark');if(!brand)return false;if(!brand.querySelector('.dune-release-badge')){const badge=document.createElement('span');badge.className='dune-release-badge';badge.textContent='Alpha';brand.append(badge);fetch('/release.json',{cache:'no-store'}).then(r=>r.ok?r.json():null).then(release=>{if(release&&release.stage==='alpha'&&/^\\d+(?:\\.\\d+){3}$/.test(release.version))badge.textContent='Alpha '+release.version;}).catch(()=>{});}return true;};if(!stamp()){const observer=new MutationObserver(()=>{if(stamp())observer.disconnect();});observer.observe(document.documentElement,{childList:true,subtree:true});}})();\n`; diff --git a/website/web/portal-navigation.js b/website/web/portal-navigation.js index 9d4fcead..fdb89dea 100644 --- a/website/web/portal-navigation.js +++ b/website/web/portal-navigation.js @@ -7,7 +7,7 @@ const name=host==='forums.dunerealms.com'?'Boards':host==='support.dunerealms.com'?'Support center':host==='clans.dunerealms.com'?'Clan center':host==='cp.dunerealms.com'?(url.hash==='#exchange'?'Exchange':url.hash==='#tickets'?'Support center':url.hash==='#forum-admin'?'Boards':'Account center'):/\/(manual|wiki)\.html$/.test(url.pathname)?'Manual/wiki':/\/staff\.html$/.test(url.pathname)?'Staff roster':/\/discord\.html$/.test(url.pathname)?'Discord':/\/exchange\.html$/.test(url.pathname)?'Exchange':['/','/index.html'].includes(url.pathname)?'Home':null; const link=links.find(x=>x[0]===name); return !link?{label:typeof document!=='undefined'?(document.querySelector('h1')?.textContent.trim()||'Field guide'):'Field guide',icon:'nav-manual-full-v2.webp'}:{label:link[0],icon:link[2].replace('-v2.webp','-full-v2.webp')}; -};let welcomeName='traveller';fetch('https://cp.dunerealms.com/api/welcome',{credentials:'include',cache:'no-store'}).then(r=>r.ok?r.json():null).then(data=>{if(typeof data?.username==='string'&&data.username.length<=32){welcomeName=data.username;render();}}).catch(()=>{});function render(){if(location.hostname==='support.dunerealms.com')document.body.classList.add('dune-support');const item=choose(location.href,links);let worlds=document.querySelector('.world-status');if(!worlds){worlds=document.createElement('aside');worlds.className='world-status';worlds.setAttribute('aria-label','Live server status');const heading=document.createElement('h2');heading.textContent='Worlds online';const list=document.createElement('ul');list.className='world-status-list';const note=document.createElement('p');note.className='world-status-note';note.textContent='Checking the caravan network…';worlds.append(heading,list,note);}worlds.remove();document.querySelector('.dune-page-marker')?.remove();if(!item)return;const header=document.querySelector('.dune-site-header');if(!header)return;const panel=document.createElement('section');panel.className='dune-page-marker';panel.setAttribute('aria-label','Welcome to '+item.label);const image=document.createElement('img');image.src='https://www.dunerealms.com/assets/'+item.icon;image.alt='';image.width=160;image.height=160;const text=document.createElement('div'),small=document.createElement('small'),title=document.createElement('p');small.textContent='THE CARAVAN GUIDE';title.textContent='Welcome, '+welcomeName+', to the '+item.label+'.';const lore=document.createElement('small');const quotes={Home:['The caravan gathers here; the latest word travels with the wind.','Rest beneath our banners and hear what stirs beyond the dunes.','Every journey begins with news from the road.'],Boards:['A shared tale can light the way for another traveller.','Trade your stories beneath the awning; every voice has a place.','Listen well: the quietest traveller may know the safest passage.'],Exchange:['Weigh your Dunemarks carefully; a fair bargain outlasts a fortune.','Count the coin, inspect the wares, and leave with honour.','Even in a sea of sand, a good bargain is worth finding.'],Discord:['Tune to the caravan frequency; familiar voices shorten the crossing.','Across the dunes, a friendly voice is its own shelter.','The signal is clear. Join the conversation beyond the horizon.'],'Manual/wiki':['A well-read field guide saves more water than a hurried journey.','Learn the trail before you challenge the dunes.','Turn the page; knowledge is the lightest provision you can carry.'],'Staff roster':['A watchful crew keeps the caravan moving.','Every banner is stronger with a trusted hand behind it.','Meet the keepers of the caravan and the worlds beyond.'],'Support center':['Set down your burden; the caravan clerks are here to help.','A troubled journey deserves a patient listener.','Bring us the details, and we will help find the next step.'],'Account center':['Your journey has a place in the caravan ledger.','Keep your records in order and your next crossing within reach.','Behind every banner stands a traveller with a story of their own.'],'Clan center':['Raise your banner; the strongest caravan travels together.','Choose your companions well, and no horizon is too distant.','A shared purpose binds a clan more firmly than any crest.']};const choices=quotes[item.label]||['May your water last and your journey bring good fortune.'];const key=location.hostname+location.pathname+location.hash;let seed=0;for(const character of key)seed=(seed*31+character.charCodeAt(0))>>>0;lore.textContent=choices[seed%choices.length];text.append(lore);const npc=document.createElement('img');npc.src='https://www.dunerealms.com/assets/nav-account-v2.webp';npc.alt='Caravan guide';npc.style.cssText='width:48px;height:48px;object-fit:contain';text.prepend(npc);text.append(small,title);if(worlds&&!worlds.querySelector('.dune-join-box')){const join=document.createElement('div');join.className='dune-join-box';const address=document.createElement('code');address.textContent='play.dunerealms.com';const button=document.createElement('button');button.type='button';button.textContent='Join now';button.setAttribute('aria-label','Join now: copy Minecraft server address');const help=document.createElement('p');help.className='dune-join-help';help.textContent='Java & Bedrock · copy the server address';help.setAttribute('role','status');button.addEventListener('click',async()=>{try{await navigator.clipboard.writeText('play.dunerealms.com');button.textContent='Copied ✓';help.textContent='Address copied · choose Add Server in Java or Bedrock.';}catch{help.textContent='In Minecraft Java, add a server with address play.dunerealms.com.';}});const ports=document.createElement('div');ports.className='dune-join-ports';for(const [edition,port]of [['Bedrock','19132'],['Java','25565']]){const box=document.createElement('span'),label=document.createElement('small'),value=document.createElement('code');label.textContent=edition+' port';value.textContent=port;const icon=document.createElement('img');icon.className='edition-icon';icon.alt='';icon.width=12;icon.height=12;icon.src='https://www.dunerealms.com/assets/edition-'+(edition==='Java'?'java':'bedrock')+'.svg';box.append(icon,label,value);ports.append(box);}join.append(address,button,ports,help);worlds.append(join);}if(worlds&&!worlds.querySelector('.world-network-art')){worlds.querySelector('.eyebrow')?.remove();const plate=document.createElement('img');plate.className='world-network-art';plate.src='https://www.dunerealms.com/assets/vaerkring-network-title-v1.webp';plate.alt='Vaerkring Network';plate.width=280;plate.height=80;worlds.prepend(plate);}panel.append(image,text);if(worlds)panel.append(worlds);header.after(panel);if(!document.querySelector('.dune-shared-footer')){const old=document.querySelector('body>footer,.site-footer'),foot=old||document.createElement('footer');foot.className='dune-shared-footer';foot.replaceChildren();const brand=document.createElement('a');brand.href='https://www.dunerealms.com/';brand.textContent='✦ dunerealms.com';brand.className='dune-footer-brand';const links=document.createElement('nav');links.setAttribute('aria-label','Footer navigation');for(const [label,href]of [['Manual/wiki','https://wiki.dunerealms.com/'],['Support','https://support.dunerealms.com/'],['Account','https://cp.dunerealms.com/'],['Disclaimer & contact','https://www.dunerealms.com/wiki.html']]){const a=document.createElement('a');a.textContent=label;a.href=href;links.append(a);}const note=document.createElement('small');note.textContent='Independent fan project · Not affiliated with Dune rights holders, Mojang or Microsoft.';foot.append(brand,links);const host=document.createElement('a');host.className='dune-hosting-badge';host.href='https://www.hetzner.com/';host.target='_blank';host.rel='noopener noreferrer';host.setAttribute('aria-label','Powered by Hetzner — visit Hetzner');const server=document.createElement('span');server.className='dune-hosting-art';server.textContent='▤';server.setAttribute('aria-hidden','true');const hostText=document.createElement('span');const powered=document.createElement('span');powered.textContent='POWERED BY';const hostLogo=document.createElement('img');hostLogo.src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxODE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NzZoMTYuNWMuNywwLDEtLjI5LDEtMVYxYzAtLjctLjI5LTEtMS0xSDI3LjMzYy0uNywwLTEsLjI5LTEsMVYyMS4yNGMwLC43LjI5LDEsMSwxSDQ3LjkxYy43LDAsMS0uMjksMS0xVjE4LjUxQzQ4LjksMTcuODEsNDguNjEsMTcuNTIsNDcuOTEsMTcuNTJaIi8+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNMjEuNjMsMEgxOC41MmMtLjcsMC0xLC4yOS0xLDFWOC44N0g1LjEzVjFjMC0uNy0uMjktMS0xLTFIMUMuMjksMCwwLC4yOSwwLDFWMjEuMjVjMCwuNzEuMjksMSwxLDFINC4xM2MuNywwLDEtLjI4LDEtMXYtOGgxMi40djhjMCwuNy4yOSwxLDEsMWgzLjExYy43LDAsMS0uMjksMS0xVjFDMjIuNjIuMzIsMjIuMzMsMCwyMS42MywwWiIvPjwvZz48L2c+PC9nPjwvZz48L3N2Zz4=";hostLogo.alt='Hetzner';hostLogo.width=120;hostLogo.height=20;hostText.append(powered,hostLogo);host.append(server,hostText);host.title='Hosting infrastructure · Logo: Hetzner Online GmbH';foot.append(host);foot.append(note);const legal=document.querySelector('.legal-notice');if(legal){const details=document.createElement('details'),summary=document.createElement('summary');summary.textContent='Unofficial fan project';details.className='dune-footer-legal';details.append(summary,legal);foot.append(details);}if(['www.dunerealms.com','dunerealms.com'].includes(location.hostname)&&['/','/index.html'].includes(location.pathname)){const box=document.createElement('div');box.className='dune-footer-parental';const heading=document.createElement('strong');heading.textContent='Parents & guardians';const copy=document.createElement('span');copy.textContent='Parental consent or a child’s account-data request? Contact our support team.';const link=document.createElement('a');link.href='https://support.dunerealms.com/open.php';link.textContent='Parental help →';box.append(heading,copy,link);foot.append(box);}if(!old)document.body.append(foot);}const pin=()=>document.documentElement.style.setProperty('--dune-nav-height',header.getBoundingClientRect().height+'px');pin();if(!header.dataset.pinObserved){new ResizeObserver(pin).observe(header);header.dataset.pinObserved='1';}}render();async function refreshWorlds(){try{const response=await fetch('https://www.dunerealms.com/api/worlds',{cache:'no-store',credentials:'omit',signal:AbortSignal.timeout(7000)});if(!response.ok)throw Error();const data=await response.json(),panel=document.querySelector('.dune-page-marker .world-status');if(!panel)return;const list=panel.querySelector('.world-status-list');list.replaceChildren();const glyphs={Arrakduin:'serevan',Kaladam:'pelareth',Giedermark:'varkesh',Kaiterhof:'orivane','Sigmadraken IV':'nivareth'};list.setAttribute('role','table');list.setAttribute('aria-label','World and connection status');for(const server of data.servers){const row=document.createElement('li'),name=document.createElement('span'),state=document.createElement('span'),icon=document.createElement('img');const display=server.name==='Velocity'?'Proxi':server.name;row.setAttribute('role','row');name.setAttribute('role','cell');name.className='world-name';name.title=display;icon.alt='';icon.width=14;icon.height=14;icon.src=glyphs[server.name]?'https://www.dunerealms.com/assets/planet-glyphs/'+glyphs[server.name]+'.svg':server.name==='Velocity'?'https://www.dunerealms.com/assets/network-proxy.svg':'https://www.dunerealms.com/assets/nav-home-v2.webp';name.append(icon,document.createTextNode(display));const status=server.state==='online'?'Online':server.state==='offline'?'Offline':'Unknown';state.setAttribute('role','cell');state.setAttribute('aria-label',status);state.title=status;state.className='world-state traffic-light '+server.state;for(const color of ['red','amber','green']){const lamp=document.createElement('i');lamp.className='lamp-'+color;lamp.setAttribute('aria-hidden','true');state.append(lamp);}row.append(name,state);list.append(row);}panel.querySelector('.world-status-note').textContent=data.available?'Live check · updates every 30s':'Status check unavailable';}catch{const note=document.querySelector('.dune-page-marker .world-status-note');if(note)note.textContent='Status check unavailable · retrying';}}refreshWorlds();setInterval(()=>{if(!document.hidden)refreshWorlds();},30000);addEventListener('hashchange',()=>{render();refreshWorlds();});})(); +};let welcomeName='traveller';fetch('https://cp.dunerealms.com/api/welcome',{credentials:'include',cache:'no-store'}).then(r=>r.ok?r.json():null).then(data=>{if(typeof data?.username==='string'&&data.username.length<=32){welcomeName=data.username;render();}}).catch(()=>{});function render(){if(location.hostname==='support.dunerealms.com')document.body.classList.add('dune-support');const item=choose(location.href,links);let worlds=document.querySelector('.world-status');if(!worlds){worlds=document.createElement('aside');worlds.className='world-status';worlds.setAttribute('aria-label','Live server status');const heading=document.createElement('h2');heading.textContent='Worlds online';const list=document.createElement('ul');list.className='world-status-list';const note=document.createElement('p');note.className='world-status-note';note.textContent='Checking the caravan network…';worlds.append(heading,list,note);}worlds.remove();document.querySelector('.dune-page-marker')?.remove();if(!item)return;const header=document.querySelector('.dune-site-header');if(!header)return;const panel=document.createElement('section');panel.className='dune-page-marker';panel.setAttribute('aria-label','Welcome to '+item.label);const image=document.createElement('img');image.src='https://www.dunerealms.com/assets/'+item.icon;image.alt='';image.width=160;image.height=160;const text=document.createElement('div'),small=document.createElement('small'),title=document.createElement('p');small.textContent='THE CARAVAN GUIDE';title.textContent='Welcome, '+welcomeName+', to the '+item.label+'.';const lore=document.createElement('small');const quotes={Home:['The caravan gathers here; the latest word travels with the wind.','Rest beneath our banners and hear what stirs beyond the dunes.','Every journey begins with news from the road.'],Boards:['A shared tale can light the way for another traveller.','Trade your stories beneath the awning; every voice has a place.','Listen well: the quietest traveller may know the safest passage.'],Exchange:['Weigh your Dunemarks carefully; a fair bargain outlasts a fortune.','Count the coin, inspect the wares, and leave with honour.','Even in a sea of sand, a good bargain is worth finding.'],Discord:['Tune to the caravan frequency; familiar voices shorten the crossing.','Across the dunes, a friendly voice is its own shelter.','The signal is clear. Join the conversation beyond the horizon.'],'Manual/wiki':['A well-read field guide saves more water than a hurried journey.','Learn the trail before you challenge the dunes.','Turn the page; knowledge is the lightest provision you can carry.'],'Staff roster':['A watchful crew keeps the caravan moving.','Every banner is stronger with a trusted hand behind it.','Meet the keepers of the caravan and the worlds beyond.'],'Support center':['Set down your burden; the caravan clerks are here to help.','A troubled journey deserves a patient listener.','Bring us the details, and we will help find the next step.'],'Account center':['Your journey has a place in the caravan ledger.','Keep your records in order and your next crossing within reach.','Behind every banner stands a traveller with a story of their own.'],'Clan center':['Raise your banner; the strongest caravan travels together.','Choose your companions well, and no horizon is too distant.','A shared purpose binds a clan more firmly than any crest.']};const choices=quotes[item.label]||['May your water last and your journey bring good fortune.'];const key=location.hostname+location.pathname+location.hash;let seed=0;for(const character of key)seed=(seed*31+character.charCodeAt(0))>>>0;lore.textContent=choices[seed%choices.length];text.append(lore);const npc=document.createElement('img');npc.src='https://www.dunerealms.com/assets/nav-account-v2.webp';npc.alt='Caravan guide';npc.style.cssText='width:48px;height:48px;object-fit:contain';text.prepend(npc);text.append(small,title);if(worlds&&!worlds.querySelector('.dune-join-box')){const join=document.createElement('div');join.className='dune-join-box';const address=document.createElement('code');address.textContent='play.dunerealms.com';const button=document.createElement('button');button.type='button';button.textContent='Join now';button.setAttribute('aria-label','Join now: copy Minecraft server address');const help=document.createElement('p');help.className='dune-join-help';help.textContent='Java & Bedrock · copy the server address';help.setAttribute('role','status');button.addEventListener('click',async()=>{try{await navigator.clipboard.writeText('play.dunerealms.com');button.textContent='Copied ✓';help.textContent='Address copied · choose Add Server in Java or Bedrock.';}catch{help.textContent='In Minecraft Java, add a server with address play.dunerealms.com.';}});const ports=document.createElement('div');ports.className='dune-join-ports';for(const [edition,port]of [['Bedrock','19132'],['Java','25565']]){const box=document.createElement('span'),label=document.createElement('small'),value=document.createElement('code');label.textContent=edition+' port';value.textContent=port;const icon=document.createElement('img');icon.className='edition-icon';icon.alt='';icon.width=12;icon.height=12;icon.src='https://www.dunerealms.com/assets/edition-'+(edition==='Java'?'java':'bedrock')+'.svg';box.append(icon,label,value);ports.append(box);}join.append(address,button,ports,help);worlds.append(join);}if(worlds&&!worlds.querySelector('.world-network-art')){worlds.querySelector('.eyebrow')?.remove();const plate=document.createElement('img');plate.className='world-network-art';plate.src='https://www.dunerealms.com/assets/vaerkring-network-title-v1.webp';plate.alt='Vaerkring Network';plate.width=280;plate.height=80;worlds.prepend(plate);}panel.append(image,text);if(worlds)panel.append(worlds);header.after(panel);if(!document.querySelector('.dune-shared-footer')){const old=document.querySelector('body>footer,.site-footer'),foot=old||document.createElement('footer');foot.className='dune-shared-footer';foot.replaceChildren();const brand=document.createElement('a');brand.href='https://www.dunerealms.com/';brand.textContent='✦ dunerealms.com';brand.className='dune-footer-brand';const links=document.createElement('nav');links.setAttribute('aria-label','Footer navigation');for(const [label,href]of [['Manual/wiki','https://wiki.dunerealms.com/'],['Support','https://support.dunerealms.com/'],['Account','https://cp.dunerealms.com/'],['Disclaimer & contact','https://www.dunerealms.com/wiki.html']]){const a=document.createElement('a');a.textContent=label;a.href=href;links.append(a);}const note=document.createElement('small');note.textContent='Independent fan project · Not affiliated with Dune rights holders, Mojang or Microsoft.';foot.append(brand,links);const host=document.createElement('a');host.className='dune-hosting-badge';host.href='https://www.hetzner.com/';host.target='_blank';host.rel='noopener noreferrer';host.setAttribute('aria-label','Powered by Hetzner — visit Hetzner');const server=document.createElement('span');server.className='dune-hosting-art';server.textContent='▤';server.setAttribute('aria-hidden','true');const hostText=document.createElement('span');const powered=document.createElement('span');powered.textContent='POWERED BY';const hostLogo=document.createElement('img');hostLogo.src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxODEuNDIgMjIuMjQiPjxkZWZzPjxzdHlsZT4uY2xzLTF7ZmlsbDojZDUwYzJkO308L3N0eWxlPjwvZGVmcz48dGl0bGU+RWxlbWVudCAxPC90aXRsZT48ZyBpZD0iRWJlbmVfMiIgZGF0YS1uYW1lPSJFYmVuZSAyIj48ZyBpZD0iTG9nb19QdXIiIGRhdGEtbmFtZT0iTG9nbyBQdXIiPjxnIGlkPSJMb2dvIj48ZyBpZD0iSEVUWk5FUiI+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNMTc0LjA1LDE0LjEyYTEwLjIyLDEwLjIyLDAsMCwwLDQuNTMtMmwwLDBhNi4xNSw2LjE1LDAsMCwwLDEuNjgtNC43OCw3LjcxLDcuNzEsMCwwLDAtMS4xNC00LjA2QTYuNDcsNi40NywwLDAsMCwxNzMuODQuMDls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jIuMzIsMjIuMzMsMCwyMS42MywwWiIvPjwvZz48L2c+PC9nPjwvZz48L3N2Zz4=";hostLogo.alt='Hetzner';hostLogo.width=120;hostLogo.height=20;hostText.append(powered,hostLogo);host.append(server,hostText);host.title='Hosting infrastructure · Logo: Hetzner Online GmbH';foot.append(host);foot.append(note);const legal=document.querySelector('.legal-notice');if(legal){const details=document.createElement('details'),summary=document.createElement('summary');summary.textContent='Unofficial fan project';details.className='dune-footer-legal';details.append(summary,legal);foot.append(details);}if(['www.dunerealms.com','dunerealms.com'].includes(location.hostname)&&['/','/index.html'].includes(location.pathname)){const box=document.createElement('div');box.className='dune-footer-parental';const heading=document.createElement('strong');heading.textContent='Parents & guardians';const copy=document.createElement('span');copy.textContent='Parental consent or a child’s account-data request? Contact our support team.';const link=document.createElement('a');link.href='https://support.dunerealms.com/open.php';link.textContent='Parental help →';box.append(heading,copy,link);foot.append(box);}if(!old)document.body.append(foot);}const pin=()=>document.documentElement.style.setProperty('--dune-nav-height',header.getBoundingClientRect().height+'px');pin();if(!header.dataset.pinObserved){new ResizeObserver(pin).observe(header);header.dataset.pinObserved='1';}}render();async function refreshWorlds(){try{const response=await fetch('/api/worlds',{cache:'no-store',credentials:'omit',signal:AbortSignal.timeout(7000)});if(!response.ok)throw Error();const data=await response.json(),panel=document.querySelector('.dune-page-marker .world-status');if(!panel)return;const list=panel.querySelector('.world-status-list');list.replaceChildren();const glyphs={Arrakduin:'serevan',Kaladam:'pelareth',Giedermark:'varkesh',Kaiterhof:'orivane','Sigmadraken IV':'nivareth'};list.setAttribute('role','table');list.setAttribute('aria-label','World and connection status');for(const server of data.servers){const row=document.createElement('li'),name=document.createElement('span'),state=document.createElement('span'),icon=document.createElement('img');const display=server.name==='Velocity'?'Proxi':server.name;row.setAttribute('role','row');name.setAttribute('role','cell');name.className='world-name';name.title=display;icon.alt='';icon.width=14;icon.height=14;icon.src=glyphs[server.name]?'https://www.dunerealms.com/assets/planet-glyphs/'+glyphs[server.name]+'.svg':server.name==='Velocity'?'https://www.dunerealms.com/assets/network-proxy.svg':'https://www.dunerealms.com/assets/nav-home-v2.webp';name.append(icon,document.createTextNode(display));const status=server.state==='online'?'Online':server.state==='offline'?'Offline':'Unknown';state.setAttribute('role','cell');state.setAttribute('aria-label',status);state.title=status;state.className='world-state traffic-light '+server.state;for(const color of ['red','amber','green']){const lamp=document.createElement('i');lamp.className='lamp-'+color;lamp.setAttribute('aria-hidden','true');state.append(lamp);}row.append(name,state);list.append(row);}panel.querySelector('.world-status-note').textContent=data.available?'Live check · updates every 30s':'Status check unavailable';}catch{const note=document.querySelector('.dune-page-marker .world-status-note');if(note)note.textContent='Status check unavailable · retrying';}}refreshWorlds();setInterval(()=>{if(!document.hidden)refreshWorlds();},30000);addEventListener('hashchange',()=>{render();refreshWorlds();});})(); /* DuneRealms action system v1 */ (()=>{ const selector='button,input[type=submit],input[type=button],input[type=reset],a.button,a.btn,a.action-button,[role=button],.ui.button,.cp-area-tabs>button,.tabs>a,.git-control-actions>a,.exchange-actions>a'; @@ -28,7 +28,7 @@ window.addEventListener('hashchange',()=>scan(document)); })(); -(()=>{const stamp=()=>{const brand=document.querySelector('.dune-site-header .wordmark');if(!brand)return false;if(!brand.querySelector('.dune-release-badge')){const badge=document.createElement('span');badge.className='dune-release-badge';badge.textContent='Alpha';brand.append(badge);fetch('https://www.dunerealms.com/release.json',{cache:'no-store'}).then(r=>r.ok?r.json():null).then(release=>{if(release&&release.stage==='alpha'&&/^\d+(?:\.\d+){3}$/.test(release.version))badge.textContent='Alpha '+release.version;}).catch(()=>{});}return true;};if(!stamp()){const observer=new MutationObserver(()=>{if(stamp())observer.disconnect();});observer.observe(document.documentElement,{childList:true,subtree:true});}})(); +(()=>{const stamp=()=>{const brand=document.querySelector('.dune-site-header .wordmark');if(!brand)return false;if(!brand.querySelector('.dune-release-badge')){const badge=document.createElement('span');badge.className='dune-release-badge';badge.textContent='Alpha';brand.append(badge);fetch('/release.json',{cache:'no-store'}).then(r=>r.ok?r.json():null).then(release=>{if(release&&release.stage==='alpha'&&/^\d+(?:\.\d+){3}$/.test(release.version))badge.textContent='Alpha '+release.version;}).catch(()=>{});}return true;};if(!stamp()){const observer=new MutationObserver(()=>{if(stamp())observer.disconnect();});observer.observe(document.documentElement,{childList:true,subtree:true});}})(); /* Unified main menu Shop v1 */ (()=>{const update=()=>{for(const nav of document.querySelectorAll('header nav[aria-label="Main navigation"]')){if(nav.querySelector('a[data-dune-shop],a[href="https://www.dunerealms.com/shop.html"]'))continue;const a=document.createElement('a');a.href='https://www.dunerealms.com/shop.html';a.dataset.duneShop='1';const i=document.createElement('img');i.src='https://www.dunerealms.com/assets/nav-exchange-v2.webp';i.alt='';i.width=34;i.height=34;const t=document.createElement('span');t.textContent='Shop';a.append(i,t);const exchange=[...nav.querySelectorAll('a')].find(a=>a.textContent.trim()==='Exchange'||a.textContent.trim()==='Exchange');if(exchange)exchange.after(a);else nav.append(a);}};update();new MutationObserver(update).observe(document.body,{childList:true,subtree:true});})(); @@ -62,4 +62,4 @@ (()=>{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: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});})(); +(()=>{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: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('/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});})(); diff --git a/website/web/release.json b/website/web/release.json index b8d692cb..859bb370 100644 --- a/website/web/release.json +++ b/website/web/release.json @@ -1,6 +1,6 @@ { - "version": "1.0.1.0", + "version": "1.0.0.5", "stage": "alpha", "updatedAt": "2026-11-13T00:06:04.014493+00:00", - "scope": "Control Panel V2. Existing services connected; unconnected services remain labelled as planned." + "scope": "Latest published Alpha release. Development batches are not a new published release." }