From 972af7a127defb52d87e73ec143df30dc858eb2b Mon Sep 17 00:00:00 2001 From: Naser Mansour Date: Fri, 9 Jan 2026 16:51:55 +0200 Subject: [PATCH] complete story 14.1 --- docs/stories/story-14.1-hero-section.md | 70 ++++++++++++++++++---- lang/ar/home.php | 8 +++ lang/en/home.php | 8 +++ resources/css/app.css | 5 ++ resources/views/pages/home.blade.php | 57 +++++++++++++----- tests/Feature/Public/HomePageTest.php | 80 +++++++++++++++++++++++++ 6 files changed, 201 insertions(+), 27 deletions(-) create mode 100644 lang/ar/home.php create mode 100644 lang/en/home.php create mode 100644 tests/Feature/Public/HomePageTest.php diff --git a/docs/stories/story-14.1-hero-section.md b/docs/stories/story-14.1-hero-section.md index 3afc1d3..8af1e84 100644 --- a/docs/stories/story-14.1-hero-section.md +++ b/docs/stories/story-14.1-hero-section.md @@ -127,17 +127,17 @@ return [ ## Dev Checklist -- [ ] Create hero section HTML structure -- [ ] Add English translations to `lang/en/home.php` -- [ ] Add Arabic translations to `lang/ar/home.php` -- [ ] Style tagline with correct typography -- [ ] Style intro text with max-width -- [ ] Implement primary CTA button linking to `/booking` -- [ ] Implement secondary CTA with smooth scroll to `#services` -- [ ] Test responsive layout (mobile, tablet, desktop) -- [ ] Test RTL layout (Arabic) -- [ ] Test LTR layout (English) -- [ ] Verify color usage matches brand guidelines +- [x] Create hero section HTML structure +- [x] Add English translations to `lang/en/home.php` +- [x] Add Arabic translations to `lang/ar/home.php` +- [x] Style tagline with correct typography +- [x] Style intro text with max-width +- [x] Implement primary CTA button linking to `/booking` +- [x] Implement secondary CTA with smooth scroll to `#services` +- [x] Test responsive layout (mobile, tablet, desktop) +- [x] Test RTL layout (Arabic) +- [x] Test LTR layout (English) +- [x] Verify color usage matches brand guidelines ## Estimation @@ -148,3 +148,51 @@ return [ - Epic 12 completed (brand colors available) - Booking route exists at `/booking` + +--- + +## Dev Agent Record + +### Status + +Ready for Review + +### Agent Model Used + +Claude Opus 4.5 (claude-opus-4-5-20251101) + +### File List + +| File | Action | Description | +|------|--------|-------------| +| `resources/views/pages/home.blade.php` | Modified | Added hero section with tagline, intro, and CTA buttons | +| `lang/en/home.php` | Created | English translations for hero section | +| `lang/ar/home.php` | Created | Arabic translations for hero section | +| `resources/css/app.css` | Modified | Added smooth scroll behavior for HTML element | +| `tests/Feature/Public/HomePageTest.php` | Created | 12 tests covering all acceptance criteria | + +### Completion Notes + +- Implemented hero section with full-width warm cream background per AC1 +- Responsive typography: 1.75rem mobile, 2rem tablet, 2.5rem desktop per AC2 +- Intro text constrained to 800px max-width per AC3 +- Primary CTA uses existing `btn-primary` class with warm gold styling per AC4 +- Secondary CTA uses `btn-secondary` class with forest green border per AC5 +- Smooth scroll implemented via CSS `scroll-behavior: smooth` on html element +- Added `id="services"` to existing services section for anchor link +- Buttons stack vertically on mobile, inline on tablet/desktop per AC6 +- RTL support automatic via Tailwind's built-in RTL utilities per AC7 +- All 12 feature tests pass covering bilingual content, links, and structure + +### Change Log + +| Date | Change | +|------|--------| +| 2026-01-09 | Initial implementation of hero section | +| 2026-01-09 | Created translation files (en/ar) | +| 2026-01-09 | Added smooth scroll CSS | +| 2026-01-09 | Created comprehensive test suite | + +### Debug Log References + +N/A - No issues encountered during implementation diff --git a/lang/ar/home.php b/lang/ar/home.php new file mode 100644 index 0000000..036c83d --- /dev/null +++ b/lang/ar/home.php @@ -0,0 +1,8 @@ + 'ملتزمون بالعدالة – متجذرون بالكرامة – مدفوعون للدفاع', + 'intro' => 'ليبرا للحقوق مؤسسة قانونية منسوجة من نسيج المجتمع، تقدم حلولاً قانونية مبتكرة بأمانة واحترافية.', + 'cta_book' => 'احجز استشارة', + 'cta_services' => 'خدماتنا', +]; diff --git a/lang/en/home.php b/lang/en/home.php new file mode 100644 index 0000000..423c972 --- /dev/null +++ b/lang/en/home.php @@ -0,0 +1,8 @@ + 'Committed to Justice – Grounded in Dignity – Driven to Advocate', + 'intro' => 'Libra for Rights is a legal institution woven from the fabric of society, offering innovative legal solutions with honesty and professionalism.', + 'cta_book' => 'Book a Consultation', + 'cta_services' => 'Our Services', +]; diff --git a/resources/css/app.css b/resources/css/app.css index 2979cc3..c77f411 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -328,6 +328,11 @@ html[lang="en"] body { font-family: var(--font-english); } +/* Smooth Scrolling */ +html { + scroll-behavior: smooth; +} + /* Typography Base Styles */ body { font-size: var(--font-size-base); diff --git a/resources/views/pages/home.blade.php b/resources/views/pages/home.blade.php index ae34577..1d273b2 100644 --- a/resources/views/pages/home.blade.php +++ b/resources/views/pages/home.blade.php @@ -1,21 +1,46 @@ -
-

{{ __('Libra Law Firm') }}

-

{{ __('Professional legal services with integrity and excellence.') }}

+ {{-- Hero Section --}} +
+
+ {{-- Tagline --}} +

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

-
-
-

{{ __('Expert Consultations') }}

-

{{ __('Professional legal advice tailored to your needs.') }}

-
-
-

{{ __('Case Management') }}

-

{{ __('Track your cases and stay informed every step of the way.') }}

-
-
-

{{ __('Legal Resources') }}

-

{{ __('Access our library of legal insights and articles.') }}

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

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

+ + {{-- CTA Buttons --}} +
-
+
+ + {{-- Services Section Placeholder --}} +
+
+
+
+

{{ __('Expert Consultations') }}

+

{{ __('Professional legal advice tailored to your needs.') }}

+
+
+

{{ __('Case Management') }}

+

{{ __('Track your cases and stay informed every step of the way.') }}

+
+
+

{{ __('Legal Resources') }}

+

{{ __('Access our library of legal insights and articles.') }}

+
+
+
+
diff --git a/tests/Feature/Public/HomePageTest.php b/tests/Feature/Public/HomePageTest.php new file mode 100644 index 0000000..db57b6f --- /dev/null +++ b/tests/Feature/Public/HomePageTest.php @@ -0,0 +1,80 @@ +get('/') + ->assertOk(); +}); + +test('home page displays English tagline when locale is English', function () { + $this->withSession(['locale' => 'en']) + ->get('/') + ->assertOk() + ->assertSee('Committed to Justice – Grounded in Dignity – Driven to Advocate'); +}); + +test('home page displays Arabic tagline when locale is Arabic', function () { + $this->withSession(['locale' => 'ar']) + ->get('/') + ->assertOk() + ->assertSee('ملتزمون بالعدالة – متجذرون بالكرامة – مدفوعون للدفاع'); +}); + +test('home page displays English intro text when locale is English', function () { + $this->withSession(['locale' => 'en']) + ->get('/') + ->assertOk() + ->assertSee('Libra for Rights is a legal institution woven from the fabric of society'); +}); + +test('home page displays Arabic intro text when locale is Arabic', function () { + $this->withSession(['locale' => 'ar']) + ->get('/') + ->assertOk() + ->assertSee('ليبرا للحقوق مؤسسة قانونية منسوجة من نسيج المجتمع'); +}); + +test('home page displays Book a Consultation button in English', function () { + $this->withSession(['locale' => 'en']) + ->get('/') + ->assertOk() + ->assertSee('Book a Consultation'); +}); + +test('home page displays Book a Consultation button in Arabic', function () { + $this->withSession(['locale' => 'ar']) + ->get('/') + ->assertOk() + ->assertSee('احجز استشارة'); +}); + +test('home page displays Our Services button in English', function () { + $this->withSession(['locale' => 'en']) + ->get('/') + ->assertOk() + ->assertSee('Our Services'); +}); + +test('home page displays Our Services button in Arabic', function () { + $this->withSession(['locale' => 'ar']) + ->get('/') + ->assertOk() + ->assertSee('خدماتنا'); +}); + +test('home page contains link to booking page', function () { + $this->get('/') + ->assertOk() + ->assertSee('href="'.route('booking').'"', false); +}); + +test('home page contains link to services section', function () { + $this->get('/') + ->assertOk() + ->assertSee('href="#services"', false); +}); + +test('home page contains services section with id', function () { + $this->get('/') + ->assertOk() + ->assertSee('id="services"', false); +});