المكوّنات · بطاقة فريق بطاقة استيعاب
بطاقة فريق بطاقة استيعاب
المتبقّي من الأعضاء ونسبة الاستيعاب محسوبان
12 تصاميم من هذه العائلة
<div class="cd cdt"><article class="card">
<div class="hd"><h5 data-ar="فريق حملة الربع الثالث" data-en="Q3 campaign team">فريق حملة الربع الثالث</h5>
<span class="st"></span></div>
<div class="stack"></div>
<div class="cap"><div class="cl"><span data-ar="الطاقة المحجوزة" data-en="Booked capacity">الطاقة المحجوزة</span>
<b class="cp num"></b></div><div class="bar"><i></i></div>
<span class="hrs num"></span></div>
</article></div>
/* pt-scoped */
/* card-team — وكالة تسويق */
.cdt{width:100%;height:100%;display:flex;align-items:center;justify-content:center;
padding:8px;font-size:10px;color:var(--pt-text-secondary);overflow:hidden}
.cdt .card{display:flex;overflow:hidden;background:var(--pt-surface);
border:1px solid var(--pt-border-subtle)}
.cdt h5{margin:0;font-size:11px;color:var(--pt-text-primary);font-weight:600;line-height:1.4}
.cdt p{margin:0;font-size:8.5px;color:var(--pt-text-muted);line-height:1.7}
.cdt .num{font-variant-numeric:tabular-nums;letter-spacing:-.01em}
.cdt .img{flex:none;position:relative;overflow:hidden}
.cdt button{font:inherit;cursor:pointer}
.cdt button:focus-visible{outline:2px solid var(--pt-focus-ring);outline-offset:1px}
.cdt .bar{height:3px;border-radius:99px;background:var(--pt-border-subtle);overflow:hidden}
.cdt .bar i{display:block;height:100%;background:var(--pt-accent);border-radius:inherit;
transition:width var(--pt-motion-duration-slow) var(--pt-motion-easing-standard)}
@media(prefers-reduced-motion:reduce){.cdt .bar i{transition:none}
}
/* شكل: زجاجية بحدّ خفيف، انحناء كبير، مكدّس صور متداخل */
.cdt .card{flex-direction:column;width:212px;gap:8px;padding:10px;
border-radius:var(--pt-radius-xl);
background:color-mix(in srgb,var(--pt-surface) 72%,transparent);
backdrop-filter:blur(8px);border-color:var(--pt-border-default)}
.cdt .hd{display:flex;align-items:center;justify-content:space-between;gap:8px}
.cdt .st{padding:2px 7px;border-radius:var(--pt-radius-full);font-size:7.5px;font-weight:700}
.cdt .st.ok{background:var(--pt-accent-muted);color:var(--pt-accent)}
.cdt .st.hot{background:color-mix(in srgb,var(--pt-color-warn-400) 22%,transparent);
color:var(--pt-color-warn-400)}
.cdt .stack{display:flex}
.cdt .stack span{width:26px;height:26px;border-radius:50%;display:grid;place-items:center;
font-size:9.5px;font-weight:700;color:var(--pt-color-ink-900);
border:2px solid var(--pt-surface);margin-inline-start:-7px;
transition:transform var(--pt-motion-duration-fast) var(--pt-motion-easing-standard)}
.cdt .stack span:first-child{margin-inline-start:0}
.cdt .stack span:hover{transform:translateY(-2px)}
.cdt .stack .more{background:var(--pt-bg-inset);color:var(--pt-text-muted);
font-size:8px;border-color:var(--pt-surface)}
.cdt .cap{display:flex;flex-direction:column;gap:4px}
.cdt .cl{display:flex;align-items:baseline;justify-content:space-between;gap:8px;font-size:8px}
.cdt .cp{font-size:11px;color:var(--pt-text-primary);font-weight:700}
.cdt .hrs{font-size:7.5px;color:var(--pt-text-muted)}
@media(prefers-reduced-motion:reduce){.cdt .stack span{transition:none}
}
/* يعمل داخل إطار معزول — لا يعتمد على شيء خارجه */
/* pt-remount — يعاد التركيب عند تبديل اللغة */
(function () {
var host = document.querySelector('.cdt');
if (!host) return;
var snapshot = host.innerHTML;
var timers = [];
var ac = null;
/* الجسم كما كتبه المولِّد. يستقبل بدائل مظلَّلة لـ root وdocument
والمؤقّتات، فينظّف نفسه دون أن يعرف أنه قابل لإعادة التركيب. */
function run(root, document, setTimeout, setInterval) {
var ar = document.documentElement.lang !== 'en';
var PEG = 3.75; /* الريال مربوط بالدولار */
var n = function (v, d) { return Number(v).toLocaleString('en-US', {
minimumFractionDigits: d || 0, maximumFractionDigits: d || 0 }); };
/* العملة: ر.س بعد الرقم عربيًّا، $ قبله إنجليزيًّا */
var money = function (usd, d) {
return ar ? n(usd * PEG, d) + ' ر.س' : '$' + n(usd, d);
};
var set = function (sel, txt) {
var el = root.querySelector(sel); if (el) el.textContent = txt; return el;
};
var MEMBERS = ['ر', 'ف', 'ن', 'س', 'ه', 'ل', 'ي'];
var SHOW = 4, BOOKED = 246, CAPACITY = 320; /* ساعات */
var stack = root.querySelector('.stack');
var hues = [188, 262, 32, 146, 208];
// الفائض محسوب من البقيّة — «+3» مكتوبة تصير كذبًا مع أوّل تغيير في الفريق
stack.innerHTML = MEMBERS.slice(0, SHOW).map(function (m, i) {
return '<span style="background:hsl(' + hues[i % hues.length] + ' 62% 68%)">' + m + '</span>';
}).join('') + (MEMBERS.length > SHOW
? '<span class="more">+' + (MEMBERS.length - SHOW) + '</span>' : '');
var pct = Math.round(BOOKED / CAPACITY * 100);
set('.cp', pct + '%');
set('.hrs', n(BOOKED) + ' / ' + n(CAPACITY) + (ar ? ' ساعة' : ' hours'));
var st = root.querySelector('.st');
st.className = 'st ' + (pct >= 85 ? 'hot' : 'ok');
st.textContent = pct >= 85 ? (ar ? 'شبه ممتلئ' : 'Near full')
: (ar ? 'متاح' : 'Available');
var bar = root.querySelector('.bar i');
if (pct >= 85) bar.style.background = 'var(--pt-color-warn-400)';
requestAnimationFrame(function () { bar.style.width = pct + '%'; });
}
function mount() {
ac = new AbortController();
var real = window.document;
/* وسيط يمرّر كل شيء إلى المستند الحقيقي، ويعلّق كل مستمع بإشارة
تُقطع عند إعادة التركيب — فلا يبقى مستمع من نسخة ماتت. */
var doc = new Proxy(real, {
get: function (t, k) {
if (k === 'addEventListener') {
return function (type, fn, opts) {
var o = (opts && typeof opts === 'object') ? Object.assign({}, opts)
: { capture: !!opts };
o.signal = ac.signal;
return t.addEventListener(type, fn, o);
};
}
var v = t[k];
return typeof v === 'function' ? v.bind(t) : v;
}
});
function track(fn) {
return function (f, ms) { var id = fn(f, ms); timers.push(id); return id; };
}
run(host, doc, track(window.setTimeout.bind(window)),
track(window.setInterval.bind(window)));
}
function unmount() {
if (ac) ac.abort();
// المعرّفان يتشاركان فضاءً واحدًا في المتصفّح، فالإلغاء المزدوج آمن
timers.forEach(function (id) { window.clearTimeout(id); window.clearInterval(id); });
timers = [];
host.innerHTML = snapshot;
}
mount();
addEventListener('pt-lang', function () { unmount(); mount(); });
})();
# Team Card with Capacity
**Role:** You are an Arabic-first UI designer and front-end engineer. Read the whole
specification before writing a single line, then follow it literally. If two requirements
conflict, favour usability over visual effect.
**Goal:** Team Card with Capacity — Overflow count and capacity load both computed
**Why this component matters:** Cap the avatar stack and compute the “+N” from the remainder; a hard-coded +3 becomes a lie the first time someone joins or leaves the team.
**Direction:** Genuine RTL — not a mirrored Latin layout. Use logical properties
(`margin-inline-start`, `padding-inline`, `inset-inline-start`, `text-align: start`),
never physical ones (`margin-left`, `left`). The layout must flip with `dir` on its own,
with no duplicated rules.
**Typography:** Cairo for Arabic, IBM Plex Sans for Latin. Arabic line-height must be
`0.18` higher than the Latin equivalent — dots, hamzas and maddas need more vertical room.
Arabic font-size runs `1.06×` the Latin size at the same optical weight.
**Numerals:** Western digits in both languages (`1,234.50`). Only the currency changes:
`ر.س` **after** the number in Arabic, `$` **before** it in English. Jordanian dinar
uses **three** decimal places, not two.
**Colors:** Dark mode — background `#0D142B` · surfaces `#211F54` · borders `#545C91` · text `#918FC2`.
Accent `#ADA9E8` must never exceed 8% of the screen area.
**Language:** Bilingual — every string carries both Arabic and English, and the layout
flips with `dir` automatically.
**States:** `default` · `hover` · `focus` · `active` · `disabled` · `loading` · `error`.
Do not design the resting state alone.
**Accessibility:** Contrast ratio at least `4.5:1`, complete keyboard navigation,
visible focus rings, and honour `prefers-reduced-motion`.
**Output:** Clean HTML and CSS in two separate files. No frameworks, no libraries,
no external dependencies.