diff --git a/docs/design/DUNE-PORTRAIT-SOURCES.md b/docs/design/DUNE-PORTRAIT-SOURCES.md index da2d9c8a..a2a853f9 100644 --- a/docs/design/DUNE-PORTRAIT-SOURCES.md +++ b/docs/design/DUNE-PORTRAIT-SOURCES.md @@ -1,13 +1,10 @@ -# Dune character placeholder portraits +# Minecraft character placeholder atlas -Illustrative fictional role portraits, never player appointments. Actual player appointments take priority. Male/Female/Neutral selects only the default Consort illustration. +Active asset: dune-mc-portraits-1984-v1.png, 3 by 3 equal tiles. Generated for this project as original Minecraft-style character artwork, inspired by the costume palette and character archetypes of classic 1984 Dune. No film stills or actor photographs are used as active portrait assets. -Source pages: -- Gurney: https://www.slashfilm.com/644008/the-best-characters-in-dune-ranked/ -- Kynes: https://donaldmowat.com/dune-sharon-duncan-brewster-as-liet-kynes-close-up/ -- Leto: https://www.slashfilm.com/636905/dune-character-guide-whos-who-in-denis-villeneuves-sci-fi-epic/ -- Paul: https://scenestr.com.au/movies-tv/dune-film-review-20211206 -- Jessica: https://www.slashfilm.com/1782308/dune-atreides-harkonnen-family-tree-explained/ -- Stilgar: existing stilgar-portrait-v1.png asset. +Rows: +1. Male noble, female noble, male heir. +2. Sir Patrick-inspired arms master, elderly male desert scientist/Kynes, Stilgar-like warleader. +3. Neutral masked companion, female heir, neutral masked heir. -Film imagery comes from Dune promotional/editorial coverage. The project does not claim original authorship or an image licence. Sources are retained for provenance. +The former five downloaded film JPGs are removed from publication. Example portraits never create real player appointments. Real appointed players retain their own Minecraft avatar. diff --git a/docs/design/SEASONAL-DYNASTY-ARCHIVE.md b/docs/design/SEASONAL-DYNASTY-ARCHIVE.md new file mode 100644 index 00000000..dfd24c41 --- /dev/null +++ b/docs/design/SEASONAL-DYNASTY-ARCHIVE.md @@ -0,0 +1,13 @@ +# Seasonal dynasty archive — future design + +User idea, 17 November 2026. Preserve for the season implementation round; do not interrupt the current web publication. + +- For imperial-key/royal clans, capture the final Ruler, Consort and Heir at season close. +- Snapshot their then-current fictional names, titles and portraits. Preserve portrait content or an immutable asset reference, not only a mutable avatar URL. +- Allow previous generations to be added to a Royal Line / Dynasty Archive on the public genealogy. +- At the new season, allow a new fictional ruler name. Reusing a ruler name within that dynasty receives a regnal ordinal: II, III, IV, etc. +- Snapshots are historical records and never current authority. Account identity, login and current deed rights remain separate. +- Season-close capture must be idempotent so retrying the same close cannot create a duplicate generation or increment the ordinal twice. +- Exact season rollover, key carryover and new-deed rules remain future work. + +Season rollover clarification: carry over keyed clans (Original/Keyed and Royal); Basic clans are not carried over. Export eligible clan identity/deeds and the dynasty archive before creating the clean season database, then restore the selected carryover. This is future rollover design only, not authorisation to wipe the current/shared production database. Exact account, bank, claim and economy retention belongs to the eventual rollover specification. diff --git a/website/control-panel/public/clan-dynasty.css b/website/control-panel/public/clan-dynasty.css index 4dfcfd55..d2f87b1c 100644 --- a/website/control-panel/public/clan-dynasty.css +++ b/website/control-panel/public/clan-dynasty.css @@ -17,3 +17,4 @@ .dynasty-interior{position:relative;box-sizing:border-box;width:100%;padding:30px 24px;border:1px solid #b59a57;border-radius:14px;box-shadow:inset 0 0 0 5px #c5a45a0a,0 10px 26px #0003;background:linear-gradient(140deg,#15362de8,#0a201cdb)}.dynasty-interior>h3{text-align:center;font:600 23px 'Cinzel','Palatino Linotype',serif;color:#ebd393;margin:0 0 30px}.dynasty-family .dynasty-portrait{border-radius:4px 4px 18px 18px;border:4px double #ebcb78;outline:1px solid #806432;outline-offset:5px;background:radial-gradient(ellipse at top,#354736,#081e1a);box-shadow:0 0 0 8px #13281e,0 12px 20px #0007}.dynasty-family .dynasty-player{border:3px double #c7a85e}.dynasty-council{margin-top:24px;padding:24px}.dynasty-council-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}.dynasty-council .dynasty-specialist{width:100%;max-width:none;margin:0;padding:22px 18px;border:3px double #c7a85e;box-sizing:border-box}.dynasty-council .dynasty-specialist:before,.dynasty-council .dynasty-specialist:after{display:none}.dynasty-council .dynasty-player-arms{background:linear-gradient(#112a24df,#10231af0),url('https://www.dunerealms.com/assets/clan-atelier-v1.webp') center/cover}.dynasty-council .dynasty-player-envoy{background:linear-gradient(#182b32d9,#11262cf0),url('https://www.dunerealms.com/assets/political-small-council-v1.png') center/cover}.dynasty-council .dynasty-player>a{font-size:clamp(15px,1.6vw,19px)}.dynasty-council .dynasty-portrait{width:80px;height:80px}.dynasty-council .dynasty-portrait img{width:64px;height:64px}@media(max-width:600px){.dynasty-interior{padding:24px 12px}.dynasty-council-grid{grid-template-columns:minmax(0,1fr)}.dynasty-council .dynasty-specialist{padding:22px 18px}} .dynasty-example{border-style:dashed;box-shadow:inset 0 0 26px #d7b66110}.dynasty-example>strong{font:600 clamp(15px,1.6vw,20px) 'Cinzel','Palatino Linotype',serif;line-height:1.6;color:#d9c38d;overflow-wrap:break-word}.dynasty-example>small{font-size:10px;line-height:1.6;letter-spacing:.04em;color:#b6c5b8}.dynasty-example .dynasty-portrait img{object-fit:contain;image-rendering:auto} .dynasty-example .dynasty-portrait{overflow:visible}.dynasty-example .dynasty-portrait img{object-fit:cover;width:100%;height:100%;border-radius:inherit;object-position:center 30%} +.dynasty-example-voxel{display:block;width:100%;height:100%;border-radius:inherit;background-size:300% 300%;background-repeat:no-repeat;image-rendering:auto} diff --git a/website/control-panel/public/clan-dynasty.mjs b/website/control-panel/public/clan-dynasty.mjs index 0e8d91c8..d2d98a54 100644 --- a/website/control-panel/public/clan-dynasty.mjs +++ b/website/control-panel/public/clan-dynasty.mjs @@ -2,10 +2,11 @@ import {dynasticAddress} from './dynastic-address.mjs'; const el=(tag,text,cls)=>{const n=document.createElement(tag);if(text!==undefined)n.textContent=text;if(cls)n.className=cls;return n;}; function styles(){if(document.querySelector('link[data-clan-dynasty]'))return;const link=el('link');link.rel='stylesheet';link.href=new URL('./clan-dynasty.css',import.meta.url).href;link.dataset.clanDynasty='';document.head.append(link);} export function clanExamplePersona(clan,deed,role){ - if(role==='consort')return ({male:{name:'Leto',asset:'dune-leto-portrait-v1.jpg'},female:{name:'Jessica',asset:'dune-jessica-portrait-v1.jpg'},neutral:{name:'Liet-Kynes',asset:'dune-kynes-portrait-v1.jpg'}})[deed.consortPortrait||'female']||{name:'Liet-Kynes',asset:'dune-kynes-portrait-v1.jpg'}; - if(role==='ruler'||role==='heir'){const gender=role==='ruler'?(deed.ownerDefault||'male'):(deed.heirDefault||'male');if(gender==='female')return {name:'Jessica',asset:'dune-jessica-portrait-v1.jpg'};if(gender==='neutral')return {name:'Liet-Kynes',asset:'dune-kynes-portrait-v1.jpg'};} - if(role==='arms'&&clan.homeWorld==='arrakduin')return {name:'Stilgar',asset:'stilgar-portrait-v1.png'}; - return ({ruler:{name:'Leto',asset:'dune-leto-portrait-v1.jpg'},heir:{name:'Paul',asset:'dune-paul-portrait-v1.jpg'},arms:{name:'Gurney Halleck',asset:'dune-gurney-portrait-v1.jpg'},envoy:{name:'Liet-Kynes',asset:'dune-kynes-portrait-v1.jpg'}})[role]; + const asset='dune-mc-portraits-1984-v1.png',person=(name,cell)=>({name,asset,cell}); + if(role==='consort')return ({male:person('Leto',0),female:person('Jessica',1),neutral:person('Saren',6)})[deed.consortPortrait||'female']||person('Saren',6); + if(role==='ruler'||role==='heir'){const gender=role==='ruler'?(deed.ownerDefault||'male'):(deed.heirDefault||'male');if(gender==='female')return role==='heir'?person('Alia',7):person('Jessica',1);if(gender==='neutral')return role==='heir'?person('Ryn',8):person('Aren',6);} + if(role==='arms'&&clan.homeWorld==='arrakduin')return person('Stilgar',5); + return ({ruler:person('Leto',0),heir:person('Paul',2),arms:person('Gurney Halleck',3),envoy:person('Liet-Kynes',4)})[role]; } export function createDynastyTree({clan,deed,titles,placeholders=false}){ styles();const root=el('section',undefined,'clan-dynasty clan-dynasty-'+deed.kind),heading=el('header'),crest=el('img');crest.src=clan.emblem;crest.alt=clan.name+' crest';crest.width=crest.height=220;const shield=el('div',undefined,'dynasty-heraldic-shield');shield.append(crest);heading.append(shield,el('small','THE DYNASTY'),el('h2',clan.name));if(clan.colors)for(const key of ['primary','secondary','trim'])if(/^#[A-F0-9]{6}$/i.test(clan.colors[key]||''))root.style.setProperty('--clan-'+key,clan.colors[key]);root.append(heading); @@ -13,7 +14,7 @@ export function createDynastyTree({clan,deed,titles,placeholders=false}){ for(const [role,title]of [['ruler',titles.owner],['consort',titles.consort||'Consort'],['heir',titles.heir],['arms',titles.arms||'Master-at-Arms'],['envoy',titles.envoy||'Imperial Envoy']]){ const person=deed[role],card=el('article',undefined,'dynasty-player dynasty-player-'+role),portrait=el('div',undefined,'dynasty-portrait');card.append(el('small',['arms','envoy'].includes(role)?'CLAN SPECIALIST':role==='ruler'?'RULER':role==='heir'?'HEIR':'CONSORT')); if(person){const face=el('img');face.src='https://cp.dunerealms.com/api/avatars/face/roster/'+encodeURIComponent(person.username);face.alt=person.username+' Minecraft face';face.width=face.height=96;face.loading='lazy';portrait.append(face);const link=el('a',dynasticAddress(person,clan,titles,role));link.href='https://www.dunerealms.com/people/'+encodeURIComponent(person.username);const handle=el('small','@'+person.username);card.append(portrait,link,handle);} - else if(placeholders&&(deed.kind==='basic'||role==='consort')){const example=clanExamplePersona(clan,deed,role),art=el('img');art.src='https://www.dunerealms.com/assets/'+example.asset;art.alt=example.name+' · fictional example portrait';art.width=art.height=96;portrait.append(art);card.classList.add('dynasty-example');card.append(portrait,el('strong',dynasticAddress({characterName:example.name,characterGender:role==='ruler'?deed.ownerDefault:role==='heir'?deed.heirDefault:undefined},clan,titles,role)),el('small',role==='consort'?'Illustrative court portrait':'Illustrative character · position vacant'));if(role==='heir')card.append(el('small','Heir appointment unlocks with a clan key.'));} + else if(placeholders&&(deed.kind==='basic'||role==='consort')){const example=clanExamplePersona(clan,deed,role),art=el('span',undefined,'dynasty-example-voxel');art.setAttribute('role','img');art.setAttribute('aria-label',example.name+' · fictional Minecraft example portrait');art.style.backgroundImage='url(https://www.dunerealms.com/assets/'+example.asset+')';art.style.backgroundPosition=(example.cell%3*50)+'% '+(Math.floor(example.cell/3)*50)+'%';portrait.append(art);card.classList.add('dynasty-example');card.append(portrait,el('strong',dynasticAddress({characterName:example.name,characterGender:role==='ruler'?deed.ownerDefault:role==='heir'?deed.heirDefault:undefined},clan,titles,role)),el('small',role==='consort'?'Illustrative court portrait':'Illustrative character · position vacant'));if(role==='heir')card.append(el('small','Heir appointment unlocks with a clan key.'));} else{portrait.append(el('span','✦'));card.classList.add('dynasty-vacant');card.append(portrait,el('strong','Not appointed'),el('span',title));} if(['arms','envoy'].includes(role)){card.classList.add('dynasty-specialist');specialists.append(card);}else tree.append(card); }family.append(tree);root.append(family,council);return root; diff --git a/website/scripts/build.mjs b/website/scripts/build.mjs index 8c1ba2a9..8130ab63 100644 --- a/website/scripts/build.mjs +++ b/website/scripts/build.mjs @@ -31,7 +31,7 @@ function preparePublicHtml(html){ return result; } writeFileSync(path.join(web,'rates-and-charges.html'),bankRatesPage()); -let assetCount=0;let assetWriter=null;const types={'.html':'text/html; charset=utf-8','.css':'text/css; charset=utf-8','.js':'text/javascript; charset=utf-8','.json':'application/json; charset=utf-8','.jpg':'image/jpeg','.jpeg':'image/jpeg','.webp':'image/webp','.png':'image/png','.mp4':'video/mp4','.zip':'application/zip','.svg':'image/svg+xml'}; +let assetCount=0;let assetWriter=null;const types={'.html':'text/html; charset=utf-8','.css':'text/css; charset=utf-8','.js':'text/javascript; charset=utf-8','.json':'application/json; charset=utf-8','.webp':'image/webp','.png':'image/png','.mp4':'video/mp4','.zip':'application/zip','.svg':'image/svg+xml'}; function collect(directory){for(const entry of readdirSync(directory).sort()){const p=path.join(directory,entry);if(statSync(p).isDirectory())collect(p);else{const relative=path.relative(web,p).split(path.sep).join('/');if(/^assets\/seals\/[^/]+-provenance\.txt$/.test(relative)||/^assets\/organisation-deed(?:s)?-[a-z0-9-]+\.png$/.test(relative))continue;const type=types[path.extname(entry)];if(!type)throw Error('Unexpected asset: '+entry);const bytes=readFileSync(p);const payload=relative.endsWith('.html')?Buffer.from(preparePublicHtml(bytes.toString('utf8'))):relative==='portal-navigation.js'?Buffer.from(withCanonicalMenu(withMenuBadges(bytes.toString('utf8')))):relative==='portal-navigation.css'?Buffer.concat([bytes,Buffer.from(HOUSE_STYLE_CSS)]):bytes;writeSync(assetWriter,JSON.stringify('/'+relative)+':['+JSON.stringify(type)+','+JSON.stringify(payload.toString('base64'))+'],');assetCount++}}}if(existsSync(dist)){const resolved=path.resolve(dist);if(resolved!==path.join(root,'dist'))throw Error('Invalid dist directory');rmSync(resolved,{recursive:true,force:true})} mkdirSync(path.join(dist,'server'),{recursive:true});mkdirSync(path.join(dist,'.openai'),{recursive:true});assetWriter=openSync(path.join(dist,'server/index.js'),'w');writeSync(assetWriter,'const ASSET_DATA={');collect(web);writeSync(assetWriter,'};\n'); let api=['feed-api.mjs','exchange-api.mjs','forum-api.mjs','community-api.mjs','portal-api.mjs'].map(file=>readFileSync(path.join(root,'worker',file),'utf8').replace(/export /g,'')).join('\n');let runtime=readFileSync(path.join(root,'worker/runtime.mjs'),'utf8').replace(/^import .*;$/gm,''); diff --git a/website/tests/consort-preferences.test.mjs b/website/tests/consort-preferences.test.mjs index 12ec30ad..166ea2f1 100644 --- a/website/tests/consort-preferences.test.mjs +++ b/website/tests/consort-preferences.test.mjs @@ -1,4 +1,4 @@ import test from 'node:test';import assert from 'node:assert/strict';import {LocalD1} from './d1-adapter.mjs';import {CHARACTER_PREFERENCE_SCHEMA,readConsortPortrait,writeConsortPortrait,validateConsortPortrait} from '../node/character-preferences.mjs';import {clanExamplePersona} from '../control-panel/public/clan-dynasty.mjs';import {profilePayload} from '../control-panel/public/cp-v2/cp-v2-personal-records.mjs'; test('fictional Consort preference is stored per account and validates the three radio choices',async()=>{const db=new LocalD1('CREATE TABLE site_accounts(id TEXT PRIMARY KEY);'+CHARACTER_PREFERENCE_SCHEMA);try{db.sqlite.exec("INSERT INTO site_accounts VALUES('a'),('b')");assert.equal(await readConsortPortrait(db,'a'),'female');await db.batch([writeConsortPortrait(db,'a','male')]);assert.equal(await readConsortPortrait(db,'a'),'male');assert.equal(await readConsortPortrait(db,'b'),'female');assert.throws(()=>validateConsortPortrait('orientation'));assert.throws(()=>writeConsortPortrait(db,'a','arbitrary'));}finally{db.close();}}); test('profile payload carries the optional fictional preference and preserves legacy payloads',()=>{const fields={displayName:'Citizen',bio:'',publicInfo:'',socials:{}};assert.equal('consortPortrait' in profilePayload(fields),false);assert.equal(profilePayload({...fields,consortPortrait:'female'}).consortPortrait,'female');assert.throws(()=>profilePayload({...fields,consortPortrait:'invalid'}));}); -test('real character portrait examples follow the explicit preference and Fremen role',()=>{for(const [choice,name]of [['male','Leto'],['female','Jessica'],['neutral','Liet-Kynes']]){const p=clanExamplePersona({}, {consortPortrait:choice},'consort');assert.equal(p.name,name);assert.match(p.asset,/portrait/);}assert.equal(clanExamplePersona({homeWorld:'arrakduin'},{},'arms').name,'Stilgar');}); +test('real character portrait examples follow the explicit preference and Fremen role',()=>{for(const [choice,name]of [['male','Leto'],['female','Jessica'],['neutral','Saren']]){const p=clanExamplePersona({}, {consortPortrait:choice},'consort');assert.equal(p.name,name);assert.match(p.asset,/portrait/);}assert.equal(clanExamplePersona({homeWorld:'arrakduin'},{},'arms').name,'Stilgar');}); diff --git a/website/web/assets/dune-gurney-portrait-v1.jpg b/website/web/assets/dune-gurney-portrait-v1.jpg deleted file mode 100644 index 92e20e83..00000000 Binary files a/website/web/assets/dune-gurney-portrait-v1.jpg and /dev/null differ diff --git a/website/web/assets/dune-jessica-portrait-v1.jpg b/website/web/assets/dune-jessica-portrait-v1.jpg deleted file mode 100644 index 3eadc5c4..00000000 Binary files a/website/web/assets/dune-jessica-portrait-v1.jpg and /dev/null differ diff --git a/website/web/assets/dune-kynes-portrait-v1.jpg b/website/web/assets/dune-kynes-portrait-v1.jpg deleted file mode 100644 index 4d16f220..00000000 Binary files a/website/web/assets/dune-kynes-portrait-v1.jpg and /dev/null differ diff --git a/website/web/assets/dune-leto-portrait-v1.jpg b/website/web/assets/dune-leto-portrait-v1.jpg deleted file mode 100644 index 533942a6..00000000 Binary files a/website/web/assets/dune-leto-portrait-v1.jpg and /dev/null differ diff --git a/website/web/assets/dune-mc-portraits-1984-v1.png b/website/web/assets/dune-mc-portraits-1984-v1.png new file mode 100644 index 00000000..4e512951 Binary files /dev/null and b/website/web/assets/dune-mc-portraits-1984-v1.png differ diff --git a/website/web/assets/dune-paul-portrait-v1.jpg b/website/web/assets/dune-paul-portrait-v1.jpg deleted file mode 100644 index 64a87c7d..00000000 Binary files a/website/web/assets/dune-paul-portrait-v1.jpg and /dev/null differ