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
@@ -19,3 +19,7 @@ Balances are net amounts in the supplied history, without any inferred opening b
`/api/share-image` generates a 1600×1200 PNG server-side from D1 and the baseline using the bundled `next/og` renderer. It shows balance, deposits/withdrawals, low-balance count, top eight members, eight members needing a refill and their required top-ups, the four most recent transactions, and the latest game timestamp. Both the image and ledger API bypass application caching. Root metadata reads the same data and adds a content-derived revision to the image URL. The revision changes for backdated imports too; duplicates leave it unchanged. The header's sharing button adds the current Unix time in seconds as `t` to the versioned page URL, then copies the URL. Root metadata propagates the same timestamp to the image URL, allowing a fresh Discord unfurl even if ledger data has not changed. If clipboard access is unavailable, a selectable URL is shown. Discord controls its own cache: embeds already posted are not guaranteed to refresh automatically. The image endpoint always reads current data, including when requested using an older revision query.
The live card uses bundled OFL-licensed Vazirmatn regular/bold fonts. Persian labels are shaped into presentation forms for Satori, with explicit column ordering so player names and numbers retain their correct order. Persian numbers and dates use Persian digits; game timestamps are not converted to another timezone. The card edition is included in revisioned share links to invalidate earlier English previews.
## Energy palette and icon
The primary color is cyan-blue (`#56d3ff`) over deep navy (`#080f18`). The vector vial in `lib/energy-art.mjs` is shared by the hero, brand, live card, SVG/ICO/PNG favicon and Apple touch icon. It follows the cyan energy, dark metal bands and brass cap visible in the Siphoned Energy item reference: https://www.albiondatabase.com/items/siphoned-energy (icon: https://assets.albiondatabase.com/icons/items/UNIQUE_GVGTOKEN_GENERIC.png). Run `node scripts/generate-favicon.mjs` after changing the vector. Warning/debt colors remain amber/red to communicate balance status.
+4 -4
View File
@@ -26,13 +26,13 @@ export default function Dashboard({adminMode=false}:{adminMode?:boolean}){
}
async function importLog(){setSaving(true);setMessage('');try{const r=await fetch('/api/import',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({log})});const d=await r.json() as {error?:string;added:number;duplicates:number};if(!r.ok)throw Error(d.error);setMessage(`${num(d.added)} تراکنش جدید ثبت شد؛ ${num(d.duplicates)} رکورد تکراری کنار گذاشته شد.`);setLog('');await refresh();}catch(e){setMessage((e as Error).message);}finally{setSaving(false);}}
return <div className="shell"><aside className="sidebar"><a className="brand" href="/"><span className="brandmark"><Shield size={27}/></span><span dir="ltr">سایفوند انرژی<small>خزانه گیلد</small></span></a><div className="guild"><span className="guild-icon">S</span><div>خزانهٔ گیلد<small>آلبیون آنلاین</small></div><span className="live-dot"/></div><div className="nav-label">میدان گیلد</div><button className={view==='leaderboard'?'nav active':'nav'} onClick={()=>setView('leaderboard')}><Trophy size={19}/> لیدربورد <ChevronLeft size={16}/></button><button className={view==='history'?'nav active':'nav'} onClick={()=>setView('history')}><History size={19}/> تاریخچهٔ خزانه</button><button className="nav" onClick={()=>{setTab('low');setView('leaderboard');}}><Flame size={19}/> نیازمند اقدام <span className="nav-count">{num(low.length)}</span></button><div className="sidebar-bottom"><div className="pledge"><Shield size={22}/><p>قدرت گیلد، از سهم هر عضو شروع می‌شود.</p><small>هر سایفوند انرژی، یک قدم تا پیروزی</small></div><a className="nav" href="/admin"><Lock size={17}/> {admin?'پنل مدیریت':'ورود مدیر'} <ArrowUpRight size={16}/></a><span className="version">خزانه گیلد / نسخه ۱</span></div></aside>
<main><header className="topbar"><div className="breadcrumb">گیلد <ChevronLeft size={13}/><strong>خزانهٔ سایفوند انرژی</strong></div><div className="topbar-actions"><button className="share-button" disabled={!shareUrl||loading||!!error||sharing} onClick={shareLatest}><Share2 size={15}/>{sharing?'در حال اشتراک…':'اشتراک‌گذاری'}</button><span className="public-label"><span className="live-dot"/> نمای عمومی</span><a className="mobile-admin" href="/admin" aria-label="ورود مدیر"><Lock size={15}/></a></div></header><div className="content"><section className="hero"><div><div className="eyebrow"><span/> قدرت گیلد، از خزانه شروع می‌شود</div><h1>خزانه پُر. <em>گیلد قدرتمند.</em></h1><p>سهمت را ببین، جایگاهت را بشناس و برای نبرد بعدی آماده باش.</p><div className="hero-tags"><span><Shield size={14}/> شفاف برای همهٔ اعضا</span><span><RefreshCw size={14}/> به‌روزرسانی با لاگ بازی</span></div></div><div className="artifact" aria-hidden="true"><div className="orbit orbit-one"/><div className="orbit orbit-two"/><div className="bottle"><div className="bottle-cap"/><div className="bottle-neck"/><div className="bottle-body"><div className="liquid"/><Flame size={43}/></div></div><span className="artifact-label">سایفوند انرژی</span><i className="spark s1"/><i className="spark s2"/><i className="spark s3"/></div></section>
return <div className="shell"><aside className="sidebar"><a className="brand" href="/"><span className="brandmark"><img src="/siphoned-energy.svg" width="44" height="44" alt=""/></span><span dir="ltr">سایفوند انرژی<small>خزانه گیلد</small></span></a><div className="guild"><span className="guild-icon"><img src="/siphoned-energy.svg" width="31" height="31" alt=""/></span><div>خزانهٔ گیلد<small>آلبیون آنلاین</small></div><span className="live-dot"/></div><div className="nav-label">میدان گیلد</div><button className={view==='leaderboard'?'nav active':'nav'} onClick={()=>setView('leaderboard')}><Trophy size={19}/> لیدربورد <ChevronLeft size={16}/></button><button className={view==='history'?'nav active':'nav'} onClick={()=>setView('history')}><History size={19}/> تاریخچهٔ خزانه</button><button className="nav" onClick={()=>{setTab('low');setView('leaderboard');}}><Flame size={19}/> نیازمند اقدام <span className="nav-count">{num(low.length)}</span></button><div className="sidebar-bottom"><div className="pledge"><Shield size={22}/><p>قدرت گیلد، از سهم هر عضو شروع می‌شود.</p><small>هر سایفوند انرژی، یک قدم تا پیروزی</small></div><a className="nav" href="/admin"><Lock size={17}/> {admin?'پنل مدیریت':'ورود مدیر'} <ArrowUpRight size={16}/></a><span className="version">خزانه گیلد / نسخه ۱</span></div></aside>
<main><header className="topbar"><div className="breadcrumb">گیلد <ChevronLeft size={13}/><strong>خزانهٔ سایفوند انرژی</strong></div><div className="topbar-actions"><button className="share-button" disabled={!shareUrl||loading||!!error||sharing} onClick={shareLatest}><Share2 size={15}/>{sharing?'در حال اشتراک…':'اشتراک‌گذاری'}</button><span className="public-label"><span className="live-dot"/> نمای عمومی</span><a className="mobile-admin" href="/admin" aria-label="ورود مدیر"><Lock size={15}/></a></div></header><div className="content"><section className="hero"><div><div className="eyebrow"><span/> قدرت گیلد، از خزانه شروع می‌شود</div><h1>خزانه پُر. <em>گیلد قدرتمند.</em></h1><p>سهمت را ببین، جایگاهت را بشناس و برای نبرد بعدی آماده باش.</p><div className="hero-tags"><span><Shield size={14}/> شفاف برای همهٔ اعضا</span><span><RefreshCw size={14}/> به‌روزرسانی با لاگ بازی</span></div></div><div className="artifact" aria-hidden="true"><div className="orbit orbit-one"/><div className="orbit orbit-two"/><img className="energy-vial" src="/siphoned-energy.svg" width="174" height="174" alt=""/><span className="artifact-label">سایفوند انرژی</span><i className="spark s1"/><i className="spark s2"/><i className="spark s3"/></div></section>
{error&&<div className="notice error"><AlertTriangle size={18}/>{error} داده‌های اولیه نمایش داده می‌شوند.<button onClick={refresh}>تلاش مجدد</button></div>}
<section className="stats"><div className="stat"><div className="stat-top">بالانس خزانه <Coins size={19}/></div><strong className="gold" dir="ltr">{num(total)}<small>سایفوند انرژی</small></strong><span>خالص واریز و برداشت اعضا</span></div><div className="stat"><div className="stat-top">کل واریزها <ArrowDownLeft size={19}/></div><strong dir="ltr">{num(deposits)}<small className="green">واریز</small></strong><span>سهم اعضا در قدرت گیلد</span></div><div className="stat"><div className="stat-top">کل برداشت‌ها <ArrowUpRight size={19}/></div><strong dir="ltr">{num(withdrawals)}<small>برداشت</small></strong><span>{num(rows.length)} تراکنش ثبت‌شده</span></div><div className="stat"><div className="stat-top">اعضای نیازمند اقدام <Flame size={19}/></div><strong className="orange" dir="ltr">{num(low.length)}<small>از {num(players.length)} عضو</small></strong><span>بالانس کمتر از {num(minimum)} سایفوند انرژی</span></div></section>
<section className="stats"><div className="stat"><div className="stat-top">بالانس خزانه <Coins size={19}/></div><strong className="energy" dir="ltr">{num(total)}<small>سایفوند انرژی</small></strong><span>خالص واریز و برداشت اعضا</span></div><div className="stat"><div className="stat-top">کل واریزها <ArrowDownLeft size={19}/></div><strong dir="ltr">{num(deposits)}<small className="green">واریز</small></strong><span>سهم اعضا در قدرت گیلد</span></div><div className="stat"><div className="stat-top">کل برداشت‌ها <ArrowUpRight size={19}/></div><strong dir="ltr">{num(withdrawals)}<small>برداشت</small></strong><span>{num(rows.length)} تراکنش ثبت‌شده</span></div><div className="stat"><div className="stat-top">اعضای نیازمند اقدام <Flame size={19}/></div><strong className="orange" dir="ltr">{num(low.length)}<small>از {num(players.length)} عضو</small></strong><span>بالانس کمتر از {num(minimum)} سایفوند انرژی</span></div></section>
{adminMode&&<section className="admin-panel"><div className="section-title"><div><div className="eyebrow">خزانه را به‌روز نگه دار</div><h2>ورود لاگ خزانه</h2></div><Lock size={23}/></div><p>خروجی بازی را همراه عنوان ستون‌ها اینجا پیست کن. پیش‌نمایش را بررسی و سپس ثبت کن.</p><textarea aria-label="لاگ تراکنش‌ها" dir="ltr" placeholder={'"Date"\t"Player"\t"Reason"\t"Amount"'} value={log} onChange={e=>setLog(e.target.value)}/>{preview&&<div className={preview.error?'notice error':'notice'}>{preview.error||`${num(preview.total)} ردیف · ${num(preview.fresh)} جدید · ${num(preview.duplicates)} تکراری`}</div>}<button className="primary" disabled={!preview||!!preview.error||saving||loading||!!error} onClick={importLog}><Upload size={17}/>{saving?'در حال ثبت…':'ادغام و ثبت تراکنش‌ها'}</button>{message&&<p role="status">{message}</p>}<small>تشخیص تکرار: زمان، نام بازیکن، نوع و مقدار. لاگ ناقص یا نامعتبر به‌طور کامل رد می‌شود.</small></section>}
<section className="action-banner"><div className="action-icon"><Flame size={23}/></div><div><strong>برای نبرد بعدی، آماده‌ای؟</strong><p>حداقل {num(minimum)} سایفوند انرژی نگه دار. حساب منفی یعنی وقت جبران سهم خزانه است.</p></div><button onClick={()=>{setTab('low');setView('leaderboard');document.getElementById('leaderboard')?.scrollIntoView({behavior:'smooth'});}}>بررسی حساب‌های کم‌موجودی <ChevronLeft size={17}/></button></section>
<div className="lower-grid"><section className="leaderboard panel" id="leaderboard"><div className="section-title"><div><div className="eyebrow">سهم هر عضو ارزشمند است</div><h2>{view==='history'?'تاریخچهٔ خزانه':'لیدربورد اعضا'} <span>{num(players.length)} عضو</span></h2></div><Trophy className="gold" size={22}/></div><div className="mobile-views"><button className={view==='leaderboard'?'selected':''} onClick={()=>setView('leaderboard')}>لیدربورد</button><button className={view==='history'?'selected':''} onClick={()=>setView('history')}>تاریخچه</button></div><div className="filters"><div className="tabs"><button className={tab==='all'?'selected':''} onClick={()=>setTab('all')}>همهٔ اعضا</button><button className={tab==='low'?'selected':''} onClick={()=>setTab('low')}>نیازمند اقدام <span>{num(low.length)}</span></button></div><label className="search"><Search size={16}/><input value={query} onChange={e=>setQuery(e.target.value)} placeholder="نام بازیکن…" aria-label="جست‌وجوی بازیکن"/></label></div><div className="table-wrap"><table><thead><tr><th>{view==='history'?'زمان':'رتبه'}</th><th>بازیکن</th><th>{view==='history'?'نوع':'بالانس'}</th><th>{view==='history'?'مقدار':'وضعیت'}</th><th/></tr></thead><tbody>{view==='history'?rows.filter(r=>r.player.toLowerCase().includes(query.toLowerCase())&&(tab!=='low'||low.some(p=>p.name.toLowerCase()===r.player.toLowerCase()))).map(r=><tr key={identity(r)}><td className="date" dir="ltr">{digits(r.date)}</td><td><button className="player-name" dir="ltr" onClick={()=>setSelected(r.player)}>{r.player}</button></td><td>{r.reason==='Deposit'?'واریز':'برداشت'}</td><td className={r.amount>0?'green':'red'} dir="ltr">{r.amount>0?'+':''}{num(r.amount)}</td><td/></tr>):filtered.map(p=>{const rank=players.indexOf(p)+1;return <tr key={p.name} className={p.balance<0?'debt-row':''}><td><span className={'rank r'+rank}>{rank<4?<Trophy size={15}/>:num(rank)}</span></td><td><button className="player-cell" onClick={()=>setSelected(p.name)}><span className={'avatar a'+(rank%5)}>{p.name.slice(0,2).toUpperCase()}</span><span className="player-name" dir="ltr">{p.name}{rank===1&&<small>بزرگ‌ترین حامی خزانه</small>}</span></button></td><td><strong className={p.balance<0?'red':p.balance<minimum?'orange':''} dir="ltr">{num(p.balance)}</strong><small className="unit">سایفوند انرژی</small></td><td><span className={'badge '+(p.balance<0?'bad':p.balance<minimum?'warn':'good')}><i/>{status(p.balance)}</span></td><td><button className="row-open" onClick={()=>setSelected(p.name)} aria-label={'مشاهده حساب '+p.name}><ChevronLeft size={17}/></button></td></tr>;})}</tbody></table>{(view==='leaderboard'&&!filtered.length)&&<div className="empty">بازیکنی با این مشخصات پیدا نشد.</div>}</div><div className="table-footer">رتبه‌بندی بر اساس بالانس خالص <span>واریز − برداشت = بالانس</span></div></section>
<div className="lower-grid"><section className="leaderboard panel" id="leaderboard"><div className="section-title"><div><div className="eyebrow">سهم هر عضو ارزشمند است</div><h2>{view==='history'?'تاریخچهٔ خزانه':'لیدربورد اعضا'} <span>{num(players.length)} عضو</span></h2></div><Trophy className="energy" size={22}/></div><div className="mobile-views"><button className={view==='leaderboard'?'selected':''} onClick={()=>setView('leaderboard')}>لیدربورد</button><button className={view==='history'?'selected':''} onClick={()=>setView('history')}>تاریخچه</button></div><div className="filters"><div className="tabs"><button className={tab==='all'?'selected':''} onClick={()=>setTab('all')}>همهٔ اعضا</button><button className={tab==='low'?'selected':''} onClick={()=>setTab('low')}>نیازمند اقدام <span>{num(low.length)}</span></button></div><label className="search"><Search size={16}/><input value={query} onChange={e=>setQuery(e.target.value)} placeholder="نام بازیکن…" aria-label="جست‌وجوی بازیکن"/></label></div><div className="table-wrap"><table><thead><tr><th>{view==='history'?'زمان':'رتبه'}</th><th>بازیکن</th><th>{view==='history'?'نوع':'بالانس'}</th><th>{view==='history'?'مقدار':'وضعیت'}</th><th/></tr></thead><tbody>{view==='history'?rows.filter(r=>r.player.toLowerCase().includes(query.toLowerCase())&&(tab!=='low'||low.some(p=>p.name.toLowerCase()===r.player.toLowerCase()))).map(r=><tr key={identity(r)}><td className="date" dir="ltr">{digits(r.date)}</td><td><button className="player-name" dir="ltr" onClick={()=>setSelected(r.player)}>{r.player}</button></td><td>{r.reason==='Deposit'?'واریز':'برداشت'}</td><td className={r.amount>0?'green':'red'} dir="ltr">{r.amount>0?'+':''}{num(r.amount)}</td><td/></tr>):filtered.map(p=>{const rank=players.indexOf(p)+1;return <tr key={p.name} className={p.balance<0?'debt-row':''}><td><span className={'rank r'+rank}>{rank<4?<Trophy size={15}/>:num(rank)}</span></td><td><button className="player-cell" onClick={()=>setSelected(p.name)}><span className={'avatar a'+(rank%5)}>{p.name.slice(0,2).toUpperCase()}</span><span className="player-name" dir="ltr">{p.name}{rank===1&&<small>بزرگ‌ترین حامی خزانه</small>}</span></button></td><td><strong className={p.balance<0?'red':p.balance<minimum?'orange':''} dir="ltr">{num(p.balance)}</strong><small className="unit">سایفوند انرژی</small></td><td><span className={'badge '+(p.balance<0?'bad':p.balance<minimum?'warn':'good')}><i/>{status(p.balance)}</span></td><td><button className="row-open" onClick={()=>setSelected(p.name)} aria-label={'مشاهده حساب '+p.name}><ChevronLeft size={17}/></button></td></tr>;})}</tbody></table>{(view==='leaderboard'&&!filtered.length)&&<div className="empty">بازیکنی با این مشخصات پیدا نشد.</div>}</div><div className="table-footer">رتبه‌بندی بر اساس بالانس خالص <span>واریز − برداشت = بالانس</span></div></section>
<aside className="right-column"><section className="spotlight panel"><div className="eyebrow">بزرگ‌ترین حامی خزانه</div><div className="champion-medal"><Trophy size={35}/></div><span className="champion-sub">حامی شمارهٔ یک خزانه</span><h3 dir="ltr">{players[0]?.name||'—'}</h3><strong className="champion-balance" dir="ltr">{num(players[0]?.balance||0)} <small>سایفوند انرژی</small></strong><p>سهم بیشتر، گیلد قدرتمندتر.<br/>جایگاه بعدی می‌تواند مال تو باشد.</p><button onClick={()=>setSelected(players[0]?.name)}>مشاهدهٔ حساب <ChevronLeft size={15}/></button></section><section className="health panel"><h3><Shield size={18}/> وضعیت آمادگی گیلد</h3><div className="health-number"><strong>{num(Math.round((players.length-low.length)/Math.max(players.length,1)*100))}<small>%</small></strong><span>اعضا آماده‌اند</span></div><div className="progress"><i style={{width:`${(players.length-low.length)/Math.max(players.length,1)*100}%`}}/></div><div className="legend"><span><i className="green-dot"/>آماده <b>{num(players.length-low.length)}</b></span><span><i className="orange-dot"/>نیازمند شارژ <b>{num(low.filter(p=>p.balance>=0).length)}</b></span><span><i className="red-dot"/>بدهکار <b>{num(low.filter(p=>p.balance<0).length)}</b></span></div></section></aside></div>
<footer><span><span className="live-dot"/> {loading?'در حال دریافت…':`آخرین تراکنش: ${digits(rows[0]?.date||'—')}`}</span><button onClick={refresh} disabled={loading}><RefreshCw size={13}/> تازه‌سازی</button><p>بالانس بر اساس لاگ‌های ثبت‌شده است؛ موجودی پیش از اولین لاگ لحاظ نشده است.</p><span dir="ltr">برای گیلد ساخته شده، با سهم تو قدرتمند می‌شود</span></footer></div></main>
{shareNotice&&<div className="share-feedback" role="status" dir="auto">{shareNotice}</div>}
+5 -3
View File
@@ -1,10 +1,12 @@
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700;800&display=swap');
:root{--bg:#101214;--panel:#191b1e;--border:#2b2d30;--muted:#85888e;--text:#e9e8e5;--gold:#d1ab6c;--orange:#e19b58;--red:#e47878;--green:#80b6a0}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font:14px Vazirmatn,Tahoma,sans-serif}button,input,textarea{font:inherit}button,a,input,textarea{-webkit-tap-highlight-color:transparent}button,a{cursor:pointer}button{color:inherit;background:none;border:0}a{color:inherit;text-decoration:none}button:disabled{opacity:.45;cursor:wait}button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible{outline:2px solid var(--gold);outline-offset:4px}small{font-size:11px}.shell{display:flex;min-height:100vh}.sidebar{width:238px;flex-shrink:0;background:#151719;border-left:1px solid var(--border);padding:31px 22px;display:flex;flex-direction:column;position:sticky;top:0;height:100vh}.brand{display:flex;align-items:center;gap:12px;font-size:20px;font-weight:800;letter-spacing:2px}.brand small{display:block;color:var(--muted);font-size:8px;letter-spacing:2.5px;margin-top:4px}.brandmark{color:var(--gold);display:grid;place-items:center;background:#28241d;border:1px solid #53452d;border-radius:12px;width:44px;height:49px}.guild{display:flex;align-items:center;gap:11px;border:1px solid var(--border);border-radius:9px;margin:38px 0 32px;padding:12px 10px;font-size:12px}.guild-icon{background:#353027;color:var(--gold);border-radius:7px;padding:8px 12px;font:bold 15px Georgia}.guild small{display:block;color:var(--muted);margin-top:2px}.live-dot{display:inline-block;width:6px;height:6px;border-radius:100%;background:var(--green);box-shadow:0 0 8px #80b6a025}.guild .live-dot{margin-right:auto}.nav-label{font-size:10px;color:#656970;margin:0 12px 12px}.nav{width:100%;display:flex;align-items:center;gap:10px;border-radius:7px;padding:13px 12px;text-align:right;margin:3px 0;color:#92959a;font-size:12px}.nav.active{color:var(--gold);background:#29251e;border:1px solid #473c2c}.nav svg:last-child,.nav-count{margin-right:auto}.nav:hover{background:#25272a}.nav-count{background:#3a2a22;color:var(--orange);padding:0 6px;font-size:10px;border-radius:4px}.sidebar-bottom{margin-top:auto}.pledge{border-top:1px solid var(--border);padding:22px 8px;color:var(--gold)}.pledge p{font-size:12px;line-height:1.9;color:#aaa8a1}.pledge small{font-size:10px;color:#62666c}.version{display:block;color:#53575d;text-align:center;font-size:8px;letter-spacing:2px;margin-top:19px}main{min-width:0;flex:1}.topbar{height:73px;border-bottom:1px solid var(--border);display:flex;justify-content:space-between;align-items:center;padding:0 39px;font-size:11px}.breadcrumb{display:flex;align-items:center;gap:12px;color:var(--muted)}.breadcrumb strong{color:#c7c8ca;font-weight:500}.public-label{background:#1c2421;border:1px solid #2e3c35;border-radius:20px;padding:5px 11px;color:#9abaad;display:flex;align-items:center;gap:8px}.content{max-width:1440px;margin:auto;padding:0 39px}.hero{min-height:239px;display:flex;align-items:center;justify-content:space-between;overflow:hidden;position:relative}.eyebrow{font-family:Arial,sans-serif;letter-spacing:2px;color:var(--gold);font-size:9px;font-weight:600;display:flex;align-items:center;gap:9px}.eyebrow>span{width:18px;height:1px;background:var(--gold)}h1{font-size:34px;line-height:1.8;margin:13px 0 8px;letter-spacing:-1px}h1 em{font-style:normal;color:var(--gold)}.hero p{font-size:12px;color:#989ba1;margin:0}.hero-tags{display:flex;gap:23px;font-size:10px;color:#71757c;margin-top:23px}.hero-tags span{display:flex;gap:7px;align-items:center}.artifact{width:250px;height:220px;display:grid;place-items:center;position:relative;background:radial-gradient(ellipse,#b6742525 0%,transparent 66%)}.orbit{position:absolute;border:1px solid #aa855c28;width:175px;height:175px;border-radius:50%;transform:rotate(-25deg) scaleY(.55)}.orbit-two{transform:rotate(50deg) scaleY(.7);width:200px;height:200px}.bottle{height:151px;width:83px;position:relative;transform:rotate(-12deg);filter:drop-shadow(0 0 17px #d8973740)}.bottle-cap{background:linear-gradient(90deg,#473526,#caa67a,#554230);width:36px;height:17px;border:2px solid #91704c;margin:auto;border-radius:4px}.bottle-neck{height:22px;width:29px;margin:auto;background:linear-gradient(90deg,#79634570,#eed0a055,#60482e70);border:2px solid #a47e4e;border-bottom:0}.bottle-body{position:relative;height:108px;border-radius:18px 18px 28px 28px;border:2px solid #be955e;background:linear-gradient(110deg,#c7a77950,#31251d);overflow:hidden;display:grid;place-items:center;box-shadow:inset 6px 0 7px #e8b86b33,inset -9px 0 10px #100c0766}.bottle-body svg{z-index:2;color:#ffe0a4;filter:drop-shadow(0 0 6px #ffe48c)}.liquid{position:absolute;inset:20px 4px 5px;background:linear-gradient(#dc9e49,#b36524);border-radius:12px 12px 23px 23px;box-shadow:0 0 20px #dfa245}.artifact-label{position:absolute;bottom:15px;font:8px Arial;letter-spacing:3px;color:#94774e}.spark{position:absolute;width:3px;height:3px;background:#c99c5c;bLine truncated
:root{--bg:#080f18;--panel:#101c29;--border:#253a4d;--muted:#90a3b5;--text:#e8f2fa;--energy:#56d3ff;--orange:#e19b58;--red:#e47878;--green:#80b6a0}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font:14px Vazirmatn,Tahoma,sans-serif}button,input,textarea{font:inherit}button,a,input,textarea{-webkit-tap-highlight-color:transparent}button,a{cursor:pointer}button{color:inherit;background:none;border:0}a{color:inherit;text-decoration:none}button:disabled{opacity:.45;cursor:wait}button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible{outline:2px solid var(--energy);outline-offset:4px}small{font-size:11px}.shell{display:flex;min-height:100vh}.sidebar{width:238px;flex-shrink:0;background:#0c1622;border-left:1px solid var(--border);padding:31px 22px;display:flex;flex-direction:column;position:sticky;top:0;height:100vh}.brand{display:flex;align-items:center;gap:12px;font-size:20px;font-weight:800;letter-spacing:2px}.brand small{display:block;color:var(--muted);font-size:8px;letter-spacing:2.5px;margin-top:4px}.brandmark{color:var(--energy);display:grid;place-items:center;background:#102b3e;border:1px solid #275772;border-radius:12px;width:44px;height:49px}.guild{display:flex;align-items:center;gap:11px;border:1px solid var(--border);border-radius:9px;margin:38px 0 32px;padding:12px 10px;font-size:12px}.guild-icon{background:#132e40;color:var(--energy);border-radius:7px;padding:8px 12px;font:bold 15px Georgia}.guild small{display:block;color:var(--muted);margin-top:2px}.live-dot{display:inline-block;width:6px;height:6px;border-radius:100%;background:var(--green);box-shadow:0 0 8px #80b6a025}.guild .live-dot{margin-right:auto}.nav-label{font-size:10px;color:#656970;margin:0 12px 12px}.nav{width:100%;display:flex;align-items:center;gap:10px;border-radius:7px;padding:13px 12px;text-align:right;margin:3px 0;color:#92959a;font-size:12px}.nav.active{color:var(--energy);background:#123249;border:1px solid #275a76}.nav svg:last-child,.nav-count{margin-right:auto}.nav:hover{background:#182b3e}.nav-count{background:#3a2a22;color:var(--orange);padding:0 6px;font-size:10px;border-radius:4px}.sidebar-bottom{margin-top:auto}.pledge{border-top:1px solid var(--border);padding:22px 8px;color:var(--energy)}.pledge p{font-size:12px;line-height:1.9;color:#a4b8c9}.pledge small{font-size:10px;color:#62666c}.version{display:block;color:#53575d;text-align:center;font-size:8px;letter-spacing:2px;margin-top:19px}main{min-width:0;flex:1}.topbar{height:73px;border-bottom:1px solid var(--border);display:flex;justify-content:space-between;align-items:center;padding:0 39px;font-size:11px}.breadcrumb{display:flex;align-items:center;gap:12px;color:var(--muted)}.breadcrumb strong{color:#c4d9e9;font-weight:500}.public-label{background:#1c2421;border:1px solid #2e3c35;border-radius:20px;padding:5px 11px;color:#9abaad;display:flex;align-items:center;gap:8px}.content{max-width:1440px;margin:auto;padding:0 39px}.hero{min-height:239px;display:flex;align-items:center;justify-content:space-between;overflow:hidden;position:relative}.eyebrow{font-family:Arial,sans-serif;letter-spacing:2px;color:var(--energy);font-size:9px;font-weight:600;display:flex;align-items:center;gap:9px}.eyebrow>span{width:18px;height:1px;background:var(--energy)}h1{font-size:34px;line-height:1.8;margin:13px 0 8px;letter-spacing:-1px}h1 em{font-style:normal;color:var(--energy)}.hero p{font-size:12px;color:#9caec1;margin:0}.hero-tags{display:flex;gap:23px;font-size:10px;color:#71757c;margin-top:23px}.hero-tags span{display:flex;gap:7px;align-items:center}.artifact{width:250px;height:220px;display:grid;place-items:center;position:relative;background:radial-gradient(ellipse,#18c3ff25 0%,transparent 66%)}.orbit{position:absolute;border:1px solid #59d7ff28;width:175px;height:175px;border-radius:50%;transform:rotate(-25deg) scaleY(.55)}.orbit-two{transform:rotate(50deg) scaleY(.7);width:200px;height:200px}.bottle{height:151px;width:83px;position:relative;transform:rotate(-12deg);filter:drop-shadow(0 0 17px #d8973740)}.bottle-cap{background:linear-gradient(90deg,#473526,#caa67a,#554230);width:36px;height:17px;border:2px solid #91704c;margin:auto;border-radius:4px}.bottle-neck{height:22px;width:29px;margin:auto;background:linear-gradient(90deg,#79634570,#eed0a055,#60482e70);border:2px solid #a47e4e;border-bottom:0}.bottle-body{position:relative;height:108px;border-radius:18px 18px 28px 28px;border:2px solid #be955e;background:linear-gradient(110deg,#c7a77950,#31251d);overflow:hidden;display:grid;place-items:center;box-shadow:inset 6px 0 7px #e8b86b33,inset -9px 0 10px #100c0766}.bottle-body svg{z-index:2;color:#ffe0a4;filter:drop-shadow(0 0 6px #ffe48c)}.liquid{position:absolute;inset:20px 4px 5px;background:linear-gradient(#dc9e49,#b36524);border-radius:12px 12px 23px 23px;box-shadow:0 0 20px #dfa245}.artifact-label{position:absolute;bottom:15px;font:8px Arial;letter-spacing:3px;color:#71bddc}.spark{position:absolute;width:3px;height:3px;baLine truncated
.topbar-actions{display:flex;align-items:center;gap:14px}.mobile-admin,.mobile-views{display:none}@media(max-width:900px){.mobile-admin{display:flex;color:var(--gold)}.mobile-views{display:flex;gap:10px;margin:0 16px 15px;font-size:11px}.mobile-views button{padding:7px 12px;border:1px solid var(--border);border-radius:6px;color:var(--muted)}.mobile-views .selected{color:var(--gold);border-color:#6d5530}}
.topbar-actions{display:flex;align-items:center;gap:14px}.mobile-admin,.mobile-views{display:none}@media(max-width:900px){.mobile-admin{display:flex;color:var(--energy)}.mobile-views{display:flex;gap:10px;margin:0 16px 15px;font-size:11px}.mobile-views button{padding:7px 12px;border:1px solid var(--border);border-radius:6px;color:var(--muted)}.mobile-views .selected{color:var(--energy);border-color:#287ba4}}
.brand{letter-spacing:0;font-family:Vazirmatn,Tahoma,sans-serif}.brand small,.version,.eyebrow,.artifact-label{letter-spacing:0;font-family:Vazirmatn,Tahoma,sans-serif}.eyebrow{font-size:10px}.hero h1{letter-spacing:0}.stat strong small,.unit{font-family:Vazirmatn,Tahoma,sans-serif}.brand small{font-size:10px}.hero-tags{line-height:1.8}
.share-button{display:flex;align-items:center;gap:7px;background:#30291d;border:1px solid #685233;color:#e0bd82;padding:8px 12px;border-radius:7px;font-size:11px;white-space:nowrap}.share-button:hover{background:#3c3120}.share-feedback{position:fixed;bottom:25px;left:25px;z-index:12;max-width:min(460px,calc(100vw - 40px));padding:15px 19px;background:#242b25;border:1px solid #536653;border-radius:9px;box-shadow:0 8px 30px #0007;color:#c7dccd;overflow-wrap:anywhere;font-size:12px;user-select:text}@media(max-width:700px){.topbar-actions{gap:10px}.topbar-actions .public-label{display:none}.topbar .breadcrumb{gap:6px;font-size:10px}.share-button{padding:7px 9px;font-size:10px;gap:5px}.share-feedback{bottom:18px;left:18px}}
.share-button{display:flex;align-items:center;gap:7px;background:#12354e;border:1px solid #2e82a8;color:#a1e5ff;padding:8px 12px;border-radius:7px;font-size:11px;white-space:nowrap}.share-button:hover{background:#194a68}.share-feedback{position:fixed;bottom:25px;left:25px;z-index:12;max-width:min(460px,calc(100vw - 40px));padding:15px 19px;background:#242b25;border:1px solid #536653;border-radius:9px;box-shadow:0 8px 30px #0007;color:#c7dccd;overflow-wrap:anywhere;font-size:12px;user-select:text}@media(max-width:700px){.topbar-actions{gap:10px}.topbar-actions .public-label{display:none}.topbar .breadcrumb{gap:6px;font-size:10px}.share-button{padding:7px 9px;font-size:10px;gap:5px}.share-feedback{bottom:18px;left:18px}}
.brand>span:last-child{font-size:17px}@media(max-width:700px){.brand>span:last-child{font-size:14px}.topbar .breadcrumb strong{max-width:104px;font-size:9px;line-height:1.6}}
.brandmark{background:#0b1e30;border-color:#28658b;overflow:hidden}.brandmark img{width:100%;height:100%;object-fit:cover}.guild-icon{padding:0;background:transparent}.artifact{background:radial-gradient(ellipse,#15a8f333,transparent 70%)}.energy-vial{position:relative;width:174px;height:174px;object-fit:contain;border-radius:24%;filter:drop-shadow(0 0 20px #2ccfff55)}.artifact-label{color:#8bd6f2}.spark{background:#a2efff;box-shadow:0 0 9px #35cfff}.share-button{box-shadow:inset 0 1px 0 #8adeff15}.champion-medal{box-shadow:0 0 0 7px #4bcfff22,0 0 25px #35bdff22}.action-banner{background:linear-gradient(100deg,#142a3b,#192b36);border-color:#3c647a}.action-banner strong{color:#a0d9f0}.action-banner p{color:#9db9c9}.action-icon{background:#163c5655;border-color:#35617d}.action-banner button{background:#183a52;border-color:#337ba2;color:#b3e9ff}@media(max-width:700px){.energy-vial{width:140px;height:140px}}@media(prefers-reduced-motion:no-preference){.energy-vial{animation:energy-float 6s ease-in-out infinite}@keyframes energy-float{50%{transform:translateY(-6px);filter:drop-shadow(0 0 27px #29cfff77)}}}
+5 -5
View File
@@ -15,12 +15,12 @@ export const metadata: Metadata = {
title,
icons: {
icon: [
{url:'/favicon.ico?v=energy-1',sizes:'16x16 32x32 48x48',type:'image/x-icon'},
{url:'/favicon-32.png?v=energy-1',sizes:'32x32',type:'image/png'},
{url:'/favicon.svg?v=energy-1',sizes:'any',type:'image/svg+xml'},
{url:'/favicon.ico?v=energy-blue-1',sizes:'16x16 32x32 48x48',type:'image/x-icon'},
{url:'/favicon-32.png?v=energy-blue-1',sizes:'32x32',type:'image/png'},
{url:'/favicon.svg?v=energy-blue-1',sizes:'any',type:'image/svg+xml'},
],
shortcut:'/favicon.ico?v=energy-1',
apple:{url:'/apple-touch-icon.png?v=energy-1',sizes:'180x180',type:'image/png'},
shortcut:'/favicon.ico?v=energy-blue-1',
apple:{url:'/apple-touch-icon.png?v=energy-blue-1',sizes:'180x180',type:'image/png'},
},
description,
alternates: { canonical: origin },
+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),
Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 956 B

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

+1 -1
View File
@@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64"><title>نشان خزانه سایفوند انرژی</title><rect width="64" height="64" rx="14" fill="#141618"/><path d="M14 13h36v24c0 10-8 16-18 21-10-5-18-11-18-21V13Z" fill="#30291d" stroke="#d1ab6c" stroke-width="3" stroke-linejoin="round"/><g transform="translate(13.707 36.118) scale(0.47552)"><path d="M46.969 0L46.969 0Q45.406 0 44.172-0.469Q42.938-0.938 41.938-1.563L41.938-1.563Q41.219 6.469 36.234 11.266Q31.250 16.063 22.156 16.063L22.156 16.063Q15.406 16.063 11.109 13.516Q6.813 10.969 4.766 6.594Q2.719 2.219 2.719-3.219L2.719-3.219Q2.719-6.844 3.531-10.734Q4.344-14.625 5.781-18.469L5.781-18.469L12.875-15.719Q11.781-12.500 11.031-9.375Q10.281-6.250 10.281-3.469L10.281-3.469Q10.281-0.406 11.359 2.156Q12.438 4.719 15.031 6.250Q17.625 7.781 22.156 7.781L22.156 7.781Q26.781 7.781 29.438 6.297Q32.094 4.813 33.203 2.266Q34.313-0.281 34.313-3.406L34.313-3.406Q34.313-6.844 33.250-10.422Q32.188-14 30.938-17.094L30.938-17.094L38.688-20.031L40.781-13.688Q41.500-11.406 42.969-9.906Q44.438-8.406 47.031-8.406L47.031-8.406Q49.781-8.406 50.703-9.719Q51.625-11.031 51.625-13.875L51.625-13.875Q51.625-14.594 51.500-16.453Q51.375-18.313 51.219-20.094L51.219-20.094L58.563-21L59.219-12.906Q59.375-10.875 60.250-9.641Q61.125-8.406 63.281-8.406L63.281-8.406Q65.281-8.406 66.031-9.969Q66.781-11.531 66.781-13.688L66.781-13.688Q66.781-15.438 66.484-17.266Q66.188-19.094 65.813-20.625Q65.438-22.156 65.250-22.906L65.250-22.906L72.781-24.969Q73.406-22.563 73.813-19.859Q74.219-17.156 74.219-14.469L74.219-14.469Q74.219-10.688 73.219-7.391Q72.219-4.094 69.828-2.047Q67.438 0 63.313 0L63.313 0Q60.469 0 58.563-1.172Q56.656-2.344 55.375-4.156L55.375-4.156Q53.750-2.313 51.703-1.156Q49.656 0 46.969 0Z" fill="#f1cd8d"/></g></svg>
<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>

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 KiB

After

Width:  |  Height:  |  Size: 130 KiB

+8 -8
View File
@@ -1,14 +1,14 @@
<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="630" viewBox="0 0 1200 630">
<defs>
<radialGradient id="glow"><stop stop-color="#b17b32" stop-opacity=".24"/><stop offset="1" stop-color="#101214" stop-opacity="0"/></radialGradient>
<radialGradient id="glow"><stop stop-color="#b17b32" stop-opacity=".24"/><stop offset="1" stop-color="#080f18" stop-opacity="0"/></radialGradient>
<linearGradient id="glass" x2="1" y2="1"><stop stop-color="#b18c56" stop-opacity=".65"/><stop offset=".5" stop-color="#44331e"/><stop offset="1" stop-color="#211b15"/></linearGradient>
<linearGradient id="energy" x2="0" y2="1"><stop stop-color="#efc478"/><stop offset="1" stop-color="#9e5522"/></linearGradient>
<linearGradient id="energy" x2="0" y2="1"><stop stop-color="#63e0ff"/><stop offset="1" stop-color="#097ec8"/></linearGradient>
<linearGradient id="cap"><stop stop-color="#54402c"/><stop offset=".5" stop-color="#d1b17f"/><stop offset="1" stop-color="#5b432b"/></linearGradient>
<filter id="shine"><feGaussianBlur stdDeviation="10"/></filter>
</defs>
<rect width="1200" height="630" fill="#101214"/><rect x="22" y="22" width="1156" height="586" rx="22" fill="none" stroke="#393227"/>
<rect width="1200" height="630" fill="#080f18"/><rect x="22" y="22" width="1156" height="586" rx="22" fill="none" stroke="#393227"/>
<circle cx="289" cy="310" r="282" fill="url(#glow)"/>
<path d="M66 63h29l-2 28-12 9-12-9z" fill="#29241c" stroke="#d1ab6c" stroke-width="2"/><path d="M81 71v17" stroke="#d1ab6c" stroke-width="2"/>
<path d="M66 63h29l-2 28-12 9-12-9z" fill="#29241c" stroke="#56d3ff" stroke-width="2"/><path d="M81 71v17" stroke="#56d3ff" stroke-width="2"/>
<text x="110" y="90" fill="#e9e8e5" font-family="Arial,sans-serif" font-size="25" font-weight="700" letter-spacing="4">SIPHONED</text>
<text x="1118" y="88" text-anchor="end" fill="#8f9399" font-family="Arial,sans-serif" font-size="12" letter-spacing="3">ALBION ONLINE / GUILD TREASURY</text>
<ellipse cx="282" cy="328" rx="184" ry="91" transform="rotate(-27 282 328)" fill="none" stroke="#866a423f"/>
@@ -17,19 +17,19 @@
<rect x="245" y="179" width="74" height="28" rx="6" fill="url(#cap)" stroke="#c29b64" stroke-width="3"/>
<path d="M253 207h58v48h-58z" fill="url(#glass)" stroke="#b6925a" stroke-width="3"/>
<path d="M245 245h74q56 0 56 52v111q0 61-63 61h-60q-63 0-63-61V297q0-52 56-52z" fill="url(#glass)" stroke="#d2ad70" stroke-width="4"/>
<path d="M225 297h114q19 0 19 23v87q0 43-46 43h-60q-46 0-46-43v-87q0-23 19-23z" fill="#db9f48" opacity=".7" filter="url(#shine)"/>
<path d="M225 297h114q19 0 19 23v87q0 43-46 43h-60q-46 0-46-43v-87q0-23 19-23z" fill="#33cfff" opacity=".7" filter="url(#shine)"/>
<path d="M225 297h114q19 0 19 23v87q0 43-46 43h-60q-46 0-46-43v-87q0-23 19-23z" fill="url(#energy)"/>
<path d="M282 334c3 19 24 19 24 42 0 19-12 32-27 32s-27-13-27-27c0-10 5-16 10-20 1 12 6 16 12 13 10-4 5-18 8-40z" fill="none" stroke="#ffe5ae" stroke-width="5" stroke-linejoin="round"/>
<path d="M212 281v108" stroke="#e2c99f" stroke-opacity=".22" stroke-width="8" stroke-linecap="round"/>
</g>
<g fill="#d1ab6c"><rect x="127" y="247" width="5" height="5"/><rect x="413" y="385" width="6" height="6"/><rect x="175" y="448" width="4" height="4"/></g>
<g fill="#56d3ff"><rect x="127" y="247" width="5" height="5"/><rect x="413" y="385" width="6" height="6"/><rect x="175" y="448" width="4" height="4"/></g>
<text x="282" y="515" text-anchor="middle" fill="#ad8a55" font-family="Arial,sans-serif" font-size="12" letter-spacing="5">SIPHONED ENERGY</text>
<text x="506" y="208" fill="#c1a16d" font-family="Arial,sans-serif" font-size="13" letter-spacing="4">EVERY CONTRIBUTION COUNTS</text>
<text x="502" y="286" fill="#e9e8e5" font-family="Arial,sans-serif" font-weight="700" font-size="67" letter-spacing="-2">THE GUILD VAULT.</text>
<text x="505" y="341" fill="#d1ab6c" font-family="Arial,sans-serif" font-size="34" font-weight="600">Stronger together.</text>
<text x="505" y="341" fill="#56d3ff" font-family="Arial,sans-serif" font-size="34" font-weight="600">Stronger together.</text>
<text x="506" y="391" fill="#93979d" font-family="Arial,sans-serif" font-size="20">Know your balance. Own your contribution.</text>
<g font-family="Arial,sans-serif" font-size="12" letter-spacing="1.5">
<rect x="506" y="439" width="155" height="45" rx="8" fill="#24211c" stroke="#53442c"/><text x="583" y="467" text-anchor="middle" fill="#d1ab6c">LEADERBOARD</text>
<rect x="506" y="439" width="155" height="45" rx="8" fill="#24211c" stroke="#53442c"/><text x="583" y="467" text-anchor="middle" fill="#56d3ff">LEADERBOARD</text>
<rect x="674" y="439" width="130" height="45" rx="8" fill="#1c2521" stroke="#344b3c"/><text x="739" y="467" text-anchor="middle" fill="#91bba8">BALANCES</text>
<rect x="817" y="439" width="179" height="45" rx="8" fill="#1d1f22" stroke="#3c4148"/><text x="906" y="467" text-anchor="middle" fill="#b4b7bc">TRANSACTIONS</text>
</g>

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

+1
View File
@@ -0,0 +1 @@
<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>

After

Width:  |  Height:  |  Size: 2.1 KiB

+3 -8
View File
@@ -1,15 +1,10 @@
import fs from 'node:fs/promises';
import opentype from '@shuding/opentype.js';
import sharp from 'sharp';
const fontBytes=await fs.readFile(new URL('../lib/fonts/Vazirmatn-Bold.ttf',import.meta.url));
const font=opentype.parse(fontBytes.buffer.slice(fontBytes.byteOffset,fontBytes.byteOffset+fontBytes.byteLength));
const glyph=font.getPath('س',0,0,64);
const xs=glyph.commands.flatMap(c=>[c.x,c.x1,c.x2].filter(Number.isFinite));const ys=glyph.commands.flatMap(c=>[c.y,c.y1,c.y2].filter(Number.isFinite));
const box={x1:Math.min(...xs),x2:Math.max(...xs),y1:Math.min(...ys),y2:Math.max(...ys)};const scale=Math.min(34/(box.x2-box.x1),27/(box.y2-box.y1));
const dx=32-(box.x1+box.x2)/2*scale,dy=34-(box.y1+box.y2)/2*scale;
const svg=`<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64"><title>نشان خزانه سایفوند انرژی</title><rect width="64" height="64" rx="14" fill="#141618"/><path d="M14 13h36v24c0 10-8 16-18 21-10-5-18-11-18-21V13Z" fill="#30291d" stroke="#d1ab6c" stroke-width="3" stroke-linejoin="round"/><g transform="translate(${dx.toFixed(3)} ${dy.toFixed(3)}) scale(${scale.toFixed(5)})"><path d="${glyph.toPathData(3)}" fill="#f1cd8d"/></g></svg>`;
import {energyArt} from '../lib/energy-art.mjs';
const svg=energyArt;
const publicDir=new URL('../public/',import.meta.url);
await fs.writeFile(new URL('favicon.svg',publicDir),svg);
await fs.writeFile(new URL('siphoned-energy.svg',publicDir),svg);
await sharp(Buffer.from(svg)).resize(32,32).png().toFile(new URL('favicon-32.png',publicDir).pathname);
await sharp(Buffer.from(svg)).resize(180,180).png().toFile(new URL('apple-touch-icon.png',publicDir).pathname);
const sizes=[16,32,48];const pngs=await Promise.all(sizes.map(size=>sharp(Buffer.from(svg)).resize(size,size).png().toBuffer()));