Update Site source

This commit is contained in:
Meghdad committed 2026-10-13 00:25:42 +03:30
1 parent 80a257835f
commit 783bcf2dd8
15 files changed
+48 -41

No files matched your search

+4
View File
@@ -0,0 +1,4 @@
// Vector interpretation of Albion's Siphoned Energy vial: cyan energy, dark metal rings and a brass cap.
// Reference: https://assets.albiondatabase.com/icons/items/UNIQUE_GVGTOKEN_GENERIC.png
export const energyArt = `<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128" viewBox="0 0 128 128"><title>سایفوند انرژی</title><defs><radialGradient id="a"><stop stop-color="#2dcdff" stop-opacity=".25"/><stop offset="1" stop-color="#071522" stop-opacity="0"/></radialGradient><linearGradient id="b" x1="0" x2="1"><stop stop-color="#0876b6"/><stop offset=".38" stop-color="#36dcff"/><stop offset=".7" stop-color="#1bbcf5"/><stop offset="1" stop-color="#075d91"/></linearGradient><linearGradient id="c" x2="1" y2="1"><stop stop-color="#8396a5"/><stop offset=".3" stop-color="#304253"/><stop offset=".65" stop-color="#172635"/><stop offset="1" stop-color="#586e7e"/></linearGradient><linearGradient id="d" x2="1" y2="1"><stop stop-color="#f7d57b"/><stop offset=".5" stop-color="#b88c32"/><stop offset="1" stop-color="#6d501c"/></linearGradient></defs><rect width="128" height="128" rx="28" fill="#081521"/><circle cx="64" cy="65" r="62" fill="url(#a)"/><g transform="rotate(28 64 65)"><path d="M56 10v13m16-13v13" stroke="#263847" stroke-width="7" stroke-linecap="round"/><rect x="44" y="26" width="40" height="79" rx="20" fill="#061c2a" stroke="#7ca5bf" stroke-width="2"/><rect x="48" y="30" width="32" height="70" rx="16" fill="url(#b)"/><path d="M56 36c14 12 5 20 13 28s-7 14-9 29M72 36c-16 13-13 25-4 32s-3 16-10 20" fill="none" stroke="#b5f6ff" stroke-width="2.8" stroke-linecap="round"/><path d="M51 39v43" stroke="#d2faff" stroke-width="3" stroke-linecap="round" opacity=".55"/><path d="M43 47c11 5 31 5 42 0v9c-11 5-31 5-42 0zM43 80c11 5 31 5 42 0v9c-11 5-31 5-42 0z" fill="url(#c)" stroke="#102432" stroke-width="2"/><path d="M47 49c8 3 25 3 34 0M47 82c8 3 25 3 34 0" stroke="#7d9aac" stroke-width="1.5" opacity=".8"/><path d="M42 24c0-14 44-14 44 0v9c-1 14-43 14-44 0z" fill="url(#d)" stroke="#f0cd71" stroke-width="1.5"/><ellipse cx="64" cy="24" rx="22" ry="12" fill="url(#d)" stroke="#f0cd71" stroke-width="2"/><ellipse cx="64" cy="24" rx="17" ry="8" fill="#8f6a29" stroke="#edca77" stroke-width="1"/><path d="m62 18 5 5-5 6 1-5-4-2z" fill="#ffdfa0"/></g><path d="M17 64h5m-2-2v5M106 84h5m-2-2v5" stroke="#70dfff" stroke-width="1.5" opacity=".8"/></svg>`;
export const energyArtDataUri = 'data:image/svg+xml;base64,' + btoa(energyArt.replace(/[\u0080-\uffff]/g, c=>'&#'+c.charCodeAt(0)+';'));
+12 -11
View File
@@ -1,22 +1,23 @@
import {energyArtDataUri} from './energy-art.mjs';
import { ledgerSnapshot } from './share';
import { fa, persianNumber as n, persianDigits } from './persian-text';
type Snapshot = Awaited<ReturnType<typeof ledgerSnapshot>>;
export const cardWidth=1600,cardHeight=1200,cardEdition='fa-v3';
const gold='#d1ab6c',muted='#94999f';
export const cardWidth=1600,cardHeight=1200,cardEdition='blue-v1';
const energy='#56d3ff',muted='#94999f';
const panel={display:'flex',flexDirection:'column' as const,flex:1,padding:'22px 26px',borderRadius:14};
const short=(value:string,max=21)=>value.length>max?value.slice(0,max-1)+'…':value;
export function ShareCard({data}:{data:Snapshot}) {
const top=data.players.slice(0,8), low=[...data.low].sort((a,b)=>a.balance-b.balance).slice(0,8);
const ready=data.players.length-data.low.length;
return <div style={{width:'100%',height:'100%',display:'flex',flexDirection:'column',backgroundColor:'#101214',padding:48,fontFamily:'Vazirmatn',color:'#e9e8e5'}}>
return <div style={{width:'100%',height:'100%',display:'flex',flexDirection:'column',backgroundColor:'#080f18',padding:48,fontFamily:'Vazirmatn',color:'#e8f2fa'}}>
<div style={{display:'flex',justifyContent:'space-between',alignItems:'center',height:56}}>
<div style={{display:'flex',alignItems:'center',gap:11,color:'#91bba8',fontSize:22,padding:'8px 18px',border:'1px solid #344b3c',borderRadius:25,backgroundColor:'#1c2521'}}>{fa('آخرین وضعیت خزانه')}<div style={{display:'flex',width:9,height:9,borderRadius:10,backgroundColor:'#91bba8'}}/></div>
<div style={{display:'flex',alignItems:'center',gap:18,fontSize:33,fontWeight:700}}>{fa('خزانه سایفوند انرژی')}<div style={{display:'flex',width:52,height:54,border:'2px solid #d1ab6c',borderRadius:12,alignItems:'center',justifyContent:'center',color:gold,fontSize:31}}>{fa('س')}</div></div>
<div style={{display:'flex',alignItems:'center',gap:18,fontSize:33,fontWeight:700}}>{fa('خزانه سایفوند انرژی')}<img src={energyArtDataUri} width={64} height={64}/></div>
</div>
<div style={{display:'flex',justifyContent:'flex-end',marginTop:18,fontSize:45,fontWeight:700}}>{fa('سهم هر عضو، قدرت تمام گیلد')}</div>
<div style={{display:'flex',justifyContent:'flex-end',marginTop:3,fontSize:22,color:muted}}>{fa(`${n(data.players.length)} عضو · ${n(data.count)} تراکنش · ${n(ready)} عضو آماده نبرد`)}</div>
<div style={{display:'flex',gap:18,marginTop:23,height:155}}>
{[{label:'نیازمند اقدام',value:data.low.length,color:'#e19b58',sub:`${n(data.players.filter(p=>p.balance<0).length)} حساب بدهکار`},{label:'کل برداشت',value:data.withdrawals,color:'#da9494',sub:'سایفوند انرژی مصرف شده'},{label:'کل واریز',value:data.deposits,color:'#91bba8',sub:'مجموع سهم اعضای گیلد'},{label:'بالانس خزانه',value:data.balance,color:data.balance<0?'#e47878':gold,sub:'سایفوند انرژی · خالص واریز و برداشت'}].map(stat=><div key={stat.label} style={{display:'flex',flexDirection:'column',alignItems:'flex-end',flex:1,padding:'13px 23px',backgroundColor:'#191b1e',border:'1px solid #353332',borderRadius:13}}><div style={{display:'flex',fontSize:21,color:muted}}>{fa(stat.label)}</div><div style={{display:'flex',fontSize:48,fontWeight:700,color:stat.color,height:67,alignItems:'center'}}>{n(stat.value)}</div><div style={{display:'flex',fontSize:16,color:muted}}>{fa(stat.sub)}</div></div>)}
{[{label:'نیازمند اقدام',value:data.low.length,color:'#e19b58',sub:`${n(data.players.filter(p=>p.balance<0).length)} حساب بدهکار`},{label:'کل برداشت',value:data.withdrawals,color:'#da9494',sub:'سایفوند انرژی مصرف شده'},{label:'کل واریز',value:data.deposits,color:'#91bba8',sub:'مجموع سهم اعضای گیلد'},{label:'بالانس خزانه',value:data.balance,color:data.balance<0?'#e47878':energy,sub:'سایفوند انرژی · خالص واریز و برداشت'}].map(stat=><div key={stat.label} style={{display:'flex',flexDirection:'column',alignItems:'flex-end',flex:1,padding:'13px 23px',backgroundColor:'#101c29',border:'1px solid #253a4d',borderRadius:13}}><div style={{display:'flex',fontSize:21,color:muted}}>{fa(stat.label)}</div><div style={{display:'flex',fontSize:48,fontWeight:700,color:stat.color,height:67,alignItems:'center'}}>{n(stat.value)}</div><div style={{display:'flex',fontSize:16,color:muted}}>{fa(stat.sub)}</div></div>)}
</div>
<div style={{display:'flex',gap:24,marginTop:24,height:435}}>
<div style={{...panel,border:'1px solid #5a4431',backgroundColor:'#28221c'}}>
@@ -26,14 +27,14 @@ export function ShareCard({data}:{data:Snapshot}) {
{!low.length&&<div style={{display:'flex',justifyContent:'flex-end',marginTop:20,color:'#91bba8',fontSize:23}}>{fa('همه اعضا برای نبرد آماده‌اند')}</div>}
<div style={{display:'flex',justifyContent:'flex-end',marginTop:'auto',paddingTop:8,fontSize:16,color:'#ad9580'}}>{fa(data.low.length>8?`${n(data.low.length-8)} حساب دیگر · برای جزئیات وارد سایت شو`:'برای رسیدن به حداقل، مبلغ واریز لازم را جبران کن')}</div>
</div>
<div style={{...panel,border:'1px solid #4a3e2c',backgroundColor:'#211e19'}}>
<div style={{display:'flex',justifyContent:'flex-end',fontSize:27,fontWeight:700,color:gold,marginBottom:5}}>{fa('لیدربورد · بالاترین بالانس‌ها')}</div>
<div style={{display:'flex',justifyContent:'space-between',fontSize:17,color:'#a6977c',borderBottom:'1px solid #443b2c',paddingBottom:8}}><div style={{display:'flex',width:160}}>{fa('بالانس')}</div><div style={{display:'flex',flex:1,justifyContent:'flex-end'}}>{fa('بازیکن')}</div><div style={{display:'flex',width:60,justifyContent:'flex-end'}}>{fa('رتبه')}</div></div>
{top.map((p,i)=><div key={p.name} style={{display:'flex',alignItems:'center',height:35,fontSize:22}}><div style={{display:'flex',width:160,color:p.balance<0?'#e47878':gold,fontWeight:700}}>{n(p.balance)}</div><div style={{display:'flex',flex:1,justifyContent:'flex-end'}}>{short(p.name)}</div><div style={{display:'flex',width:60,justifyContent:'flex-end',color:i<3?gold:muted}}>{n(i+1)}</div></div>)}
<div style={{display:'flex',justifyContent:'flex-end',marginTop:'auto',paddingTop:8,fontSize:16,color:'#a6977c'}}>{fa('رتبه‌بندی بر اساس خالص واریز و برداشت است')}</div>
<div style={{...panel,border:'1px solid #275772',backgroundColor:'#102b3e'}}>
<div style={{display:'flex',justifyContent:'flex-end',fontSize:27,fontWeight:700,color:energy,marginBottom:5}}>{fa('لیدربورد · بالاترین بالانس‌ها')}</div>
<div style={{display:'flex',justifyContent:'space-between',fontSize:17,color:'#94bcd4',borderBottom:'1px solid #285371',paddingBottom:8}}><div style={{display:'flex',width:160}}>{fa('بالانس')}</div><div style={{display:'flex',flex:1,justifyContent:'flex-end'}}>{fa('بازیکن')}</div><div style={{display:'flex',width:60,justifyContent:'flex-end'}}>{fa('رتبه')}</div></div>
{top.map((p,i)=><div key={p.name} style={{display:'flex',alignItems:'center',height:35,fontSize:22}}><div style={{display:'flex',width:160,color:p.balance<0?'#e47878':energy,fontWeight:700}}>{n(p.balance)}</div><div style={{display:'flex',flex:1,justifyContent:'flex-end'}}>{short(p.name)}</div><div style={{display:'flex',width:60,justifyContent:'flex-end',color:i<3?energy:muted}}>{n(i+1)}</div></div>)}
<div style={{display:'flex',justifyContent:'flex-end',marginTop:'auto',paddingTop:8,fontSize:16,color:'#94bcd4'}}>{fa('رتبه‌بندی بر اساس خالص واریز و برداشت است')}</div>
</div>
</div>
<div style={{display:'flex',flexDirection:'column',marginTop:24,border:'1px solid #30343b',borderRadius:14,padding:'17px 26px',backgroundColor:'#191b1e',height:232}}>
<div style={{display:'flex',flexDirection:'column',marginTop:24,border:'1px solid #294358',borderRadius:14,padding:'17px 26px',backgroundColor:'#101c29',height:232}}>
<div style={{display:'flex',justifyContent:'flex-end',fontSize:25,fontWeight:700,marginBottom:8}}>{fa('آخرین تراکنش‌ها')}</div>
{data.recent.map((r,i)=><div key={i} style={{display:'flex',justifyContent:'space-between',alignItems:'center',height:35,fontSize:21}}><div style={{display:'flex',width:150,color:r.amount>0?'#91bba8':'#e47878'}}>{r.amount>0?'+':''}{n(r.amount)}</div><div style={{display:'flex',width:110,color:r.amount>0?'#91bba8':'#e47878'}}>{fa(r.reason==='Deposit'?'واریز':'برداشت')}</div><div style={{display:'flex',width:330}}>{short(r.player,27)}</div><div style={{display:'flex',color:muted,fontSize:18}}>{persianDigits(r.date.replace(/-/g,'/'))}</div></div>)}
</div>
+1 -1
View File
@@ -4,7 +4,7 @@ export async function ledgerSnapshot(rows: {date:string;player:string;reason:str
const players = summarize(rows);
const digest = await crypto.subtle.digest('SHA-256', new TextEncoder().encode(rows.map(identity).sort().join('\n')));
const hash = Array.from(new Uint8Array(digest)).map(n=>n.toString(16).padStart(2,'0')).join('').slice(0,20);
const revision = `fa-v3-${hash}`;
const revision = `blue-v1-${hash}`;
return {
revision,
recent: rows.slice(0,4),