24-2: navigation and footer — implemented, QA Review

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Naser Mansour
2026-10-31 18:43:25 +02:00
parent 5f5d1d2b31
commit 8b2c35f76f
9 changed files with 303 additions and 277 deletions
+33 -58
View File
@@ -1,68 +1,43 @@
<footer class="bg-primary mt-auto" data-test="main-footer">
<div class="max-w-[1200px] mx-auto px-4 sm:px-6 lg:px-8 py-6 sm:py-8">
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6 sm:gap-8">
<!-- Logo & Description -->
<div class="text-center sm:text-start">
<x-logo size="lg" class="logo-badge" />
<p class="mt-3 text-cta text-sm">
{{ __('footer.description') }}
</p>
<footer class="site-footer" data-test="main-footer">
<span class="foot-band" aria-hidden="true"></span>
<div class="wrap">
<div class="foot">
<div>
<a href="{{ route('home') }}" class="brand" aria-label="{{ __('site.brand_label') }}" wire:navigate>
<span class="seal" style="background-image:url('{{ asset('images/logo.png') }}')"></span>
<span>
<b>{{ __('site.brand_name') }}</b>
<small>{{ __('site.brand_sub') }}</small>
</span>
</a>
<p>{{ __('home.tagline') }}</p>
</div>
<!-- Contact Information -->
<div class="text-center sm:text-start">
<h3 class="text-off-white font-semibold mb-3">{{ __('footer.contact') }}</h3>
<address class="text-cta text-sm not-italic space-y-2">
<p class="flex items-center justify-center sm:justify-start gap-2">
<flux:icon name="phone" class="w-4 h-4 text-cta flex-shrink-0" />
<a href="tel:+970599353502" class="hover:text-cta-light transition-colors ltr-inline" data-test="footer-phone">
+970 599 353 502
</a>
</p>
<p class="flex items-start justify-center sm:justify-start gap-2">
<flux:icon name="map-pin" class="w-4 h-4 text-cta flex-shrink-0 mt-0.5" />
<span data-test="footer-address">{{ __('footer.address') }}</span>
</p>
<p class="flex items-center justify-center sm:justify-start gap-2">
<flux:icon name="envelope" class="w-4 h-4 text-cta flex-shrink-0" />
<a href="mailto:{{ __('footer.email') }}" class="hover:text-cta-light transition-colors ltr-inline" data-test="footer-email">
{{ __('footer.email') }}
</a>
</p>
</address>
<div>
<h4>{{ __('site.footer_explore') }}</h4>
<a href="{{ route('about') }}" wire:navigate>{{ __('site.nav_about') }}</a>
<a href="{{ route('home') }}#services" wire:navigate>{{ __('site.nav_services') }}</a>
<a href="{{ route('posts.index') }}" wire:navigate>{{ __('site.nav_articles') }}</a>
<a href="{{ route('booking') }}" wire:navigate>{{ __('site.nav_booking') }}</a>
</div>
<!-- Legal Links -->
<div class="text-center sm:text-start sm:col-span-2 lg:col-span-1">
<h3 class="text-off-white font-semibold mb-3">{{ __('footer.legal') }}</h3>
<ul class="space-y-2 flex flex-row sm:flex-col gap-4 sm:gap-0 justify-center sm:justify-start">
<li>
<a
href="{{ route('terms') }}"
class="text-cta hover:text-cta-light transition-colors text-sm min-h-[44px] inline-flex items-center"
data-test="footer-terms"
>
{{ __('footer.terms') }}
</a>
</li>
<li>
<a
href="{{ route('privacy') }}"
class="text-cta hover:text-cta-light transition-colors text-sm min-h-[44px] inline-flex items-center"
data-test="footer-privacy"
>
{{ __('footer.privacy') }}
</a>
</li>
</ul>
<div>
<h4>{{ __('site.footer_clients') }}</h4>
<a href="{{ route('login') }}" wire:navigate>{{ __('site.nav_login') }}</a>
<a href="{{ route('terms') }}" wire:navigate data-test="footer-terms">{{ __('site.footer_terms') }}</a>
<a href="{{ route('privacy') }}" wire:navigate data-test="footer-privacy">{{ __('site.footer_privacy') }}</a>
</div>
<div>
<h4>{{ __('site.footer_contact') }}</h4>
<a href="tel:+970599353502" dir="ltr" data-test="footer-phone">{{ __('footer.phone') }}</a>
<a href="mailto:{{ __('footer.email') }}" data-test="footer-email">{{ __('footer.email') }}</a>
<span data-test="footer-address">{{ __('footer.address') }}</span>
</div>
</div>
<!-- Copyright -->
<div class="mt-6 sm:mt-8 pt-4 sm:pt-6 border-t border-cta/20 text-center">
<p class="text-cta text-xs sm:text-sm" data-test="footer-copyright">
&copy; {{ date('Y') }} {{ __('footer.copyright') }}
</p>
<div class="legal">
<span data-test="footer-copyright">&copy; {{ date('Y') }} {{ __('footer.copyright') }}</span>
</div>
</div>
</footer>
+84 -217
View File
@@ -1,141 +1,78 @@
<nav
@php
$isAr = app()->getLocale() === 'ar';
$links = [
['key' => 'home', 'href' => route('home'), 'label' => __('site.nav_home'), 'current' => request()->routeIs('home')],
['key' => 'about', 'href' => route('about'), 'label' => __('site.nav_about'), 'current' => request()->routeIs('about')],
['key' => 'services', 'href' => route('home').'#services', 'label' => __('site.nav_services'), 'current' => false],
['key' => 'posts', 'href' => route('posts.index'), 'label' => __('site.nav_articles'), 'current' => request()->routeIs('posts*')],
['key' => 'booking', 'href' => route('booking'), 'label' => __('site.nav_booking'), 'current' => request()->routeIs('booking*')],
];
$langHref = url('/language/'.($isAr ? 'en' : 'ar'));
$langText = $isAr ? 'EN' : 'ع';
@endphp
<header
x-data="{ mobileMenuOpen: false }"
class="fixed top-0 inset-x-0 z-50 bg-primary"
class="nav"
id="site-nav"
data-test="main-navigation"
>
<div class="max-w-[1200px] mx-auto px-4">
<div class="flex items-center justify-between h-16">
<!-- Logo - Left on desktop -->
<div class="shrink-0 hidden md:block">
<a href="{{ route('home') }}" class="flex items-center" wire:navigate>
<x-logo size="md" class="logo-badge" />
</a>
</div>
<div class="wrap">
<a href="{{ route('home') }}" class="brand" aria-label="{{ __('site.brand_label') }}" wire:navigate>
<span class="seal" style="background-image:url('{{ asset('images/logo.png') }}')"></span>
<span>
<b>{{ __('site.brand_name') }}</b>
<small>{{ __('site.brand_sub') }}</small>
</span>
</a>
<!-- Mobile: Hamburger + Centered Logo + Language -->
<div class="flex items-center justify-between w-full md:hidden">
<!-- Hamburger Button -->
<button
@click="mobileMenuOpen = !mobileMenuOpen"
class="p-2 text-off-white hover:text-cta focus:outline-none min-h-[44px] min-w-[44px] flex items-center justify-center"
:aria-expanded="mobileMenuOpen"
aria-label="{{ __('Toggle navigation menu') }}"
data-test="mobile-menu-button"
>
<svg x-show="!mobileMenuOpen" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" />
</svg>
<svg x-show="mobileMenuOpen" x-cloak class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
</svg>
</button>
<!-- Centered Logo on Mobile -->
<a href="{{ route('home') }}" class="flex items-center" wire:navigate>
<x-logo size="sm" class="logo-badge" />
</a>
<!-- Language Toggle on Mobile -->
<div class="min-w-[44px]">
<x-language-toggle />
</div>
</div>
<!-- Desktop Navigation Links -->
<div class="hidden md:flex md:items-center md:gap-6">
<nav class="links" aria-label="{{ __('site.nav_main') }}">
@foreach ($links as $link)
<a
href="{{ route('home') }}"
@class([
'text-off-white hover:text-cta transition-colors py-2',
'border-b-2 border-cta' => request()->routeIs('home'),
])
href="{{ $link['href'] }}"
@if ($link['current']) aria-current="page" @endif
wire:navigate
data-test="nav-home"
>
{{ __('navigation.home') }}
</a>
<a
href="{{ route('about') }}"
@class([
'text-off-white hover:text-cta transition-colors py-2',
'border-b-2 border-cta' => request()->routeIs('about'),
])
wire:navigate
data-test="nav-about"
>
{{ __('navigation.about') }}
</a>
<a
href="{{ route('booking') }}"
@class([
'text-off-white hover:text-cta transition-colors py-2',
'border-b-2 border-cta' => request()->routeIs('booking*'),
])
wire:navigate
data-test="nav-booking"
>
{{ __('navigation.booking') }}
</a>
<a
href="{{ route('posts.index') }}"
@class([
'text-off-white hover:text-cta transition-colors py-2',
'border-b-2 border-cta' => request()->routeIs('posts*'),
])
wire:navigate
data-test="nav-posts"
>
{{ __('navigation.posts') }}
</a>
data-test="nav-{{ $link['key'] }}"
>{{ $link['label'] }}</a>
@endforeach
</nav>
@auth
@php
$dashboardRoute = auth()->user()->isAdmin() ? route('admin.dashboard') : route('client.dashboard');
@endphp
<a
href="{{ $dashboardRoute }}"
@class([
'text-off-white hover:text-cta transition-colors py-2',
'border-b-2 border-cta' => request()->routeIs('*.dashboard'),
])
wire:navigate
data-test="nav-dashboard"
>
{{ __('navigation.dashboard') }}
</a>
<form method="POST" action="{{ route('logout') }}" class="inline">
@csrf
<button
type="submit"
class="text-off-white hover:text-cta transition-colors py-2"
data-test="nav-logout"
>
{{ __('navigation.logout') }}
</button>
</form>
@else
<a
href="{{ route('login') }}"
@class([
'text-off-white hover:text-cta transition-colors py-2',
'border-b-2 border-cta' => request()->routeIs('login'),
])
wire:navigate
data-test="nav-login"
>
{{ __('navigation.login') }}
</a>
@endauth
</div>
<div class="nav-tools">
<a class="lang" href="{{ $langHref }}" aria-label="{{ __('site.lang_switch') }}" data-test="nav-language">{{ $langText }}</a>
<!-- Desktop Language Toggle -->
<div class="hidden md:block">
<x-language-toggle />
</div>
@auth
@php
$dashboardRoute = auth()->user()->isAdmin() ? route('admin.dashboard') : route('client.dashboard');
@endphp
<a class="login" href="{{ $dashboardRoute }}" wire:navigate data-test="nav-dashboard">{{ __('navigation.dashboard') }}</a>
<form method="POST" action="{{ route('logout') }}" class="inline">
@csrf
<button type="submit" class="login" data-test="nav-logout">{{ __('navigation.logout') }}</button>
</form>
@else
<a class="login" href="{{ route('login') }}" wire:navigate data-test="nav-login">{{ __('site.nav_login') }}</a>
@endauth
<a class="btn btn-gold" href="{{ route('home') }}#book">{{ __('site.nav_book') }}</a>
<button
type="button"
class="menu-btn"
@click="mobileMenuOpen = !mobileMenuOpen"
:aria-expanded="mobileMenuOpen"
aria-label="{{ __('site.nav_menu') }}"
data-test="mobile-menu-button"
>
<svg x-show="!mobileMenuOpen" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" />
</svg>
<svg x-show="mobileMenuOpen" x-cloak class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
</svg>
</button>
</div>
</div>
<!-- Mobile Menu -->
<!-- Mobile menu sheet -->
<div
x-show="mobileMenuOpen"
x-trap.inert.noscroll="mobileMenuOpen"
@@ -148,102 +85,32 @@
x-cloak
@click.away="mobileMenuOpen = false"
@keydown.escape.window="mobileMenuOpen = false"
class="md:hidden bg-primary border-t border-cta/20"
class="menu-sheet"
role="dialog"
aria-modal="true"
aria-label="{{ __('Mobile navigation menu') }}"
aria-label="{{ __('site.nav_menu') }}"
data-test="mobile-menu"
>
<div class="px-4 py-3 space-y-1">
@foreach ($links as $link)
<a
href="{{ route('home') }}"
@class([
'block px-3 py-3 text-off-white hover:text-cta hover:bg-primary-light rounded-md min-h-[44px] flex items-center',
'bg-active border-s-2 border-cta' => request()->routeIs('home'),
])
href="{{ $link['href'] }}"
@if ($link['current']) aria-current="page" @endif
wire:navigate
@click="mobileMenuOpen = false"
data-test="mobile-nav-home"
>
{{ __('navigation.home') }}
</a>
<a
href="{{ route('about') }}"
@class([
'block px-3 py-3 text-off-white hover:text-cta hover:bg-primary-light rounded-md min-h-[44px] flex items-center',
'bg-active border-s-2 border-cta' => request()->routeIs('about'),
])
wire:navigate
@click="mobileMenuOpen = false"
data-test="mobile-nav-about"
>
{{ __('navigation.about') }}
</a>
<a
href="{{ route('booking') }}"
@class([
'block px-3 py-3 text-off-white hover:text-cta hover:bg-primary-light rounded-md min-h-[44px] flex items-center',
'bg-active border-s-2 border-cta' => request()->routeIs('booking*'),
])
wire:navigate
@click="mobileMenuOpen = false"
data-test="mobile-nav-booking"
>
{{ __('navigation.booking') }}
</a>
<a
href="{{ route('posts.index') }}"
@class([
'block px-3 py-3 text-off-white hover:text-cta hover:bg-primary-light rounded-md min-h-[44px] flex items-center',
'bg-active border-s-2 border-cta' => request()->routeIs('posts*'),
])
wire:navigate
@click="mobileMenuOpen = false"
data-test="mobile-nav-posts"
>
{{ __('navigation.posts') }}
</a>
data-test="mobile-nav-{{ $link['key'] }}"
>{{ $link['label'] }}</a>
@endforeach
@auth
@php
$dashboardRoute = auth()->user()->isAdmin() ? route('admin.dashboard') : route('client.dashboard');
@endphp
<a
href="{{ $dashboardRoute }}"
@class([
'block px-3 py-3 text-off-white hover:text-cta hover:bg-primary-light rounded-md min-h-[44px] flex items-center',
'bg-active border-s-2 border-cta' => request()->routeIs('*.dashboard'),
])
wire:navigate
@click="mobileMenuOpen = false"
data-test="mobile-nav-dashboard"
>
{{ __('navigation.dashboard') }}
</a>
<form method="POST" action="{{ route('logout') }}">
@csrf
<button
type="submit"
class="w-full text-start px-3 py-3 text-off-white hover:text-cta hover:bg-primary-light rounded-md min-h-[44px] flex items-center"
data-test="mobile-nav-logout"
>
{{ __('navigation.logout') }}
</button>
</form>
@else
<a
href="{{ route('login') }}"
@class([
'block px-3 py-3 text-off-white hover:text-cta hover:bg-primary-light rounded-md min-h-[44px] flex items-center',
'bg-active border-s-2 border-cta' => request()->routeIs('login'),
])
wire:navigate
@click="mobileMenuOpen = false"
data-test="mobile-nav-login"
>
{{ __('navigation.login') }}
</a>
@endauth
</div>
@auth
<a href="{{ $dashboardRoute }}" wire:navigate @click="mobileMenuOpen = false" data-test="mobile-nav-dashboard">{{ __('navigation.dashboard') }}</a>
<form method="POST" action="{{ route('logout') }}">
@csrf
<button type="submit" data-test="mobile-nav-logout">{{ __('navigation.logout') }}</button>
</form>
@else
<a href="{{ route('login') }}" wire:navigate @click="mobileMenuOpen = false" data-test="mobile-nav-login">{{ __('site.nav_login') }}</a>
@endauth
<a class="btn btn-gold" href="{{ route('home') }}#book" @click="mobileMenuOpen = false">{{ __('site.nav_book') }}</a>
</div>
</nav>
</header>