From e873ccc7784bcfcb1344f882ddceaf8ba9663c73 Mon Sep 17 00:00:00 2001 From: unimatrix Date: Mon, 16 Nov 2026 22:51:53 +0000 Subject: [PATCH] Simplify Claims into a compact dev-style overview with collapsible details --- docs/design/CLAIMS-COMPACT.md | 19 ++++++++++++ .../public/cp-v2/cp-v2-claims.css | 7 +++-- .../public/cp-v2/cp-v2-claims.mjs | 29 +++++++++++-------- 3 files changed, 40 insertions(+), 15 deletions(-) create mode 100644 docs/design/CLAIMS-COMPACT.md diff --git a/docs/design/CLAIMS-COMPACT.md b/docs/design/CLAIMS-COMPACT.md new file mode 100644 index 00000000..0147f91d --- /dev/null +++ b/docs/design/CLAIMS-COMPACT.md @@ -0,0 +1,19 @@ +# Compact claims page + +Reusable clan/company design: `1.0.0.9.organisation.claims`. +Implementation: `cp-v2-claims.mjs` and `cp-v2-claims.css`. + +Default view: four summary cards, Home Block, claimed-area table. Unknown live +values stay unknown; simulated data never fills the live summary or land table. +One collapsed section contains the existing temporary upgrade simulator. A +second contains charter artwork and essential rules, with the complete prices +linked to Rates & Charges. Keep both sections closed initially. + +Use the existing dark teal/green dev palette and outlined gold accents. Avoid +large solid orange/gold buttons. Company uses the same structure and its own +artwork; its unconnected simulation remains explicitly unavailable. + +Validation: browser fixture at 1200, 760 and 390 pixels; collapsed initial state, +expansion, artwork loading, no horizontal overflow or script errors. Existing +claim-command and tariff tests remain green. No payment, ownership or game +bridge behavior changed. diff --git a/website/control-panel/public/cp-v2/cp-v2-claims.css b/website/control-panel/public/cp-v2/cp-v2-claims.css index f913548f..abe66d8c 100644 --- a/website/control-panel/public/cp-v2/cp-v2-claims.css +++ b/website/control-panel/public/cp-v2/cp-v2-claims.css @@ -1,3 +1,4 @@ -.claims-banner{background:linear-gradient(90deg,#143a35ed,#142c37ad),url('https://www.dunerealms.com/assets/clan-atelier-v1.webp') center/cover;border:3px double #bba16b;border-radius:8px;padding:28px;color:#f0e0b9}.claims-banner small{letter-spacing:.15em;font:11px Arial,sans-serif}.claims-banner h2{font-size:28px}.claims-notice{border-left:3px solid #bd9f60;padding:12px 18px;background:#102c2c;color:#e9dec4;line-height:1.65}.claims-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin-top:20px}.claims-grid article{border:1px solid #b49a6166;background:linear-gradient(140deg,#234537,#142f32);color:#e8dec6;padding:24px;border-radius:8px}.claims-grid h3{color:#e5c788}.claims-grid p{line-height:1.7}.claims-grid button{padding:10px 16px;border:1px solid #a48d5a;background:#193831;color:#c6b993;border-radius:5px}.claims-grid button:disabled{opacity:.65;cursor:not-allowed} - -@media(max-width:720px){.claims-grid{grid-template-columns:1fr}} +.claims-banner{background:linear-gradient(90deg,#143a35ed,#142c37ad),url('https://www.dunerealms.com/assets/clan-atelier-v1.webp') center/cover;border:3px double #bba16b;border-radius:8px;padding:28px;color:#f0e0b9}.claims-banner small{letter-spacing:.15em;font:11px Arial,sans-serif}.claims-banner h2{font-size:28px}.claims-notice{border-left:3px solid #bd9f60;padding:12px 18px;background:#102c2c;color:#e9dec4;line-height:1.65}.claims-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin-top:20px}.claims-grid article{border:1px solid #b49a6166;background:linear-gradient(140deg,#234537,#142f32);color:#e8dec6;padding:24px;border-radius:8px}.claims-grid h3{color:#e5c788}.claims-grid p{line-height:1.7}.claims-grid button{padding:10px 16px;border:1px solid #a48d5a;background:#193831;color:#c6b993;border-radius:5px}.claims-grid button:disabled{opacity:.65;cursor:not-allowed} + +@media(max-width:720px){.claims-grid{grid-template-columns:1fr}} +.claims-compact{display:grid;gap:20px;min-width:0}.claims-compact .claims-banner{padding:24px 28px;border-width:1px}.claims-compact .claims-banner h2{margin:8px 0}.claims-compact .claims-banner p{margin:0;color:#c8d8cf}.claims-overview{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}.claims-overview article,.claims-compact>.claims-card{min-width:0;border:1px solid #b49a6155;border-radius:12px;background:linear-gradient(135deg,#183830,#112b30);padding:20px}.claims-overview small{display:block;color:#b9c9bf;line-height:1.5}.claims-overview strong{display:block;margin-top:8px;font-size:1.2rem;color:#ead6a0}.claims-compact h3{margin:0 0 12px;color:#ead6a0}.claims-compact p{line-height:1.65}.claims-muted{color:#bbcec5}.claims-compact summary{cursor:pointer;color:#e8cf95;font-weight:600;padding:8px 0;line-height:1.5}.claims-compact summary:focus-visible,.claims-compact button:focus-visible{outline:2px solid #8cd0c0;outline-offset:4px}.claims-simulation{margin-top:16px;border-top:1px solid #a68b4b44;padding-top:8px}.claims-simulation>.claims-notice{font-size:.9rem}.claims-compact .home-block-upgrade{border:1px solid #8d9c8744;border-radius:10px;padding:18px;background:#0e2729}.claims-compact .home-block-upgrade button{background:linear-gradient(135deg,#234951,#173638);border:1px solid #9b8b59;color:#f0dfb0;box-shadow:inset 0 1px #ffffff0b;font-weight:600}.claims-compact .home-block-upgrade button:hover:not(:disabled){background:#2a5455;border-color:#d5bb7a}.claims-reference{color:#c5d4ca}.claims-reference h4{color:#e5ce98;margin-bottom:4px}.claims-reference p{margin-top:4px}.claims-reference .organisation-deed-art{border:0;background:transparent;padding:0}.claims-reference .organisation-deed-art figcaption{display:none}.claims-reference .organisation-deed-art img{max-height:230px}.claims-compact .claim-preview-table{width:100%;border-collapse:collapse}.claims-compact .claim-preview-table th,.claims-compact .claim-preview-table td{text-align:left;padding:14px 10px;border-bottom:1px solid #9eac8750}.claims-compact .claim-preview-table th{color:#d9c68e;font-size:.9rem}.claims-compact .claim-preview-table td{color:#b9cec2}.claims-compact .claim-preview-scroll{overflow-x:auto;max-width:100%}@media(max-width:850px){.claims-overview{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:440px){.claims-compact{gap:14px}.claims-overview{gap:10px}.claims-overview article{padding:14px}.claims-overview strong{font-size:1rem}.claims-compact>.claims-card,.claims-compact .claims-banner{padding:18px}.claims-compact .claims-banner h2{font-size:23px}} diff --git a/website/control-panel/public/cp-v2/cp-v2-claims.mjs b/website/control-panel/public/cp-v2/cp-v2-claims.mjs index 93e1a6a0..a27ca097 100644 --- a/website/control-panel/public/cp-v2/cp-v2-claims.mjs +++ b/website/control-panel/public/cp-v2/cp-v2-claims.mjs @@ -1,16 +1,21 @@ import {createDeedArtwork} from './cp-v2-deed-art.mjs'; import {createHomeBlockUpgrade} from './cp-v2-home-block.mjs'; import {element as el} from './cp-v2-page-template.mjs'; -import {claimTariffs,claimMoney,CLAIM_TARIFF_VERSION,BASIC_POLITICAL_NOTICE,ORGANISATION_TRANSFER_NOTICE} from './cp-v2-claim-tariffs.mjs'; export function mountClaims(host,{kind='clan',name='Your organisation'}={}){ - const root=el('section',undefined,'claims-workspace'),hero=el('div',undefined,'claims-banner');hero.append(el('small','LAND & ESTATES'),el('h2',name+' · Claims'),el('p',kind==='company'?'Company premises and Charter Beacons.':'Clan estates, Home Standards and outposts.')); - root.append(hero,el('p','Land claims are coming soon. No land is reserved and no payment is taken from this page.','claims-notice')); - const rules=el('div',undefined,'claims-grid');for(const [title,copy]of [['One shared claim budget','Every chunk is 16 × 16 blocks. Limits count all chunks claimed by your organisation, not a radius or a separate allowance for each estate.'],['Basic → Keyed → Royal','Start Basic. Your original organisation key enables mother-house status; Royal status requires a political appointment and its new POL-key.'],['Upgrade at your Home Block','Claim-tier upgrades are performed ingame by right-clicking your Home Block. The temporary web button simulates that same command using fake data until the game bridge is ready.'],['Subhouse rights & costs','The mother house controls subordinate claim rights and management. The original organisation pays upkeep and upgrades, even when the mother performs the upgrade. Rights are never counted twice. Planned payment authority reuses Imperial Postbank mandates; bank-account ownership does not transfer.'],['WorldGuard bridge','Future game protection uses the central API and a DuneProtect/WorldGuard adapter. No regions are created or resized by this preview.']]){const card=el('article',undefined,'claims-card');card.append(el('h3',title),el('p',copy));rules.append(card);}root.append(rules);const homeBlock=kind==='clan'?createHomeBlockUpgrade():null;if(homeBlock)root.append(homeBlock.root); - const charter=el('section',undefined,'claims-card'),choice=el('select'),label=el('label','Tariff reference · this does not assign your organisation a tier'),tableWrap=el('div',undefined,'claim-preview-scroll'),table=el('table',undefined,'claim-preview-table');choice.setAttribute('aria-label','Claim tariff reference');for(const [value,title]of kind==='company'?[['company','Company tariffs']]:[['clan','Clan tariffs'],['protected','Protected House tariffs']]){const option=el('option',title);option.value=value;choice.append(option);}label.append(choice);tableWrap.tabIndex=0;tableWrap.setAttribute('role','region');tableWrap.setAttribute('aria-label','Planned claim tier prices');tableWrap.append(table);charter.append(el('h3','Claim charter & capacity'),el('p','Current tier, used chunks, available capacity, Home Block and payment status: not connected yet.'),label,tableWrap,el('p','Upkeep is monthly; unlock prices are paid once per sequential tier. Company capacity/costs × 1.5; protected capacity × 1.5 and costs × 0.5. Capacity rounds down to whole chunks.'));const rates=el('a','Open the full Rates & Charges guide →');rates.href='https://www.dunerealms.com/rates-and-charges.html#claims';rates.target='_top';charter.append(rates,el('small','Published preview · '+CLAIM_TARIFF_VERSION)); - function paint(){const head=el('thead'),heading=el('tr'),body=el('tbody');for(const text of ['Tier','Total chunks','Monthly upkeep','One-time unlock','Status requirement']){const cell=el('th',text);cell.scope='col';heading.append(cell);}head.append(heading);for(const row of claimTariffs(choice.value)){const tr=el('tr');tr.append(el('th',row.code),el('td',row.chunks),el('td',claimMoney(row.upkeepMinor)),el('td',claimMoney(row.unlockMinor)),el('td',row.requirement||'Previous tier'));body.append(tr);}table.replaceChildren(head,body);}choice.onchange=()=>{paint();deed.replaceWith(deed=createDeedArtwork(choice.value));};let deed=createDeedArtwork(kind);paint();charter.prepend(deed);root.append(charter); - const policy=el('section',undefined,'claims-card');policy.append(el('h3','Rights & planned Transfer of Power'),el('p',BASIC_POLITICAL_NOTICE),el('p',ORGANISATION_TRANSFER_NOTICE),el('p','Claim upkeep and unlocks go to the Tax treasury. Transfer and loan workflows are planned; no transaction is performed here.'));root.append(policy); - const grid=el('div',undefined,'claims-grid'); - for(const [title,copy,action]of [['Estates','Your registered land and ownership records will appear here.','View estates'],['Home Block & anchors','Your Home Block, location and WorldGuard synchronisation status will appear here. Right-click the Home Block ingame to upgrade claim capacity.','View Home Block'],['Boundaries','Preview estate borders and check neighbouring claims. The game bridge applies verified protection changes.','View boundaries'],['Upkeep & payments','Your applied tier, monthly upkeep and payment history will appear here. Claim upgrades are initiated ingame.','View upkeep']]){ - const card=el('article',undefined,'claims-card'),button=el('button',action);button.type='button';button.disabled=true;button.title='Coming soon';card.append(el('h3',title),el('p',copy),el('strong','Coming soon'),button);grid.append(card); - }root.append(grid);host.replaceChildren(root);return()=>{homeBlock?.dispose();root.remove();}; -} + const root=el('section',undefined,'claims-workspace claims-compact'); + const hero=el('header',undefined,'claims-banner');hero.append(el('small','LAND & ESTATES'),el('h2',name+' · Claims'),el('p','Your land, claim capacity and Home Block.'));root.append(hero); + const overview=el('section',undefined,'claims-overview');overview.setAttribute('aria-label','Claim overview'); + for(const [label,value]of [['Current charter','Not connected'],['Claimed chunks','— / —'],['Available chunks','—'],['Monthly upkeep','Not connected']]){const card=el('article');card.append(el('small',label),el('strong',value));overview.append(card);}root.append(overview); + const home=el('section',undefined,'claims-card claims-home');home.append(el('h3','Home Block'),el('p','Live location and claim upgrades will appear here.','claims-muted')); + const simulation=el('details',undefined,'claims-simulation'),summary=el('summary','Open upgrade simulation');simulation.append(summary,el('p','Temporary test data and test money. Your real land and bank balance are unchanged.','claims-notice')); + const homeBlock=kind==='clan'?createHomeBlockUpgrade():null; + if(homeBlock)simulation.append(homeBlock.root);else simulation.append(el('p','Company upgrade simulation is not connected yet.')); + home.append(simulation);root.append(home); + const estates=el('section',undefined,'claims-card');estates.append(el('h3','Your claims')); + const scroll=el('div',undefined,'claim-preview-scroll'),table=el('table',undefined,'claim-preview-table'),head=el('thead'),row=el('tr'); + for(const label of ['Estate','World','Chunks','Status']){const th=el('th',label);th.scope='col';row.append(th);}head.append(row);const body=el('tbody'),empty=el('td','Live claim records are not connected yet.');empty.colSpan=4;const emptyRow=el('tr');emptyRow.append(empty);body.append(emptyRow);table.append(head,body);scroll.append(table);scroll.tabIndex=0;scroll.setAttribute('role','region');scroll.setAttribute('aria-label','Your claimed areas');estates.append(scroll);root.append(estates); + const details=el('details',undefined,'claims-card claims-reference');details.append(el('summary','Details · charter levels, prices & rules'),createDeedArtwork(kind)); + const rates=el('a','Compare tiers and prices in Rates & Charges →');rates.href='https://www.dunerealms.com/rates-and-charges.html#claims';rates.target='_top';details.append(rates); + for(const [title,copy]of [['Claim capacity','One chunk is 16 × 16 blocks. Your allowance covers all your claimed chunks together.'],['Charter levels','Start Basic. An original key unlocks Keyed status; Royal status requires a political appointment. Personal voting rights are unchanged.'],['Subhouses & payments','A mother organisation manages subordinate claims. The original organisation keeps its accounts and pays upkeep and upgrades. Payments go to the Tax treasury.']]){details.append(el('h4',title),el('p',copy));} + root.append(details);host.replaceChildren(root);return()=>{homeBlock?.dispose();root.remove();}; +}