Enhance category and timeline entry forms with icon selection options; update image display settings for hero slides, products, and signature items to use circular images. Improve welcome page layout for better responsiveness and add autoplay functionality to the hero carousel.
This commit is contained in:
1 parent
24b8539e98
commit
f73035593e
6 files changed
+54
-11
No files matched your search
@@ -9,6 +9,7 @@
|
|||||||
use Filament\Actions\DeleteAction;
|
use Filament\Actions\DeleteAction;
|
||||||
use Filament\Actions\DeleteBulkAction;
|
use Filament\Actions\DeleteBulkAction;
|
||||||
use Filament\Actions\EditAction;
|
use Filament\Actions\EditAction;
|
||||||
|
use Filament\Forms\Components\Select;
|
||||||
use Filament\Forms\Components\TextInput;
|
use Filament\Forms\Components\TextInput;
|
||||||
use Filament\Forms\Components\Toggle;
|
use Filament\Forms\Components\Toggle;
|
||||||
use Filament\Resources\Resource;
|
use Filament\Resources\Resource;
|
||||||
@@ -42,11 +43,24 @@ public static function form(Schema $schema): Schema
|
|||||||
->label('Slug')
|
->label('Slug')
|
||||||
->required()
|
->required()
|
||||||
->unique(ignoreRecord: true),
|
->unique(ignoreRecord: true),
|
||||||
TextInput::make('icon')
|
Select::make('icon')
|
||||||
->label('Material Symbol ikony')
|
->label('Ikony (Material Symbol)')
|
||||||
->required()
|
->required()
|
||||||
->default('category')
|
->default('category')
|
||||||
->placeholder('set_meal'),
|
->options([
|
||||||
|
'set_meal' => 'set_meal — Nahar toplum',
|
||||||
|
'cruelty_free' => 'cruelty_free — Goýun eti',
|
||||||
|
'kebab_dining' => 'kebab_dining — Kebab / Goş',
|
||||||
|
'egg' => 'egg — Guş eti',
|
||||||
|
'local_pizza' => 'local_pizza — Kolbasalar',
|
||||||
|
'lunch_dining' => 'lunch_dining — Et tagamy',
|
||||||
|
'outdoor_grill' => 'outdoor_grill — Grill',
|
||||||
|
'restaurant_menu' => 'restaurant_menu — Menýu',
|
||||||
|
'food_bank' => 'food_bank — Azyk ammar',
|
||||||
|
'category' => 'category — Kategoriýa',
|
||||||
|
'bakery_dining' => 'bakery_dining — Çörek',
|
||||||
|
'fastfood' => 'fastfood — Çalt nahar',
|
||||||
|
]),
|
||||||
TextInput::make('sort_order')
|
TextInput::make('sort_order')
|
||||||
->label('Tertip')
|
->label('Tertip')
|
||||||
->required()
|
->required()
|
||||||
|
|||||||
@@ -73,7 +73,8 @@ public static function table(Table $table): Table
|
|||||||
->columns([
|
->columns([
|
||||||
ImageColumn::make('image')
|
ImageColumn::make('image')
|
||||||
->label('Surat')
|
->label('Surat')
|
||||||
->square(),
|
->disk('public')
|
||||||
|
->circular(),
|
||||||
TextColumn::make('headline')
|
TextColumn::make('headline')
|
||||||
->label('Sözbaşy')
|
->label('Sözbaşy')
|
||||||
->searchable()
|
->searchable()
|
||||||
|
|||||||
@@ -98,7 +98,9 @@ public static function table(Table $table): Table
|
|||||||
->columns([
|
->columns([
|
||||||
ImageColumn::make('image')
|
ImageColumn::make('image')
|
||||||
->label('Surat')
|
->label('Surat')
|
||||||
->square(),
|
->disk('public')
|
||||||
|
->circular(),
|
||||||
|
|
||||||
TextColumn::make('name')
|
TextColumn::make('name')
|
||||||
->label('Ady')
|
->label('Ady')
|
||||||
->searchable(),
|
->searchable(),
|
||||||
|
|||||||
@@ -76,7 +76,8 @@ public static function table(Table $table): Table
|
|||||||
->columns([
|
->columns([
|
||||||
ImageColumn::make('image')
|
ImageColumn::make('image')
|
||||||
->label('Surat')
|
->label('Surat')
|
||||||
->square(),
|
->disk('public')
|
||||||
|
->circular(),
|
||||||
TextColumn::make('name')
|
TextColumn::make('name')
|
||||||
->label('Ady')
|
->label('Ady')
|
||||||
->searchable(),
|
->searchable(),
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
use Filament\Actions\DeleteAction;
|
use Filament\Actions\DeleteAction;
|
||||||
use Filament\Actions\DeleteBulkAction;
|
use Filament\Actions\DeleteBulkAction;
|
||||||
use Filament\Actions\EditAction;
|
use Filament\Actions\EditAction;
|
||||||
|
use Filament\Forms\Components\Select;
|
||||||
use Filament\Forms\Components\Textarea;
|
use Filament\Forms\Components\Textarea;
|
||||||
use Filament\Forms\Components\TextInput;
|
use Filament\Forms\Components\TextInput;
|
||||||
use Filament\Resources\Resource;
|
use Filament\Resources\Resource;
|
||||||
@@ -42,11 +43,24 @@ public static function form(Schema $schema): Schema
|
|||||||
TextInput::make('title')
|
TextInput::make('title')
|
||||||
->label('Başlyk')
|
->label('Başlyk')
|
||||||
->required(),
|
->required(),
|
||||||
TextInput::make('icon')
|
Select::make('icon')
|
||||||
->label('Material Symbol ikony')
|
->label('Ikony (Material Symbol)')
|
||||||
->required()
|
->required()
|
||||||
->default('history')
|
->default('history')
|
||||||
->placeholder('storefront'),
|
->options([
|
||||||
|
'storefront' => 'storefront — Dükançasy',
|
||||||
|
'outdoor_grill' => 'outdoor_grill — Tüsse otagy',
|
||||||
|
'local_shipping' => 'local_shipping — Eltip bermek',
|
||||||
|
'menu_book' => 'menu_book — Resept kitaby',
|
||||||
|
'history' => 'history — Taryh',
|
||||||
|
'star' => 'star — Ýyldyz',
|
||||||
|
'emoji_events' => 'emoji_events — Baýrak',
|
||||||
|
'workspace_premium' => 'workspace_premium — Premium',
|
||||||
|
'factory' => 'factory — Zawod',
|
||||||
|
'engineering' => 'engineering — Inžinerlik',
|
||||||
|
'handyman' => 'handyman — Usta',
|
||||||
|
'lightbulb' => 'lightbulb — Täze pikir',
|
||||||
|
]),
|
||||||
TextInput::make('sort_order')
|
TextInput::make('sort_order')
|
||||||
->label('Tertip')
|
->label('Tertip')
|
||||||
->required()
|
->required()
|
||||||
|
|||||||
@@ -193,9 +193,9 @@ class="category-products py-12 px-margin-mobile md:px-margin-desktop {{ $loop->f
|
|||||||
Biziň aýratynlyklarymyz
|
Biziň aýratynlyklarymyz
|
||||||
<div class="absolute -bottom-4 left-0 w-full h-[2px] bg-outline-variant sketch-border"></div>
|
<div class="absolute -bottom-4 left-0 w-full h-[2px] bg-outline-variant sketch-border"></div>
|
||||||
</h2>
|
</h2>
|
||||||
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-8 mt-4">
|
<div class="flex overflow-x-auto hide-scrollbar gap-8 pb-12 pr-margin-mobile md:pr-margin-desktop snap-x snap-mandatory">
|
||||||
@foreach($signatureItems as $item)
|
@foreach($signatureItems as $item)
|
||||||
<article class="flex flex-col gap-4 relative group">
|
<article class="flex-shrink-0 w-[85vw] md:w-[350px] snap-center flex flex-col gap-4 relative group">
|
||||||
<div class="h-[160px] w-full relative sketch-border bg-surface-container overflow-hidden">
|
<div class="h-[160px] w-full relative sketch-border bg-surface-container overflow-hidden">
|
||||||
@if($item->image)
|
@if($item->image)
|
||||||
<img alt="{{ $item->name }}" class="w-full h-full object-cover group-hover:scale-105 transition-transform duration-500 sepia-[.3]" src="{{ Storage::url($item->image) }}"/>
|
<img alt="{{ $item->name }}" class="w-full h-full object-cover group-hover:scale-105 transition-transform duration-500 sepia-[.3]" src="{{ Storage::url($item->image) }}"/>
|
||||||
@@ -360,11 +360,22 @@ function updateCarousel() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Autoplay — advances every 5 seconds, stops on manual interaction
|
||||||
|
let heroAutoplay = setInterval(() => {
|
||||||
|
currentSlide = (currentSlide + 1) % totalSlides;
|
||||||
|
updateCarousel();
|
||||||
|
}, 5000);
|
||||||
|
|
||||||
|
[prevBtn, nextBtn].forEach((btn) => {
|
||||||
|
btn?.addEventListener('click', () => clearInterval(heroAutoplay));
|
||||||
|
});
|
||||||
|
|
||||||
// Swipe logic for hero
|
// Swipe logic for hero
|
||||||
let startX;
|
let startX;
|
||||||
if (heroCarousel) {
|
if (heroCarousel) {
|
||||||
heroCarousel.addEventListener('touchstart', (e) => {
|
heroCarousel.addEventListener('touchstart', (e) => {
|
||||||
startX = e.touches[0].clientX;
|
startX = e.touches[0].clientX;
|
||||||
|
clearInterval(heroAutoplay);
|
||||||
}, { passive: true });
|
}, { passive: true });
|
||||||
|
|
||||||
heroCarousel.addEventListener('touchend', (e) => {
|
heroCarousel.addEventListener('touchend', (e) => {
|
||||||
|
|||||||
Reference in new issue
Block a user