المكوّنات · تتبّع طلب بخطّ زمني
تتبّع طلب بخطّ زمني
خطّ رأسي بأوقات فعلية، والقادم مقدَّر لا مؤكَّد
12 تصاميم من هذه العائلة
<div class="cm cmt">
<div class="hd"><span class="no num"></span><span class="st"></span></div>
<ol class="steps"></ol>
</div>
/* pt-scoped */
/* commerce-tracking — متجر هدايا */
.cmt{width:100%;height:100%;display:flex;flex-direction:column;
font-size:10px;color:var(--pt-text-secondary);overflow:hidden}
.cmt h4{margin:0;font-size:10.5px;color:var(--pt-text-primary);font-weight:600}
.cmt p{margin:0;font-size:8.5px;color:var(--pt-text-muted);line-height:1.75}
.cmt .num{font-variant-numeric:tabular-nums;letter-spacing:-.01em}
.cmt button{font:inherit;cursor:pointer}
.cmt button:disabled{cursor:not-allowed;opacity:.45}
.cmt button:focus-visible, .cmt input:focus-visible, .cmt select:focus-visible{
outline:2px solid var(--pt-focus-ring);outline-offset:1px}
.cmt .bar{height:3px;border-radius:99px;background:var(--pt-border-subtle);overflow:hidden}
.cmt .bar i{display:block;height:100%;background:var(--pt-accent);border-radius:inherit;
transition:width var(--pt-motion-duration-normal) var(--pt-motion-easing-standard)}
@media(prefers-reduced-motion:reduce){.cmt .bar i{transition:none}
}
@media(pointer:coarse){.cmt button{min-height:44px}
}
/* شخصية: خطّ زمني رأسي، نقاط موصولة، انحناء كبير */
.cmt{gap:8px;padding:11px 13px;justify-content:center}
.cmt .hd{display:flex;align-items:center;justify-content:space-between;gap:8px}
.cmt .no{font-size:8.5px;color:var(--pt-text-muted);font-family:var(--pt-font-mono)}
.cmt .st{padding:2px 8px;border-radius:var(--pt-radius-full);font-size:7.5px;font-weight:700;
background:var(--pt-accent-muted);color:var(--pt-accent)}
.cmt .steps{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
.cmt .steps li{display:grid;grid-template-columns:16px 1fr;gap:8px;position:relative;
padding-bottom:9px}
.cmt .steps li:last-child{padding-bottom:0}
.cmt .steps li::before{content:'';position:absolute;inset-inline-start:7px;
inset-block-start:12px;bottom:0;width:1px;background:var(--pt-border-default)}
.cmt .steps li:last-child::before{display:none}
.cmt .dot{width:9px;height:9px;margin-top:3px;border-radius:50%;position:relative;z-index:1;
background:var(--pt-bg-base);border:1.5px solid var(--pt-border-strong)}
.cmt li.done .dot{background:var(--pt-accent);border-color:var(--pt-accent)}
.cmt li.now .dot{border-color:var(--pt-accent);
box-shadow:0 0 0 3px color-mix(in srgb,var(--pt-accent) 25%,transparent)}
.cmt .tx{display:flex;flex-direction:column;gap:1px}
.cmt .t{font-size:9px;color:var(--pt-text-primary)}
.cmt li:not(.done):not(.now) .t{color:var(--pt-text-muted)}
.cmt .w{font-size:7.5px;color:var(--pt-text-muted);font-variant-numeric:tabular-nums}
.cmt .est{font-style:italic}
/* يعمل داخل إطار معزول — لا يعتمد على شيء خارجه */
/* pt-remount — يعاد التركيب عند تبديل اللغة */
(function () {
var host = document.querySelector('.cmt');
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 n = function (v, d) { return Number(v).toLocaleString('en-US', {
minimumFractionDigits: d === undefined ? 2 : d,
maximumFractionDigits: d === undefined ? 2 : d }); };
/* العملة: $ ($) — سوق عالمي.
الأرقام مخزَّنة بـالريال وتُحوَّل، فتبقى
المبالغ معقولة في كل سوق. والتحويل لا التبديل: «18,500» راتبًا بالريال
معقول، وبالدينار الأردني ثروة.
وخانتان عشريتان — الوحدة تُقسَّم إلى مئة. */
var money = (function () {
var RATE = 1, DEC = 2;
return function (v, d) {
var out = (Number(v) / 3.75) * RATE;
var places = d === undefined ? DEC : d;
var s = out.toLocaleString('en-US', {
minimumFractionDigits: places, maximumFractionDigits: places });
return ar ? '$' + s : '$' + s;
};
})();
var set = function (sel, t) { var e = root.querySelector(sel); if (e) e.textContent = t; return e; };
var AT = 2;
var STEPS = [
{ ar: 'تأكيد الطلب', en: 'Order confirmed', h: -30 },
{ ar: 'جُهّز للشحن', en: 'Packed', h: -22 },
{ ar: 'في مركز الفرز', en: 'At sorting hub', h: -4 },
{ ar: 'خرج للتوصيل', en: 'Out for delivery', h: 14 },
{ ar: 'سُلّم', en: 'Delivered', h: 20 }
];
function at(h) {
var d = new Date(); d.setHours(d.getHours() + h);
return d.toLocaleString(ar ? 'ar-SA-u-nu-latn' : 'en-GB',
{ day: 'numeric', month: 'short', hour: '2-digit', minute: '2-digit' });
}
/* ما مضى وقتٌ مسجَّل، وما بقي تقدير — ويُقال إنّه تقدير.
عرضُ توقّعٍ بصوت الحقيقة يحوّل تأخّرًا صغيرًا إلى شكوى. */
root.querySelector('.steps').innerHTML = STEPS.map(function (s, i) {
var cls = i < AT ? 'done' : i === AT ? 'done now' : '';
var future = i > AT;
return '<li class="' + cls + '"><span class="dot" aria-hidden="true"></span>' +
'<span class="tx"><span class="t">' + (ar ? s.ar : s.en) + '</span>' +
'<span class="w' + (future ? ' est' : '') + '">' +
(future ? (ar ? 'متوقَّع · ' : 'Estimated · ') : '') + at(s.h) + '</span></span></li>';
}).join('');
set('.no', '#GF-' + new Date().toISOString().slice(2, 10).replace(/-/g, '') + '-0412');
set('.st', ar ? 'في الطريق' : 'In transit');
}
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(); });
})();
# Order Tracking Timeline
**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:** Order Tracking Timeline — A vertical trail with real timestamps; what is ahead is estimated, not asserted
**Why this component matters:** Mark future steps as estimates, not facts. Presenting a predicted delivery time in the same voice as a completed scan is what turns a small delay into a complaint.
**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.