Refactor and localize settings and resources
- Updated GeneralSettings page to include localized labels and structured sections for better organization. - Enhanced CarouselSlide, Category, Collection, and Product resources with localized model labels and improved form/table configurations. - Modified HomeController to utilize query builder for better performance and added collection items retrieval. - Updated views to reflect localized settings and improved layout for collections and footer. - Adjusted timezone and locale settings in app configuration for better regional support.
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
|
||||
<title>Hoşal Patisserie - Hünärmençe döredilen</title>
|
||||
<title>{{ $settings->site_title ?? 'Hoşal Patisserie' }} - Hünärmençe döredilen</title>
|
||||
<script src="{{ asset('assets/js/tailwind.min.js') }}"></script>
|
||||
<link href="{{ asset('assets/css/fonts.css') }}" rel="stylesheet"/>
|
||||
<script id="tailwind-config">
|
||||
@@ -159,7 +159,7 @@
|
||||
<div class="paper-texture"></div>
|
||||
<nav class="fixed top-0 w-full z-50 bg-surface/80 backdrop-blur-md border-b border-outline/20 transition-all duration-300 ease-in-out">
|
||||
<div class="flex justify-between items-center px-margin-mobile md:px-margin-desktop py-4 w-full z-50 max-w-[1280px] mx-auto">
|
||||
<a class="font-display-lg-mobile md:font-display-lg text-display-lg-mobile md:text-display-lg text-primary italic" href="{{ url('/') }}">Hoşal Patisserie</a>
|
||||
<a class="font-display-lg-mobile md:font-display-lg text-display-lg-mobile md:text-display-lg text-primary italic" href="{{ url('/') }}">{{ $settings->site_title ?? 'Hoşal Patisserie' }}</a>
|
||||
<div class="hidden md:flex gap-8">
|
||||
<a class="font-subheading-caps text-subheading-caps text-on-surface-variant hover:text-primary transition-colors hover:opacity-80 transition-opacity" href="#about">Biz barada</a>
|
||||
<a class="font-subheading-caps text-subheading-caps text-on-surface-variant hover:text-primary transition-colors hover:opacity-80 transition-opacity" href="#menu">Menýu</a>
|
||||
@@ -177,16 +177,20 @@
|
||||
<footer class="w-full mt-auto bg-primary-container dark:bg-tertiary-container border-t border-secondary-container/30">
|
||||
<div class="grid grid-cols-1 md:grid-cols-3 gap-gutter px-margin-mobile md:px-margin-desktop py-16 w-full max-w-[1280px] mx-auto">
|
||||
<div class="col-span-1 mb-8 md:mb-0 flex flex-col justify-between">
|
||||
<h2 class="font-display-lg-mobile md:font-display-lg text-display-lg-mobile md:text-[40px] text-surface-container-lowest italic mb-4">Hoşal Patisserie</h2>
|
||||
<h2 class="font-display-lg-mobile md:font-display-lg text-display-lg-mobile md:text-[40px] text-surface-container-lowest italic mb-4">{{ $settings->site_title ?? 'Hoşal Patisserie' }}</h2>
|
||||
<p class="font-body-md text-body-md text-surface-variant/80 mt-auto">{{ $settings->footer_copyright ?? '© 2026 Hoşal Patisserie. Hünärmençe döredilen.' }}</p>
|
||||
</div>
|
||||
<div class="col-span-1 md:col-span-2 grid grid-cols-2 md:grid-cols-3 gap-8">
|
||||
<div>
|
||||
<h3 class="font-subheading-caps text-subheading-caps text-surface-container-lowest mb-6">Gözlemek</h3>
|
||||
<ul class="space-y-4">
|
||||
<li><a class="font-body-md text-body-md text-surface-variant/80 hover:text-surface-container-lowest transition-colors duration-200" href="#about">Biz barada</a></li>
|
||||
<li><a class="font-body-md text-body-md text-surface-variant/80 hover:text-surface-container-lowest transition-colors duration-200" href="#menu">Menýu</a></li>
|
||||
</ul>
|
||||
<h3 class="font-subheading-caps text-subheading-caps text-surface-container-lowest mb-6">{{ $settings->find_us_label ?? 'Bizi tapyň' }}</h3>
|
||||
<div class="flex gap-4">
|
||||
<a href="{{ $settings->instagram_url ?? '#' }}" target="_blank" rel="noopener noreferrer" class="text-surface-variant/80 hover:text-surface-container-lowest transition-colors duration-200" aria-label="Instagram">
|
||||
<svg style="width: 44px; fill: currentColor;"xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Free v7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--><path d="M320.3 205C256.8 204.8 205.2 256.2 205 319.7C204.8 383.2 256.2 434.8 319.7 435C383.2 435.2 434.8 383.8 435 320.3C435.2 256.8 383.8 205.2 320.3 205zM319.7 245.4C360.9 245.2 394.4 278.5 394.6 319.7C394.8 360.9 361.5 394.4 320.3 394.6C279.1 394.8 245.6 361.5 245.4 320.3C245.2 279.1 278.5 245.6 319.7 245.4zM413.1 200.3C413.1 185.5 425.1 173.5 439.9 173.5C454.7 173.5 466.7 185.5 466.7 200.3C466.7 215.1 454.7 227.1 439.9 227.1C425.1 227.1 413.1 215.1 413.1 200.3zM542.8 227.5C541.1 191.6 532.9 159.8 506.6 133.6C480.4 107.4 448.6 99.2 412.7 97.4C375.7 95.3 264.8 95.3 227.8 97.4C192 99.1 160.2 107.3 133.9 133.5C107.6 159.7 99.5 191.5 97.7 227.4C95.6 264.4 95.6 375.3 97.7 412.3C99.4 448.2 107.6 480 133.9 506.2C160.2 532.4 191.9 540.6 227.8 542.4C264.8 544.5 375.7 544.5 412.7 542.4C448.6 540.7 480.4 532.5 506.6 506.2C532.8 480 541 448.2 542.8 412.3C544.9 375.3 544.9 264.5 542.8 227.5zM495 452C487.2 471.6 472.1 486.7 452.4 494.6C422.9 506.3 352.9 503.6 320.3 503.6C287.7 503.6 217.6 506.2 188.2 494.6C168.6 486.8 153.5 471.7 145.6 452C133.9 422.5 136.6 352.5 136.6 319.9C136.6 287.3 134 217.2 145.6 187.8C153.4 168.2 168.5 153.1 188.2 145.2C217.7 133.5 287.7 136.2 320.3 136.2C352.9 136.2 423 133.6 452.4 145.2C472 153 487.1 168.1 495 187.8C506.7 217.3 504 287.3 504 319.9C504 352.5 506.7 422.6 495 452z"/></svg>
|
||||
</a>
|
||||
<a href="{{ $settings->tiktok_url ?? '#' }}" target="_blank" rel="noopener noreferrer" class="text-surface-variant/80 hover:text-surface-container-lowest transition-colors duration-200" aria-label="TikTok">
|
||||
<svg style="width: 44px; fill: currentColor;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Free v7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--><path d="M544.5 273.9C500.5 274 457.5 260.3 421.7 234.7L421.7 413.4C421.7 446.5 411.6 478.8 392.7 506C373.8 533.2 347.1 554 316.1 565.6C285.1 577.2 251.3 579.1 219.2 570.9C187.1 562.7 158.3 545 136.5 520.1C114.7 495.2 101.2 464.1 97.5 431.2C93.8 398.3 100.4 365.1 116.1 336C131.8 306.9 156.1 283.3 185.7 268.3C215.3 253.3 248.6 247.8 281.4 252.3L281.4 342.2C266.4 337.5 250.3 337.6 235.4 342.6C220.5 347.6 207.5 357.2 198.4 369.9C189.3 382.6 184.4 398 184.5 413.8C184.6 429.6 189.7 444.8 199 457.5C208.3 470.2 221.4 479.6 236.4 484.4C251.4 489.2 267.5 489.2 282.4 484.3C297.3 479.4 310.4 469.9 319.6 457.2C328.8 444.5 333.8 429.1 333.8 413.4L333.8 64L421.8 64C421.7 71.4 422.4 78.9 423.7 86.2C426.8 102.5 433.1 118.1 442.4 131.9C451.7 145.7 463.7 157.5 477.6 166.5C497.5 179.6 520.8 186.6 544.6 186.6L544.6 274z"/></svg>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h3 class="font-subheading-caps text-subheading-caps text-surface-container-lowest mb-6">Goldaw</h3>
|
||||
@@ -227,17 +231,28 @@
|
||||
}, 5000);
|
||||
}
|
||||
|
||||
const collectionsContainer = document.getElementById('collections-container');
|
||||
const btnPrev = document.getElementById('btn-prev-collection');
|
||||
const btnNext = document.getElementById('btn-next-collection');
|
||||
if(btnNext && btnPrev && collectionsContainer) {
|
||||
btnNext.addEventListener('click', () => {
|
||||
collectionsContainer.scrollBy({ left: 340, behavior: 'smooth' });
|
||||
const btnPrevs = document.querySelectorAll('.btn-prev-collection');
|
||||
const btnNexts = document.querySelectorAll('.btn-next-collection');
|
||||
|
||||
btnNexts.forEach(btn => {
|
||||
btn.addEventListener('click', () => {
|
||||
const targetId = btn.getAttribute('data-target');
|
||||
const container = document.getElementById(targetId);
|
||||
if (container) {
|
||||
container.scrollBy({ left: 340, behavior: 'smooth' });
|
||||
}
|
||||
});
|
||||
btnPrev.addEventListener('click', () => {
|
||||
collectionsContainer.scrollBy({ left: -340, behavior: 'smooth' });
|
||||
});
|
||||
|
||||
btnPrevs.forEach(btn => {
|
||||
btn.addEventListener('click', () => {
|
||||
const targetId = btn.getAttribute('data-target');
|
||||
const container = document.getElementById(targetId);
|
||||
if (container) {
|
||||
container.scrollBy({ left: -340, behavior: 'smooth' });
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
@@ -37,33 +37,39 @@
|
||||
</div>
|
||||
|
||||
<section class="pt-24 px-margin-mobile md:px-margin-desktop max-w-[1440px] mx-auto bg-surface" id="collections">
|
||||
<div class="flex flex-col md:flex-row justify-between items-end mb-12 animate-on-scroll">
|
||||
<div>
|
||||
<h2 class="font-headline-md text-headline-md text-on-background mb-2">Biziň kolleksiýalarymyz</h2>
|
||||
<p class="font-body-md text-body-md text-on-surface-variant max-w-lg">Täzelikçi usullary häzirki wagt aşpezlik sungaty bilen birleşdirýän iň gowy döredilişlerimiziň saýlanan toplumy.</p>
|
||||
</div>
|
||||
<div class="flex gap-4 mt-6 md:mt-0">
|
||||
<button aria-label="Öňki" class="w-10 h-10 rounded-full border border-antique-gold flex items-center justify-center text-ink-brown hover:bg-surface-variant transition-colors" id="btn-prev-collection">
|
||||
<span class="material-symbols-outlined">arrow_left</span>
|
||||
</button>
|
||||
<button aria-label="Indiki" class="w-10 h-10 rounded-full border border-antique-gold flex items-center justify-center text-ink-brown hover:bg-surface-variant transition-colors" id="btn-next-collection">
|
||||
<span class="material-symbols-outlined">arrow_right</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex overflow-x-auto hide-scrollbar gap-6 pb-8 snap-x snap-mandatory" id="collections-container">
|
||||
@foreach($collections as $collection)
|
||||
<div class="min-w-[280px] md:min-w-[320px] aspect-[3/4] relative snap-start group cursor-pointer border border-antique-gold/40 bg-surface-container-low p-4 flex flex-col justify-end overflow-hidden">
|
||||
<div class="absolute inset-4 border border-outline/30 z-10 pointer-events-none transition-transform duration-500 group-hover:scale-95"></div>
|
||||
<div class="absolute inset-0 bg-cover bg-center transition-transform duration-700 group-hover:scale-105 opacity-80" data-alt="{{ $collection->subtitle }}" style="background-image: url('{{ $collection->image ? Storage::url($collection->image) : asset('assets/images/collection-chocolate-cake.jpg') }}');"></div>
|
||||
<div class="absolute inset-0 bg-gradient-to-t from-primary-container/90 via-primary-container/30 to-transparent"></div>
|
||||
<div class="relative z-20 p-6 text-center">
|
||||
<h3 class="font-headline-md text-headline-md text-surface-container-lowest mb-1">{{ $collection->title }}</h3>
|
||||
<p class="font-label-sm text-label-sm text-antique-gold uppercase tracking-widest">{{ $collection->subtitle ?? 'Göz gezdiriň' }}</p>
|
||||
@foreach($collections as $collection)
|
||||
<div class="mb-20">
|
||||
<div class="flex flex-col md:flex-row justify-between items-end mb-12 animate-on-scroll">
|
||||
<div>
|
||||
<h2 class="font-headline-md text-headline-md text-on-background mb-2">{{ $collection->title }}</h2>
|
||||
@if($collection->subtitle)
|
||||
<p class="font-body-md text-body-md text-on-surface-variant max-w-lg">{{ $collection->subtitle }}</p>
|
||||
@endif
|
||||
</div>
|
||||
<div class="flex gap-4 mt-6 md:mt-0">
|
||||
<button aria-label="Öňki" class="w-10 h-10 rounded-full border border-antique-gold flex items-center justify-center text-ink-brown hover:bg-surface-variant transition-colors btn-prev-collection" data-target="carousel-{{ $collection->id }}">
|
||||
<span class="material-symbols-outlined">arrow_left</span>
|
||||
</button>
|
||||
<button aria-label="Indiki" class="w-10 h-10 rounded-full border border-antique-gold flex items-center justify-center text-ink-brown hover:bg-surface-variant transition-colors btn-next-collection" data-target="carousel-{{ $collection->id }}">
|
||||
<span class="material-symbols-outlined">arrow_right</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
<div class="flex overflow-x-auto hide-scrollbar gap-6 pb-8 snap-x snap-mandatory" id="carousel-{{ $collection->id }}">
|
||||
@foreach($collection->collectionItems as $item)
|
||||
<div class="min-w-[280px] md:min-w-[320px] aspect-[3/4] relative snap-start group cursor-pointer border border-antique-gold/40 bg-surface-container-low p-4 flex flex-col justify-end overflow-hidden">
|
||||
<div class="absolute inset-4 border border-outline/30 z-10 pointer-events-none transition-transform duration-500 group-hover:scale-95"></div>
|
||||
<div class="absolute inset-0 bg-cover bg-center transition-transform duration-700 group-hover:scale-105 opacity-80" data-alt="{{ $item->subtitle }}" style="background-image: url('{{ $item->image ? Storage::url($item->image) : asset('assets/images/collection-chocolate-cake.jpg') }}');"></div>
|
||||
<div class="absolute inset-0 bg-gradient-to-t from-primary-container/90 via-primary-container/30 to-transparent"></div>
|
||||
<div class="relative z-20 p-6 text-center">
|
||||
<h3 class="font-headline-md text-headline-md text-surface-container-lowest mb-1">{{ $item->title }}</h3>
|
||||
<p class="font-label-sm text-label-sm text-antique-gold uppercase tracking-widest">{{ $item->subtitle }}</p>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</section>
|
||||
|
||||
<section class="py-16 px-margin-mobile md:px-margin-desktop max-w-container-max mx-auto bg-surface-container-low border-y border-outline/10" id="menu">
|
||||
@@ -108,7 +114,7 @@
|
||||
<div class="absolute -top-4 -left-4 w-24 h-24 border-t border-l border-ink-brown hidden md:block pointer-events-none"></div>
|
||||
</div>
|
||||
<div class="animate-on-scroll" style="transition-delay: 200ms;">
|
||||
<p class="font-label-sm text-label-sm text-antique-gold uppercase tracking-widest mb-4">Biziň mirasy</p>
|
||||
<p class="font-label-sm text-label-sm text-antique-gold uppercase tracking-widest mb-4">{{ $settings->about_label ?? 'Biziň mirasy' }}</p>
|
||||
<h2 class="font-display-lg-mobile md:font-display-lg text-display-lg-mobile md:text-display-lg text-on-background mb-8 italic">{!! nl2br(e($settings->about_title ?? "Sabyr\nsungaty")) !!}</h2>
|
||||
<div class="relative">
|
||||
<div class="absolute -left-12 -top-12 opacity-10 pointer-events-none hidden md:block">
|
||||
|
||||
Reference in New Issue
Block a user