From 19cc712dd11df3e8884c34116f899705210abbc8 Mon Sep 17 00:00:00 2001 From: thejmitchener Date: Mon, 15 Jul 2024 22:39:14 -0400 Subject: [PATCH] Add laravel-forms to tailwind.config.js file, update phone config, update classes in blade files, update logo images, update navigation scroll behavior, update phone button behavior, add pre scrolled routes. --- README.md | 2 +- config/navigation.php | 11 +- .../desktop/desktop-navigation-link.blade.php | 4 +- .../views/components/dropdown-link.blade.php | 4 +- .../components/hamburger-button.blade.php | 6 +- resources/views/components/logo.blade.php | 21 +--- .../mobile/mobile-dropdown.blade.php | 8 +- .../components/navigation-scroll.blade.php | 21 ++-- .../views/components/navigation.blade.php | 102 +++++++++--------- .../views/components/phone-button.blade.php | 2 +- src/Navigation.php | 12 +++ 11 files changed, 101 insertions(+), 92 deletions(-) diff --git a/README.md b/README.md index b47cfab..76b140c 100644 --- a/README.md +++ b/README.md @@ -96,7 +96,7 @@ Add laravel-forms to your tailwind.config.js file: ```javascript content: [ - './vendor/fuelviews/laravel-navigation/resources/**/*.{js,vue,blade.php}', + './vendor/fuelviews/laravel-*/resources/**/*.{js,vue,blade.php}', ] ``` diff --git a/config/navigation.php b/config/navigation.php index d4663e2..b91624e 100644 --- a/config/navigation.php +++ b/config/navigation.php @@ -31,13 +31,18 @@ ], ], + // pre scrolled routes + 'pre_scrolled_routes' => [ + // 'welcome', + ], + + // phone config + 'phone' => config('businessinfo.phone') ?: '(666) 666-6666', + // logo config 'default_logo' => 'images/logo.png', 'transparency_logo' => 'images/logo.png', - // phone config - 'phone' => '(666) 420-6969', - // navigation config 'top_nav_enabled' => false, 'logo_swap_enabled' => true, diff --git a/resources/views/components/desktop/desktop-navigation-link.blade.php b/resources/views/components/desktop/desktop-navigation-link.blade.php index 783d015..999a798 100644 --- a/resources/views/components/desktop/desktop-navigation-link.blade.php +++ b/resources/views/components/desktop/desktop-navigation-link.blade.php @@ -2,8 +2,8 @@ @php $classes = ($active ?? false) - ? 'inline-flex items-center border-b-2 border-prime-400 text-sm font-medium leading-5 hover:text-gray-400 hover:border-gray-300 focus:outline-none focus:text-gray-700 focus:border-gray-300 transition duration-150 ease-in-out py-2 uppercase' - : 'inline-flex items-center border-b-2 border-transparent text-sm font-medium leading-5 hover:text-gray-400 hover:border-gray-300 focus:outline-none focus:text-gray-700 focus:border-gray-300 transition duration-150 ease-in-out py-2 uppercase'; + ? 'inline-flex items-center border-b-2 border-prime-400 text-sm font-medium leading-5 hover:text-gray-400 hover:border-gray-300 focus:outline-none focus:text-gray-700 focus:border-gray-300 transition duration-150 ease-in-out py-2 uppercase' + : 'inline-flex items-center border-b-2 border-transparent text-sm font-medium leading-5 hover:text-gray-400 hover:border-gray-300 focus:outline-none focus:text-gray-700 focus:border-gray-300 transition duration-150 ease-in-out py-2 uppercase'; @endphp merge(['class' => $classes]) }}> diff --git a/resources/views/components/dropdown-link.blade.php b/resources/views/components/dropdown-link.blade.php index 42ebaf0..9e51c0c 100644 --- a/resources/views/components/dropdown-link.blade.php +++ b/resources/views/components/dropdown-link.blade.php @@ -2,8 +2,8 @@ @php $classes = ($active ?? false) - ? "block pl-4 px-4 py-2 border-l-4 text-sm border-prime-400 text-base font-medium text-gray-700 bg-gray-50 focus:outline-none focus:text-gray-800 focus:bg-gray-100 focus:border-gray-700 transition duration-150 ease-in-out" - : "block w-full px-4 py-2 text-start text-sm leading-5 text-gray-700 hover:bg-gray-100 focus:outline-none focus:bg-gray-100 transition duration-150 ease-in-out odd:bg-slate-100"; + ? "block pl-4 px-4 py-2 border-l-4 text-sm border-prime-400 text-base font-medium text-gray-700 bg-gray-50 focus:outline-none focus:text-gray-800 focus:bg-gray-100 focus:border-gray-700 transition duration-150 ease-in-out first:rounded-tr-lg last:rounded-br-lg" + : "block w-full px-4 py-2 text-start text-sm leading-5 text-gray-700 hover:bg-gray-100 focus:outline-none focus:bg-gray-100 transition duration-150 ease-in-out odd:bg-slate-100 first:rounded-t-lg last:rounded-b-lg"; @endphp merge(['class' => $classes]) }}> diff --git a/resources/views/components/hamburger-button.blade.php b/resources/views/components/hamburger-button.blade.php index 80dd7c0..532ed6d 100644 --- a/resources/views/components/hamburger-button.blade.php +++ b/resources/views/components/hamburger-button.blade.php @@ -1,6 +1,6 @@ - diff --git a/resources/views/components/logo.blade.php b/resources/views/components/logo.blade.php index b1fb16b..71d93bc 100644 --- a/resources/views/components/logo.blade.php +++ b/resources/views/components/logo.blade.php @@ -1,26 +1,13 @@ -
only(['class']) }} - x-data="{ scrolled: false }" - x-init=" - scrolled = window.pageYOffset > window.innerHeight * 0.05; - window.addEventListener('scroll', () => { - scrolled = window.pageYOffset > window.innerHeight * 0.05; - }); - "> +
only(['class']) }}> {{ config('app.name') }} @if(Navigation::isLogoSwapEnabled() && Navigation::isTransparentNavBackground()) - - + src(Navigation::getTransparencyLogo(), lazy: false) }} loading="eager" class="{{ $attributes->get('logoClass', 'w-36 md:w-64 h-auto my-auto') }}" alt="{{ $attributes->get('alt', config('app.name')) }}" /> + src(Navigation::getDefaultLogo(), lazy: false) }} loading="eager" class="{{ $attributes->get('logoClass', 'w-36 md:w-64 h-auto my-auto') }}" alt="{{ $attributes->get('alt', config('app.name')) }}" /> @else - + src(Navigation::getDefaultLogo(), lazy: false) }} loading="eager" class="{{ $attributes->get('logoClass', 'w-36 md:w-64 h-auto my-auto') }}" alt="{{ $attributes->get('alt', config('app.name')) }}" /> @endif
diff --git a/resources/views/components/mobile/mobile-dropdown.blade.php b/resources/views/components/mobile/mobile-dropdown.blade.php index 7d46d53..d4bc311 100644 --- a/resources/views/components/mobile/mobile-dropdown.blade.php +++ b/resources/views/components/mobile/mobile-dropdown.blade.php @@ -6,21 +6,19 @@ : "block w-full ps-3 pe-4 py-2 text-start text-base font-medium text-gray-900 hover:text-gray-700 hover:border-prime-400 focus:outline-none focus:text-gray-800 focus:bg-gray-50 hover:bg-slate-200 focus:border-gray-400 transition duration-150 ease-in-out border-l-4 $bgClass"; @endphp -
- +
+ -
+
@foreach($links as $link) {{ __($link['name']) }} @endforeach
- -
diff --git a/resources/views/components/navigation-scroll.blade.php b/resources/views/components/navigation-scroll.blade.php index 9a9cf57..2cab23c 100644 --- a/resources/views/components/navigation-scroll.blade.php +++ b/resources/views/components/navigation-scroll.blade.php @@ -1,10 +1,19 @@ -