diff --git a/docs/tasks/24-4.md b/docs/tasks/24-4.md index 0c6a35c..e7834c2 100644 --- a/docs/tasks/24-4.md +++ b/docs/tasks/24-4.md @@ -1,7 +1,7 @@ --- id: 24-4 title: 24-4 Home Page Sections (Hero to Latest Articles) -status: Ready for Dev +status: QA Review date: 2026-10-31 parent: 24 --- diff --git a/docs/tasks/manual-tests/24-4.md b/docs/tasks/manual-tests/24-4.md new file mode 100644 index 0000000..267d338 --- /dev/null +++ b/docs/tasks/manual-tests/24-4.md @@ -0,0 +1,17 @@ +# Manual tests — 24-4 Home Page Sections + +Automated (passed 2026-10-31, `tests/Feature/Design/HomeRedesignTest.php`, 8 tests): sections `top`, pillars band, `founder`, +`services`, `mission`, `values`, `posts` in order in ar and en; copy from site/home keys; one h1 and non-empty alt on every +image; the four JPEGs exist (magic bytes); hero balance + static balance render; four service rows linking `#book` with chips; +text-only post cards with 3 posts and the empty message with none; no "Unsplash"; all new site.* keys in both languages; +`lang/*/home.php` unchanged versus BASE. +UI loop (libra.test `/`, 390/768/1440): no horizontal scroll at any width, h1 count 1, no missing alt. At 390 it reports 1 +element past the edge (probably the hero `.tag` card, which is positioned off the frame on purpose) — please eyeball. +Fonts in use include Cairo (existing Tailwind classes elsewhere in the shell), Markazi and IBM Plex. + +- [ ] `/` in Arabic and in English (`/language/en`): the seven sections read correctly and look like the approved mockup. +- [ ] Hero: balance settles level; moving the mouse across the frame tips it. +- [ ] Hover a service row: fills forest, cream text. Hover a value card: lifts, medallion rotates. Hover a post card: lifts. +- [ ] Each of the 3 latest posts opens `/posts/{post}`; with no published posts the "coming soon" text shows. +- [ ] 390px: no sideways scroll; sections stack; the tag card does not cut off the screen. +- [ ] The "Book a consultation" buttons scroll to `#book`, which only exists after 24-5. diff --git a/docs/tasks/statuses.md b/docs/tasks/statuses.md index c9e31dd..fb48172 100644 --- a/docs/tasks/statuses.md +++ b/docs/tasks/statuses.md @@ -140,7 +140,7 @@ | 24-1 | 24-1 Public Design Foundation (Stylesheet, Script, Fonts, Layout) | QA Review | | 24-2 | 24-2 Navigation and Footer | QA Review | | 24-3 | 24-3 Signature Balance Component | QA Review | -| 24-4 | 24-4 Home Page Sections (Hero to Latest Articles) | Ready for Dev | +| 24-4 | 24-4 Home Page Sections (Hero to Latest Articles) | QA Review | | 24-5 | 24-5 Home Booking Card (Compact Booking and Day Strip) | Ready for Dev | | 24-6 | 24-6 Booking Page and Booking Success | Ready for Dev | | 24-7 | 24-7 About Page | Ready for Dev | diff --git a/lang/ar/site.php b/lang/ar/site.php index 0c6fcc3..a825982 100644 --- a/lang/ar/site.php +++ b/lang/ar/site.php @@ -20,4 +20,48 @@ return [ 'footer_contact' => 'تواصل', 'footer_terms' => 'شروط الاستخدام', 'footer_privacy' => 'سياسة الخصوصية', + 'hero_eyebrow' => 'ليبرا للحقوق · فلسطين', + 'hero_title_a' => 'العدالة ', + 'hero_title_em' => 'ممارسةٌ يومية', + 'hero_title_b' => '، لا مبدأٌ نظري.', + 'trust_1_title' => 'أفراد وشركات', + 'trust_1_text' => 'استشارات وتمثيل', + 'trust_2_title' => 'المرأة والأسرة', + 'trust_2_text' => 'دعم قانوني متخصص', + 'trust_3_title' => 'عربي · English', + 'trust_3_text' => 'خدمة بلغتين', + 'alt_olive_tree' => 'شجرة زيتون معمّرة بين صخور كلسية', + 'balance_label' => 'ميزان العدالة', + 'frame_caption' => 'لكلّ حقٍّ وزنُه', + 'frame_tag' => 'استشارات حضورية أو عن بُعد', + 'pillars_label' => 'ركائزنا', + 'pillar_justice' => 'العدالة', + 'pillar_justice_text' => 'الإنصاف، والمساءلة، وسيادة القانون.', + 'pillar_dignity' => 'الكرامة', + 'pillar_dignity_text' => 'القيمة الأصيلة لكل إنسان.', + 'pillar_advocacy' => 'الدفاع', + 'pillar_advocacy_text' => 'انخراطٌ فاعل، وقولُ الحق في وجه السلطة.', + 'art_founder' => 'المادة ٠١ — المؤسِّسة', + 'founder_role' => 'المؤسِّسة · محامية', + 'founder_quote' => '«العدالة ممارسة يومية، وليست مجرد مبدأ نظري.»', + 'founder_cta' => 'اقرأ قصتنا', + 'art_services' => 'المادة ٠٢ — الخدمات', + 'services_lede' => 'ممارسة قانونية أصيلة، تقوم على البحث والمعرفة الميدانية.', + 'art_vision' => 'المادة ٠٣ — الرؤية', + 'vision_title' => 'منسوجةٌ من نسيج المجتمع', + 'vision_text' => 'ليبرا نسيجٌ أصيل من المجتمع، تتقصّى مشكلاته وتوثّقها وتكشف جذورها، وتقدّم حلولاً عملية لرأب أوجاعه مهما صغرت، عبر العمل التشاركي والبحث الميداني الحقيقي.', + 'alt_hoop' => 'تطريز بغرزة الصليب مشدود على طارة خشبية', + 'card_institution_label' => 'لمؤسستنا', + 'card_institution_title' => 'القانون والبحث والميدان', + 'card_institution_text' => 'نلتقط نبض المجتمع ونحوّل تحدياته إلى معرفة وحلول قانونية مبتكرة.', + 'alt_olives' => 'ثمار زيتون على غصن', + 'card_society_label' => 'للمجتمع', + 'card_society_title' => 'شريكٌ موثوق للقضاء', + 'card_society_text' => 'نعيد وصل المجتمع بتاريخه وإرثه القانوني.', + 'alt_hills' => 'تلال وطريق متعرّج عند الغروب', + 'card_diaspora_label' => 'لفلسطينيي الشتات', + 'card_diaspora_title' => 'عودةٌ إلى الأرض والعائلة', + 'card_diaspora_text' => 'نساعد الفلسطينيين في الخارج على البحث في عائلاتهم وتاريخهم وأراضيهم.', + 'art_values' => 'المادة ٠٤ — القيم', + 'art_articles' => 'المادة ٠٥ — المقالات', ]; diff --git a/lang/en/site.php b/lang/en/site.php index b9b2d33..b066360 100644 --- a/lang/en/site.php +++ b/lang/en/site.php @@ -20,4 +20,48 @@ return [ 'footer_contact' => 'Contact', 'footer_terms' => 'Terms of use', 'footer_privacy' => 'Privacy policy', + 'hero_eyebrow' => 'Libra for Rights · Palestine', + 'hero_title_a' => 'Justice is a ', + 'hero_title_em' => 'daily practice', + 'hero_title_b' => ', not a theory.', + 'trust_1_title' => 'Individuals & companies', + 'trust_1_text' => 'Consultations and representation', + 'trust_2_title' => 'Women & family', + 'trust_2_text' => 'Specialised legal support', + 'trust_3_title' => 'Arabic · English', + 'trust_3_text' => 'Bilingual service', + 'alt_olive_tree' => 'An ancient olive tree among limestone rocks', + 'balance_label' => 'The scales of justice', + 'frame_caption' => 'Every right carries its weight', + 'frame_tag' => 'Consultations in person or remotely', + 'pillars_label' => 'Our pillars', + 'pillar_justice' => 'Justice', + 'pillar_justice_text' => 'Fairness, accountability and the rule of law.', + 'pillar_dignity' => 'Dignity', + 'pillar_dignity_text' => 'The inherent worth of every person.', + 'pillar_advocacy' => 'Advocacy', + 'pillar_advocacy_text' => 'Active engagement, and speaking truth to power.', + 'art_founder' => 'Article 01 — The founder', + 'founder_role' => 'Founder · Attorney at Law', + 'founder_quote' => '“Justice is a daily practice, not merely a theoretical principle.”', + 'founder_cta' => 'Read our story', + 'art_services' => 'Article 02 — Services', + 'services_lede' => 'Traditional legal practice, combined with research-driven insight.', + 'art_vision' => 'Article 03 — Vision', + 'vision_title' => 'Woven from the fabric of society', + 'vision_text' => 'Libra investigates society\'s problems, documents them, uncovers their roots, and offers practical solutions to mend social pains — however small — through collaborative work and genuine field research.', + 'alt_hoop' => 'Cross-stitch embroidery stretched on a wooden hoop', + 'card_institution_label' => 'For our institution', + 'card_institution_title' => 'Law, research and fieldwork', + 'card_institution_text' => 'Capturing society\'s pulse and turning its challenges into knowledge and innovative legal solutions.', + 'alt_olives' => 'Olives ripening on a branch', + 'card_society_label' => 'For society', + 'card_society_title' => 'A trusted partner to the judiciary', + 'card_society_text' => 'Reconnecting society with its history and legal heritage.', + 'alt_hills' => 'Hills and a winding road at sunset', + 'card_diaspora_label' => 'For Palestinians in the diaspora', + 'card_diaspora_title' => 'Back to the land and the family', + 'card_diaspora_text' => 'Helping Palestinians abroad research their families, their history and their land.', + 'art_values' => 'Article 04 — Values', + 'art_articles' => 'Article 05 — Articles', ]; diff --git a/public/images/site/embroidery-hoop.jpg b/public/images/site/embroidery-hoop.jpg new file mode 100644 index 0000000..9b91279 Binary files /dev/null and b/public/images/site/embroidery-hoop.jpg differ diff --git a/public/images/site/hills.jpg b/public/images/site/hills.jpg new file mode 100644 index 0000000..d8328c5 Binary files /dev/null and b/public/images/site/hills.jpg differ diff --git a/public/images/site/olive-tree.jpg b/public/images/site/olive-tree.jpg new file mode 100644 index 0000000..5fdec59 Binary files /dev/null and b/public/images/site/olive-tree.jpg differ diff --git a/public/images/site/olives.jpg b/public/images/site/olives.jpg new file mode 100644 index 0000000..a7e7334 Binary files /dev/null and b/public/images/site/olives.jpg differ diff --git a/resources/css/public.css b/resources/css/public.css index c7199e0..f025bf2 100644 --- a/resources/css/public.css +++ b/resources/css/public.css @@ -124,6 +124,144 @@ body.site .foot span{display:block;padding:10px 0} body.site .site-balance{display:block;overflow:visible} +/* ---------- Home page (24-4) ---------- */ +body.site .hero{position:relative;padding:56px 0 96px;overflow:hidden} +body.site .hero .wrap{display:grid;grid-template-columns:1fr 1.08fr;gap:56px;align-items:center} +body.site .hero h1{font-size:clamp(2.6rem,4.6vw,4.1rem);line-height:1.12;margin:18px 0 22px;letter-spacing:0;word-spacing:.08em} +html[lang=en] body.site .hero h1{letter-spacing:-.02em} +body.site .hero h1 em{font-style:normal;color:var(--olive);text-decoration:underline dashed var(--gold) .07em;text-underline-offset:.28em;text-decoration-skip-ink:none} +body.site .lede{font-size:1.15rem;color:#3A4033;max-width:34em;margin:0 0 30px} +body.site .cta-row{display:flex;flex-wrap:wrap;gap:12px;align-items:center} +body.site .trust{display:flex;gap:26px;margin-top:40px;padding-top:24px;border-top:1px solid var(--line);flex-wrap:wrap} +body.site .trust div{font-size:.88rem;color:var(--muted);line-height:1.5} +body.site .trust strong{display:block;font-family:var(--display);font-size:1.5rem;color:var(--ink)} + +body.site .frame{position:relative;aspect-ratio:4/4.6;border-radius:999px 999px 18px 18px;overflow:hidden;background:var(--forest); + box-shadow:0 2px 0 rgba(255,255,255,.6) inset, 0 40px 70px -30px rgba(30,34,25,.55), 0 0 0 10px rgba(244,241,234,1), 0 0 0 11px var(--line)} +body.site .frame img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;filter:saturate(.75) contrast(1.05);transform:scale(1.08);transition:transform .6s var(--ease)} +body.site .frame::before{content:"";position:absolute;inset:0;z-index:1; + background:linear-gradient(180deg,rgba(35,42,28,.35) 0%,rgba(35,42,28,.62) 45%,rgba(35,42,28,.9) 100%)} +body.site .frame .glow{position:absolute;z-index:1;width:420px;height:420px;border-radius:50%;pointer-events:none; + background:radial-gradient(circle,rgba(196,168,130,.28),transparent 65%);transform:translate(-50%,-50%);left:50%;top:45%;transition:opacity .4s} +body.site #scales{position:absolute;z-index:2;inset:10% 8% 12%;width:84%;height:78%;overflow:visible} +body.site .frame figcaption{position:absolute;z-index:3;inset-inline:0;bottom:18px;text-align:center;color:rgba(244,241,234,.78);font-family:var(--display);font-style:italic;font-size:1rem} +body.site .tag{position:absolute;z-index:4;inset-inline-end:-18px;top:16%;background:var(--cream);border-radius:14px;padding:14px 18px;box-shadow:var(--shadow-2); + display:flex;gap:12px;align-items:center;max-width:250px;font-size:.86rem;line-height:1.45} +body.site .tag .dot{width:10px;height:10px;border-radius:50%;background:var(--olive);box-shadow:0 0 0 5px rgba(74,93,35,.16);flex:none;animation:site-pulse 2.4s infinite} +@keyframes site-pulse{50%{box-shadow:0 0 0 9px rgba(74,93,35,.05)}} +body.site .hero-art{position:relative} +body.site .band{background:var(--forest);color:var(--cream);position:relative; + background-image:radial-gradient(1200px 300px at 50% -10%,rgba(196,168,130,.16),transparent 70%), + repeating-linear-gradient(0deg,rgba(255,255,255,.018) 0 1px,transparent 1px 3px)} +body.site .pillars{display:grid;grid-template-columns:repeat(3,1fr);gap:0} +body.site .pillar{padding:44px 34px;position:relative;transition:background .35s} +body.site .pillar+.pillar{border-inline-start:1px solid rgba(244,241,234,.12)} +body.site .pillar:hover{background:rgba(244,241,234,.04)} +body.site .pillar .k{font-family:var(--display);font-size:2.1rem;color:var(--cream);display:flex;align-items:center;gap:14px} +body.site .pillar .k svg{width:26px;height:26px;flex:none} +body.site .pillar p{margin:8px 0 0;color:var(--gold-lt);font-size:.98rem;max-width:22em} +body.site .founder{display:grid;grid-template-columns:.9fr 1.1fr;gap:72px;align-items:center} +body.site .portrait{position:relative;border-radius:18px;overflow:hidden;background:#E9E4D8;aspect-ratio:4/5;box-shadow:var(--shadow-2)} +body.site .portrait img{width:100%;height:100%;object-fit:cover;object-position:50% 20%;filter:grayscale(1) contrast(1.06) brightness(1.04);mix-blend-mode:multiply;transition:transform .8s var(--ease), filter .8s} +body.site .portrait:hover img{transform:scale(1.03);filter:grayscale(.65) contrast(1.06) brightness(1.04)} +body.site .portrait::after{content:"";position:absolute;inset:14px;border:1.5px dashed rgba(166,137,102,.7);border-radius:10px;pointer-events:none} +body.site .namecard{position:absolute;inset-inline-start:22px;bottom:22px;background:rgba(244,241,234,.92);backdrop-filter:blur(6px);padding:12px 18px;border-radius:12px;box-shadow:var(--shadow-1)} +body.site .namecard b{font-family:var(--display);font-size:1.3rem;display:block;line-height:1.2} +body.site .namecard span{font-size:.85rem;color:var(--muted)} +body.site blockquote{margin:22px 0 26px;font-family:var(--display);font-size:clamp(1.6rem,2.6vw,2.2rem);line-height:1.45;color:var(--forest);position:relative;padding-inline-start:28px;border-inline-start:3px solid var(--gold)} +body.site .founder p{color:#3A4033;margin:0 0 16px} +body.site .sign{display:flex;align-items:center;gap:16px;margin-top:26px} +body.site .docket{border-top:1px solid var(--line)} +body.site .row{display:grid;grid-template-columns:90px 1.1fr 1.4fr 56px;gap:24px;align-items:center;padding:30px 22px;border-bottom:1px solid var(--line); + position:relative;text-decoration:none;border-radius:14px;transition:background .35s var(--ease), color .35s, box-shadow .35s, transform .35s var(--ease)} +body.site .row .n{font-family:var(--display);font-size:2.4rem;color:var(--gold);line-height:1} +body.site .row h3{font-size:1.65rem} +body.site .chips{display:flex;flex-wrap:wrap;gap:8px} +body.site .chip{font-size:.85rem;padding:5px 12px;border-radius:999px;background:rgba(45,54,36,.06);color:#3A4033;transition:background .35s,color .35s} +body.site .go{width:48px;height:48px;border-radius:50%;display:grid;place-items:center;box-shadow:inset 0 0 0 1.5px var(--line);transition:all .35s var(--ease)} +html[dir=ltr] body.site .go svg{transform:scaleX(-1)} +body.site .row:hover{background:var(--forest);color:var(--cream);transform:translateY(-2px);box-shadow:0 24px 50px -24px rgba(30,34,25,.75);border-color:transparent} +body.site .row:hover h3{color:var(--cream)} +body.site .row:hover .chip{background:rgba(244,241,234,.1);color:var(--gold-lt)} +body.site .row:hover .go{background:var(--gold);box-shadow:0 0 0 6px rgba(166,137,102,.2);color:var(--ink)} +body.site .row::before{content:"";position:absolute;inset:8px;border-radius:10px;border:1.5px dashed rgba(196,168,130,0);transition:border-color .35s;pointer-events:none} +body.site .row:hover::before{border-color:rgba(196,168,130,.45)} +body.site .fabric{background:#ECE7DC} +body.site .fabric-grid{display:grid;grid-template-columns:1.15fr 1fr;gap:64px;align-items:center;margin-bottom:72px} +body.site .hoop{position:relative;border-radius:50%;aspect-ratio:1;overflow:hidden;box-shadow:0 0 0 14px #CDB792, 0 0 0 16px #8A7555, 0 40px 70px -30px rgba(30,34,25,.6);max-width:520px;margin-inline:auto} +body.site .hoop img{width:100%;height:100%;object-fit:cover;filter:hue-rotate(-140deg) saturate(.55) sepia(.25);transition:transform 1.2s var(--ease)} +body.site .hoop:hover img{transform:scale(1.06) rotate(-2deg)} +body.site .fabric h2{font-size:clamp(2rem,3.4vw,3.1rem);margin:14px 0 20px} +body.site .fabric .big{font-family:var(--display);font-size:1.35rem;line-height:1.7;color:var(--forest)} +body.site .three{display:grid;grid-template-columns:repeat(3,1fr);gap:22px} +body.site .card{background:#fff;border-radius:16px;overflow:hidden;box-shadow:var(--shadow-1);border:1px solid rgba(45,54,36,.08); + transition:transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s;display:flex;flex-direction:column} +body.site .card:hover{transform:translateY(-6px);box-shadow:var(--shadow-2);border-color:rgba(166,137,102,.55)} +body.site .card .ph{height:190px;position:relative;overflow:hidden;background:var(--forest)} +body.site .card .ph img{width:100%;height:100%;object-fit:cover;transition:transform .8s var(--ease);filter:saturate(.8)} +body.site .card:hover .ph img{transform:scale(1.06)} +body.site .card .ph::after{content:"";position:absolute;inset:0;background:linear-gradient(180deg,transparent 40%,rgba(35,42,28,.55))} +body.site .card .ph .lbl{position:absolute;z-index:1;inset-inline-start:18px;bottom:14px;color:var(--cream);font-family:var(--display);font-style:italic} +body.site .card .bd{padding:24px 26px 28px} +body.site .card h3{font-size:1.4rem;margin-bottom:8px} +body.site .card p{margin:0;color:var(--muted);font-size:.96rem} +body.site .motif-ph{display:grid;place-items:center} +body.site .motif-ph svg{width:150px;height:150px;margin-top:-10px} +body.site .sampler{display:grid;grid-template-columns:repeat(6,1fr);gap:16px} +body.site .val{background:#fff;border-radius:16px;padding:28px 14px 22px;text-align:center;border:1px solid rgba(45,54,36,.08);box-shadow:var(--shadow-1); + transition:transform .35s var(--ease), box-shadow .35s, border-color .35s} +body.site .medal{width:76px;height:76px;margin:0 auto 16px;border-radius:50%;display:grid;place-items:center; + background:radial-gradient(circle at 35% 30%,#FFFDF8,#EDE5D3 70%); + box-shadow:inset 0 0 0 1.5px rgba(166,137,102,.75), inset 0 -6px 12px rgba(138,117,85,.14), 0 0 0 5px #fff, 0 0 0 6px rgba(166,137,102,.35), 0 10px 20px -10px rgba(30,34,25,.45); + transition:box-shadow .35s var(--ease), transform .5s var(--ease)} +body.site .medal svg{width:32px;height:32px;fill:none;stroke:var(--gold-ink);stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;transition:stroke .35s} +body.site .val:hover .medal{transform:rotate(-8deg) scale(1.05);box-shadow:inset 0 0 0 1.5px var(--gold), inset 0 -6px 12px rgba(138,117,85,.14), 0 0 0 5px #fff, 0 0 0 6px var(--gold), 0 0 26px 2px rgba(166,137,102,.45)} +body.site .val:hover .medal svg{stroke:var(--olive)} +body.site .gem{width:12px;height:12px;transform:rotate(45deg);flex:none;background:linear-gradient(135deg,#F1E2C2,#A68966 60%,#6E5A3F);box-shadow:0 0 0 3px rgba(196,168,130,.18), 0 0 14px rgba(196,168,130,.5)} +body.site .val b{font-family:var(--display);font-size:1.2rem;display:block} +body.site .val:hover{transform:translateY(-6px) rotate(-.6deg);box-shadow:var(--shadow-2);border-color:rgba(166,137,102,.55)} +body.site .posts{display:grid;grid-template-columns:repeat(3,1fr);gap:22px} +body.site .post{position:relative;border-radius:16px;overflow:hidden;background:#fff;border:1px solid rgba(45,54,36,.08);box-shadow:var(--shadow-1);text-decoration:none;display:flex;flex-direction:column; + transition:transform .35s var(--ease), box-shadow .35s, border-color .35s} +body.site .post:hover{transform:translateY(-6px);box-shadow:var(--shadow-2);border-color:rgba(166,137,102,.55)} +body.site .post .ph{aspect-ratio:16/10;overflow:hidden;background:var(--forest)} +body.site .post .ph img{width:100%;height:100%;object-fit:cover;transition:transform .8s var(--ease)} +body.site .post:hover .ph img{transform:scale(1.05)} +body.site .post .bd{padding:30px 28px 28px;display:flex;flex-direction:column;gap:12px;flex:1;border-top:3px solid var(--gold);min-height:270px;position:relative} +body.site .post .bd::before{content:"”";position:absolute;inset-inline-end:22px;top:4px;font:700 5rem/1 var(--display);color:rgba(166,137,102,.22)} +body.site .post:hover .bd{border-top-color:var(--olive)} +body.site .post .meta{font-size:.8rem;color:var(--gold-ink);font-weight:600} +body.site .post h3{font-size:1.35rem} +body.site .post p{margin:0;color:var(--muted);font-size:.95rem} +body.site .post .more{margin-top:auto;font-weight:600;font-size:.9rem;color:var(--olive)} +body.site .post.text .ph{display:none} +body.site .post.text{background:var(--forest);color:var(--cream)} +body.site .post.text h3{color:var(--cream)} +body.site .post.text p{color:var(--gold-lt)} +body.site .post.text .meta{color:var(--gold-lt)} +body.site .post.text .more{color:var(--gold-lt)} + +@media (max-width:1100px){ + body.site .hero .wrap,body.site .founder,body.site .fabric-grid{grid-template-columns:1fr} + body.site .hero-art{max-width:560px;margin-inline:auto;width:100%} + body.site .sampler{grid-template-columns:repeat(3,1fr)} + body.site .posts{grid-template-columns:1fr 1fr} + body.site .posts .post:last-child{grid-column:1/-1} +} +@media (max-width:760px){ + body.site .hero{padding:36px 0 64px} + body.site .tag{inset-inline-end:8px;top:auto;bottom:-20px} + body.site .pillars,body.site .three,body.site .posts{grid-template-columns:1fr} + body.site .pillar+.pillar{border-inline-start:0;border-top:1px solid rgba(244,241,234,.12)} + body.site .pillar{padding:30px 6px} + body.site .row{grid-template-columns:52px 1fr;padding:22px 12px;gap:10px 16px} + body.site .row .chips{grid-column:1/-1} + body.site .row .go{display:none} + body.site .row .n{font-size:1.8rem} + body.site .sampler{grid-template-columns:repeat(2,1fr)} + body.site .trust{gap:18px} +} + /* ---------- Reveal (hidden only when JavaScript runs) ---------- */ body.site.js [data-reveal]{opacity:0;transform:translateY(28px);transition:opacity .9s var(--ease),transform .9s var(--ease)} body.site.js [data-reveal].in{opacity:1;transform:none} diff --git a/resources/views/components/site/post-card.blade.php b/resources/views/components/site/post-card.blade.php new file mode 100644 index 0000000..653b032 --- /dev/null +++ b/resources/views/components/site/post-card.blade.php @@ -0,0 +1,10 @@ +@props(['post']) + + +
+ {{ $post->published_at?->translatedFormat('j F Y') }} +

{{ $post->getTitle() }}

+

{{ \Illuminate\Support\Str::limit(strip_tags($post->getBody()), 140) }}

+ {{ __('home.read_more') }} +
+
diff --git a/resources/views/components/site/section-head.blade.php b/resources/views/components/site/section-head.blade.php new file mode 100644 index 0000000..b58e9f0 --- /dev/null +++ b/resources/views/components/site/section-head.blade.php @@ -0,0 +1,13 @@ +@props(['label', 'title', 'lede' => null]) + +
+
+ {{ $label }} +

{{ $title }}

+
+ @if ($lede) +

{{ $lede }}

+ @else + {{ $slot }} + @endif +
diff --git a/resources/views/livewire/pages/home.blade.php b/resources/views/livewire/pages/home.blade.php index 8cae3f4..708438b 100644 --- a/resources/views/livewire/pages/home.blade.php +++ b/resources/views/livewire/pages/home.blade.php @@ -18,222 +18,157 @@ new #[Layout('components.layouts.public')] class extends Component }; ?>
-
- {{-- Hero Section --}} -
-
- {{-- Tagline --}} -

- {{ __('home.tagline') }} -

- - {{-- Introductory Text --}} -

- {{ __('home.intro') }} -

- - {{-- CTA Buttons --}} -
- - {{ __('home.cta_book') }} - - - {{ __('home.cta_services') }} - + {{-- Hero --}} +
+
+
+ {{ __('site.hero_eyebrow') }} +

{{ __('site.hero_title_a') }}{{ __('site.hero_title_em') }}{{ __('site.hero_title_b') }}

+

{{ __('home.intro') }}

+ +
+ @foreach ([1, 2, 3] as $n) +
{{ __('site.trust_'.$n.'_title') }}{{ __('site.trust_'.$n.'_text') }}
+ @endforeach +
+
+
+
+ {{ __('site.alt_olive_tree') }} + + +
{{ __('site.frame_caption') }}
+
+
{{ __('site.frame_tag') }}
- {{-- About Section --}} -
-
-

- {{ __('home.about_title') }} -

- -
- {{-- Photo --}} -
- {{ __('home.lawyer_name') }} + {{-- Pillars band --}} +
+
+ @foreach (['justice', 'dignity', 'advocacy'] as $i => $pillar) +
+
{{ __('site.pillar_'.$pillar) }}
+

{{ __('site.pillar_'.$pillar.'_text') }}

+ @endforeach +
+
- {{-- Bio --}} -
-

- {{ __('home.lawyer_name') }} -

-

- {{ __('home.lawyer_title') }} -

-

- {{ __('home.lawyer_bio') }} -

-

- {{ __('home.lawyer_bio_2') }} -

-
+ {{-- Founder --}} +
+
+
+ {{ __('home.lawyer_name') }} +
{{ __('home.lawyer_name') }}{{ __('site.founder_role') }}
+
+
+ {{ __('site.art_founder') }} +

{{ __('home.about_title') }}

+
{{ __('site.founder_quote') }}
+

{{ __('home.lawyer_bio') }}

+

{{ __('home.lawyer_bio_2') }}

+
- {{-- Services Section --}} -
-
-
-

- {{ __('home.services_title') }} -

-

- {{ __('home.services_subtitle') }} -

-
- -
- {{-- Legal Consultations & Representation --}} -
-
- -
-

- {{ __('home.service_consultation_title') }} -

-
    - @foreach(__('home.service_consultation_items') as $item) -
  • - - {{ $item }} -
  • - @endforeach -
-
- - {{-- Women's & Family Law --}} -
-
- -
-

- {{ __('home.service_family_title') }} -

-
    - @foreach(__('home.service_family_items') as $item) -
  • - - {{ $item }} -
  • - @endforeach -
-
- - {{-- Civil & Commercial Disputes --}} -
-
- -
-

- {{ __('home.service_civil_title') }} -

-
    - @foreach(__('home.service_civil_items') as $item) -
  • - - {{ $item }} -
  • - @endforeach -
-
- - {{-- Business Legal Services --}} -
-
- -
-

- {{ __('home.service_business_title') }} -

-
    - @foreach(__('home.service_business_items') as $item) -
  • - - {{ $item }} -
  • - @endforeach -
-
-
-
-
- - {{-- Values Section --}} -
-
-
-

- {{ __('home.values_title') }} -

-

- {{ __('home.values_subtitle') }} -

-
- -
- @foreach(['integrity', 'justice', 'knowledge', 'empowerment', 'professionalism', 'innovation'] as $value) -
-
- + {{-- Services docket --}} +
+ +
+ + {{-- Vision --}} +
+
+
+
+ {{ __('site.art_vision') }} +

{{ __('site.vision_title') }}

+

{{ __('site.vision_text') }}

+
+
{{ __('site.alt_hoop') }}
+
+
+
+
{{ __('site.card_institution_label') }}
+

{{ __('site.card_institution_title') }}

{{ __('site.card_institution_text') }}

+
+
+
{{ __('site.alt_olives') }}{{ __('site.card_society_label') }}
+

{{ __('site.card_society_title') }}

{{ __('site.card_society_text') }}

+
+
+
{{ __('site.alt_hills') }}{{ __('site.card_diaspora_label') }}
+

{{ __('site.card_diaspora_title') }}

{{ __('site.card_diaspora_text') }}

+
+
+
+
+ + {{-- Values --}} + @php + $valueIcons = [ + '', + '', + '', + '', + '', + '', + ]; + @endphp +
+
+ +
+ @foreach (['integrity', 'justice', 'knowledge', 'empowerment', 'professionalism', 'innovation'] as $i => $value) +
+ + {{ __('home.values.'.$value.'.title') }}
@endforeach
- {{-- Latest Posts Section --}} - @if($latestPosts->count() > 0) -
-
-
-

- {{ __('home.posts_title') }} -

-
- -
- @foreach($latestPosts as $post) - + {{-- Latest articles --}} +
+
+ + {{ __('home.view_all_posts') }} + + @if ($latestPosts->isNotEmpty()) +
+ @foreach ($latestPosts as $post) + @endforeach
+ @else +

{{ __('home.posts_empty') }}

+ @endif +
+
- -
-
- @endif -
+ {{-- booking card: task 24-5 --}}
diff --git a/tests/Feature/Design/HomeRedesignTest.php b/tests/Feature/Design/HomeRedesignTest.php new file mode 100644 index 0000000..8511ffe --- /dev/null +++ b/tests/Feature/Design/HomeRedesignTest.php @@ -0,0 +1,96 @@ +withSession(['locale' => $locale])->get('/')->assertOk()->getContent(); +} + +test('home renders the seven sections in order in both languages', function () { + foreach (['ar', 'en'] as $locale) { + $html = homeHtml($locale); + + $positions = array_map(fn ($id) => strpos($html, 'id="'.$id.'"'), ['top', 'founder', 'services', 'mission', 'values', 'posts']); + $bandPos = strpos($html, 'class="band on-dark"'); + + foreach ($positions as $p) { + expect($p)->not->toBeFalse(); + } + $sorted = $positions; + sort($sorted); + expect($positions)->toBe($sorted); + expect($bandPos)->toBeGreaterThan($positions[0])->toBeLessThan($positions[1]); + } +}); + +test('home copy comes from the site and home keys', function () { + $ar = homeHtml('ar'); + expect($ar)->toContain(__('site.hero_title_em', [], 'ar'))->toContain(__('site.vision_title', [], 'ar')) + ->toContain(__('home.services_subtitle', [], 'ar')); + + $en = homeHtml('en'); + expect($en)->toContain('daily practice')->toContain('Woven from the fabric of society')->toContain('Article 04'); +}); + +test('home has one h1 and every image has alt text', function () { + foreach (['ar', 'en'] as $locale) { + $html = homeHtml($locale); + expect(substr_count($html, 'toBe(1); + + preg_match_all('/]*>/', $html, $m); + foreach ($m[0] as $img) { + expect($img)->toMatch('/\balt="[^"]+"/'); + } + } +}); + +test('site photographs exist as jpegs', function () { + foreach (['olive-tree', 'embroidery-hoop', 'olives', 'hills'] as $name) { + $path = public_path("images/site/$name.jpg"); + expect(file_exists($path))->toBeTrue(); + expect(bin2hex(substr(file_get_contents($path), 0, 3)))->toBe('ffd8ff'); + } +}); + +test('hero holds the balance and the booking placeholder anchors exist as links', function () { + $html = homeHtml('ar'); + + expect($html)->toContain('data-balance="hero"')->toContain('class="frame"')->toContain('data-balance="static"'); + expect(substr_count($html, 'class="row"'))->toBe(4); + expect(substr_count($html, 'href="#book"'))->toBeGreaterThanOrEqual(5); + expect($html)->toContain(__('home.service_consultation_items', [], 'ar')[0]); +}); + +test('latest posts render as text-only cards, or the empty message', function () { + $empty = homeHtml('en'); + expect($empty)->toContain(__('home.posts_empty', [], 'en'))->not->toContain('class="posts"'); + + $posts = Post::factory()->published()->count(3)->create(); + $html = homeHtml('en'); + + expect($html)->toContain('class="posts"'); + expect(substr_count($html, 'class="post"'))->toBe(3); + expect($html)->toContain(route('posts.show', $posts->first()))->toContain(__('home.read_more', [], 'en')); + + preg_match('~
(.*?)
~s', $html, $block); + expect($block[1])->not->toContain('not->toContain('Unsplash'); +}); + +test('site lang keys exist in both languages for the home page', function () { + $keys = ['hero_eyebrow', 'hero_title_a', 'hero_title_em', 'hero_title_b', 'trust_1_title', 'trust_3_text', 'alt_olive_tree', 'balance_label', + 'frame_caption', 'frame_tag', 'pillars_label', 'pillar_advocacy_text', 'art_founder', 'founder_role', 'founder_quote', 'founder_cta', + 'art_services', 'services_lede', 'art_vision', 'vision_title', 'vision_text', 'alt_hoop', 'card_institution_label', 'card_diaspora_text', + 'alt_olives', 'alt_hills', 'art_values', 'art_articles']; + foreach (['ar', 'en'] as $locale) { + $table = require base_path("lang/$locale/site.php"); + foreach ($keys as $k) { + expect($table)->toHaveKey($k); + } + } + expect(require base_path('lang/en/site.php'))->toHaveKey('hero_title_a', 'Justice is a '); +});