المكوّنات · قسم هيرو رئيسي
قسم هيرو رئيسي
عنوان ووعد وزرّان ودليل ثقة — بترتيب بصري واحد
12 تصاميم من هذه العائلة
<div class="bk bkh"><section>
<span class="eyebrow" data-ar="عربي أوّلًا" data-en="ARABIC FIRST">عربي أوّلًا</span>
<h2 data-ar="ابنِ واجهتك العربية في ساعة، لا في أسبوع" data-en="Ship your Arabic interface in an hour, not a week">ابنِ واجهتك العربية في ساعة، لا في أسبوع</h2>
<p data-ar="مكوّنات جاهزة تحترم الاتّجاه والخطّ والأرقام — انسخها كشيفرة أو خذها برومبتًا لأداتك." data-en="Components that respect direction, type and numerals — copy the code or take the prompt.">مكوّنات جاهزة تحترم الاتّجاه والخطّ والأرقام — انسخها كشيفرة أو خذها برومبتًا لأداتك.</p>
<div class="acts">
<a class="p" href="#" data-ar="تصفّح المكتبة" data-en="Browse the library">تصفّح المكتبة</a>
<a class="s" href="#" data-ar="شاهد مثالًا" data-en="See an example">شاهد مثالًا</a>
</div>
<div class="trust"><span class="dots" aria-hidden="true"></span>
<span class="tx"></span></div>
</section></div>
/* pt-scoped */
/* block-hero — منصّة تقنية */
.bkh{width:100%;height:100%;display:flex;flex-direction:column;
font-size:10px;color:var(--pt-text-secondary);overflow:hidden}
.bkh h2{margin:0;font-size:19px;line-height:1.35;color:var(--pt-text-primary);
font-weight:700;letter-spacing:-.01em}
.bkh h3{margin:0;font-size:12px;line-height:1.4;color:var(--pt-text-primary);font-weight:600}
.bkh h4{margin:0;font-size:10px;color:var(--pt-text-primary);font-weight:600}
.bkh p{margin:0;font-size:9.5px;line-height:1.85;color:var(--pt-text-muted)}
.bkh .eyebrow{font-size:8px;letter-spacing:.14em;color:var(--pt-accent);font-weight:700}
.bkh .num{font-variant-numeric:tabular-nums;letter-spacing:-.01em}
.bkh button, .bkh a{font:inherit;cursor:pointer;text-decoration:none}
.bkh button:focus-visible, .bkh a:focus-visible, .bkh input:focus-visible, .bkh summary:focus-visible{outline:2px solid var(--pt-focus-ring);outline-offset:2px}
/* الأقسام تمتدّ من حافّة إلى حافّة — هذا ما يميّزها عن المكوّنات */
.bkh > section{flex:1;display:flex;flex-direction:column;justify-content:center;min-height:0}
@media(pointer:coarse){.bkh button, .bkh a{min-height:44px;display:inline-flex;
align-items:center;justify-content:center}
}
/* شخصية: متمركز، وهج خلفي، انحناء كبير للأزرار */
.bkh > section{align-items:center;text-align:center;gap:8px;padding:16px 34px;
position:relative;background:var(--pt-bg-base)}
.bkh > section::before{content:'';position:absolute;inset-block-start:-40%;
inset-inline-start:50%;transform:translateX(-50%);width:60%;height:110%;
background:radial-gradient(ellipse at center,
color-mix(in srgb,var(--pt-accent) 20%,transparent),transparent 68%);
pointer-events:none}
.bkh > section > *{position:relative}
.bkh h2{max-width:400px}
.bkh p{max-width:360px}
.bkh .acts{display:flex;gap:7px;margin-top:2px}
.bkh .p{padding:8px 18px;border-radius:var(--pt-radius-full);background:var(--pt-accent);
color:var(--pt-color-ink-900);font-size:10px;font-weight:700;
transition:transform var(--pt-motion-duration-fast) var(--pt-motion-easing-standard)}
.bkh .p:hover{transform:translateY(-1px)}
.bkh .s{padding:8px 16px;border-radius:var(--pt-radius-full);
border:1px solid var(--pt-border-default);color:var(--pt-text-secondary);font-size:10px}
.bkh .s:hover{border-color:var(--pt-accent);color:var(--pt-accent)}
.bkh .trust{display:flex;align-items:center;gap:6px;font-size:8px;color:var(--pt-text-muted)}
.bkh .dots{display:flex}
.bkh .dots i{width:13px;height:13px;border-radius:50%;border:1.5px solid var(--pt-bg-base);
margin-inline-start:-4px;display:block}
.bkh .dots i:first-child{margin-inline-start:0}
@media(prefers-reduced-motion:reduce){.bkh .p{transition:none}
}
/* يعمل داخل إطار معزول — لا يعتمد على شيء خارجه */
/* pt-remount — يعاد التركيب عند تبديل اللغة */
(function () {
var host = document.querySelector('.bkh');
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 || 0, maximumFractionDigits: d || 0 }); };
/* عدد المكوّنات يُقرأ من مكان واحد — رقم مكتوب في النصّ يتقادم بصمت */
var COUNT = 148, USERS = 1240;
var hues = [188, 262, 32, 146];
root.querySelector('.dots').innerHTML = hues.map(function (h) {
return '<i style="background:hsl(' + h + ' 58% 62%)"></i>';
}).join('');
root.querySelector('.tx').textContent = ar
? n(COUNT) + ' مكوّنًا · يستعملها ' + n(USERS) + ' مصمّمًا'
: n(COUNT) + ' components · used by ' + n(USERS) + ' designers';
}
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(); });
})();
# Hero Section
**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:** Hero Section — Headline, promise, two actions and one trust signal in a single visual order
**Why this component matters:** A hero needs exactly one primary action. A second equally weighted button splits attention and measurably lowers click-through on both.
**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.