354 lines
20 KiB
PHP
354 lines
20 KiB
PHP
@php
|
|
$products = [
|
|
[
|
|
'name' => 'Oud Royal Premium',
|
|
'category' => 'Luxury',
|
|
'price' => 1200000,
|
|
'image' => 'https://placehold.co/400x500/png?text=Oud+Royal',
|
|
'rating' => 5.0,
|
|
'reviews' => 120,
|
|
'is_new' => true,
|
|
'colors' => ['#78350f', '#1f2937'],
|
|
],
|
|
[
|
|
'name' => 'Rose Velvet',
|
|
'category' => 'Floral',
|
|
'price' => 450000,
|
|
'image' => 'https://placehold.co/400x500/png?text=Rose+Velvet',
|
|
'rating' => 4.8,
|
|
'reviews' => 85,
|
|
'is_new' => false,
|
|
'colors' => ['#be123c', '#fce7f3'],
|
|
],
|
|
[
|
|
'name' => 'Ocean Breeze',
|
|
'category' => 'Fresh',
|
|
'price' => 320000,
|
|
'image' => 'https://placehold.co/400x500/png?text=Ocean+Breeze',
|
|
'rating' => 4.9,
|
|
'reviews' => 200,
|
|
'is_new' => false,
|
|
'colors' => ['#0ea5e9', '#e0f2fe'],
|
|
],
|
|
[
|
|
'name' => 'Vanilla Sky',
|
|
'category' => 'Sweet',
|
|
'price' => 350000,
|
|
'image' => 'https://placehold.co/400x500/png?text=Vanilla+Sky',
|
|
'rating' => 4.7,
|
|
'reviews' => 150,
|
|
'is_new' => true,
|
|
'colors' => ['#d4d4d8', '#71717a'],
|
|
],
|
|
[
|
|
'name' => 'Midnight Musk',
|
|
'category' => 'Musky',
|
|
'price' => 550000,
|
|
'image' => 'https://placehold.co/400x500/png?text=Midnight+Musk',
|
|
'rating' => 4.6,
|
|
'reviews' => 90,
|
|
'is_new' => false,
|
|
'colors' => ['#1f2937', '#000000'],
|
|
],
|
|
[
|
|
'name' => 'Citrus Energy',
|
|
'category' => 'Fresh',
|
|
'price' => 280000,
|
|
'image' => 'https://placehold.co/400x500/png?text=Citrus+Energy',
|
|
'rating' => 4.5,
|
|
'reviews' => 60,
|
|
'is_new' => false,
|
|
'colors' => ['#eab308', '#fef08a'],
|
|
],
|
|
];
|
|
|
|
$recommendations = [
|
|
[
|
|
'name' => 'Golden Amber',
|
|
'category' => 'Oriental',
|
|
'price' => 890000,
|
|
'image' => 'https://placehold.co/400x500/png?text=Golden+Amber',
|
|
'rating' => 4.9,
|
|
],
|
|
[
|
|
'name' => 'Spring Blossom',
|
|
'category' => 'Floral',
|
|
'price' => 380000,
|
|
'image' => 'https://placehold.co/400x500/png?text=Spring+Blossom',
|
|
'rating' => 4.7,
|
|
],
|
|
[
|
|
'name' => 'Woody Intense',
|
|
'category' => 'Woody',
|
|
'price' => 650000,
|
|
'image' => 'https://placehold.co/400x500/png?text=Woody+Intense',
|
|
'rating' => 4.8,
|
|
],
|
|
[
|
|
'name' => 'Aqua Marine',
|
|
'category' => 'Fresh',
|
|
'price' => 420000,
|
|
'image' => 'https://placehold.co/400x500/png?text=Aqua+Marine',
|
|
'rating' => 4.6,
|
|
],
|
|
[
|
|
'name' => 'Spicy Leather',
|
|
'category' => 'Leather',
|
|
'price' => 750000,
|
|
'image' => 'https://placehold.co/400x500/png?text=Spicy+Leather',
|
|
'rating' => 4.9,
|
|
],
|
|
];
|
|
@endphp
|
|
|
|
<div class="flex flex-col min-h-screen bg-white font-sans">
|
|
|
|
<main class="flex-grow px-6 lg:px-32 xl:px-48 pb-24 pt-36">
|
|
<header class="mb-12">
|
|
<h1 class="text-3xl md:text-4xl font-bold text-home-primary mb-3">Koleksi Parfum</h1>
|
|
<p class="text-home-foreground/60 text-lg max-w-2xl">Temukan aroma khas yang mencerminkan kepribadian dan
|
|
gaya Anda.</p>
|
|
</header>
|
|
|
|
<div class="grid grid-cols-1 lg:grid-cols-4 gap-12 mb-24">
|
|
|
|
<aside class="hidden lg:block lg:col-span-1 space-y-8">
|
|
<div class="bg-white rounded-2xl border border-home-foreground/10 p-6 shadow-sm sticky top-32">
|
|
<h3 class="font-bold text-home-primary mb-6 border-b border-home-foreground/10 pb-4">Kategori</h3>
|
|
<div class="space-y-4">
|
|
@foreach (['Pria', 'Wanita', 'Unisex', 'Luxury', 'Best Seller', 'New Arrival'] as $cat)
|
|
<label class="flex items-center cursor-pointer group">
|
|
<input type="checkbox"
|
|
class="w-5 h-5 rounded border-home-foreground/20 text-home-primary focus:ring-home-primary cursor-pointer accent-home-primary">
|
|
<span
|
|
class="ml-3 text-home-foreground/70 group-hover:text-home-primary transition-colors text-sm font-medium">{{ $cat }}</span>
|
|
</label>
|
|
@endforeach
|
|
</div>
|
|
|
|
<div class="border-t border-home-foreground/10 my-8"></div>
|
|
|
|
<h3 class="font-bold text-home-primary mb-6 border-b border-home-foreground/10 pb-4">Harga</h3>
|
|
<div class="space-y-4">
|
|
@foreach (['< 100k', '100k - 500k', '500k - 1jt', '> 1jt'] as $price)
|
|
<label class="flex items-center cursor-pointer group">
|
|
<input type="radio" name="price"
|
|
class="w-5 h-5 border-home-foreground/20 text-home-primary focus:ring-home-primary cursor-pointer accent-home-primary">
|
|
<span
|
|
class="ml-3 text-home-foreground/70 group-hover:text-home-primary transition-colors text-sm font-medium">{{ $price }}</span>
|
|
</label>
|
|
@endforeach
|
|
</div>
|
|
</div>
|
|
</aside>
|
|
|
|
<section class="lg:col-span-3">
|
|
|
|
<div class="flex flex-col sm:flex-row gap-4 mb-8">
|
|
<div class="flex-1 relative group">
|
|
<svg class="absolute left-4 top-3.5 w-5 h-5 text-home-primary/50 group-focus-within:text-home-primary transition-colors"
|
|
fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
|
d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"></path>
|
|
</svg>
|
|
<input type="text" placeholder="Cari produk..."
|
|
class="w-full pl-11 pr-4 py-3 rounded-xl border border-home-foreground/10 focus:outline-none focus:ring-2 focus:ring-home-primary focus:border-transparent transition shadow-sm placeholder-home-foreground/40 text-home-foreground bg-white">
|
|
</div>
|
|
<div class="relative min-w-[200px]">
|
|
<select
|
|
class="w-full appearance-none px-6 py-3 pr-10 rounded-xl border border-home-foreground/10 bg-white text-home-foreground font-medium focus:outline-none focus:ring-2 focus:ring-home-primary focus:border-transparent transition cursor-pointer shadow-sm">
|
|
<option>Urutkan: Terbaru</option>
|
|
<option>Harga Terendah</option>
|
|
<option>Harga Tertinggi</option>
|
|
<option>Terpopuler</option>
|
|
</select>
|
|
<svg class="absolute right-4 top-4 w-4 h-4 text-home-foreground/50 pointer-events-none"
|
|
fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7">
|
|
</path>
|
|
</svg>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-8">
|
|
@foreach ($products as $item)
|
|
<article
|
|
class="group bg-white rounded-2xl border border-home-foreground/10 overflow-hidden hover:shadow-xl hover:shadow-home-primary/5 hover:border-home-primary/30 hover:-translate-y-1 transition-all duration-300 flex flex-col h-full relative">
|
|
|
|
@if ($item['is_new'])
|
|
<span
|
|
class="absolute top-4 left-4 bg-home-primary text-white text-[10px] uppercase tracking-wider font-bold px-3 py-1 rounded-full z-10 shadow-md">New</span>
|
|
@endif
|
|
|
|
<div class="relative h-72 overflow-hidden bg-home-primary/5">
|
|
<img src="{{ $item['image'] }}" alt="{{ $item['name'] }}"
|
|
class="w-full h-full object-cover group-hover:scale-105 transition-transform duration-500">
|
|
|
|
<div
|
|
class="absolute inset-0 bg-black/20 opacity-0 group-hover:opacity-100 transition-opacity duration-300 flex items-center justify-center gap-3">
|
|
<a href="#"
|
|
class="w-10 h-10 bg-white rounded-full flex items-center justify-center text-home-foreground hover:bg-home-primary hover:text-white transition-all shadow-lg transform hover:scale-110"
|
|
title="Lihat Detail">
|
|
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
|
d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path>
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
|
d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z">
|
|
</path>
|
|
</svg>
|
|
</a>
|
|
<button
|
|
class="w-10 h-10 bg-white rounded-full flex items-center justify-center text-home-foreground hover:bg-home-primary hover:text-white transition-all shadow-lg transform hover:scale-110"
|
|
title="Simpan ke Wishlist">
|
|
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
|
d="M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z">
|
|
</path>
|
|
</svg>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="p-5 flex flex-col flex-grow">
|
|
<div class="flex justify-between items-start mb-2">
|
|
<span
|
|
class="text-[10px] font-bold tracking-widest text-home-primary uppercase bg-home-primary/10 px-2 py-1 rounded">{{ $item['category'] }}</span>
|
|
<div class="flex items-center gap-1">
|
|
<svg class="w-3 h-3 text-yellow-400" fill="currentColor" viewBox="0 0 20 20">
|
|
<path
|
|
d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" />
|
|
</svg>
|
|
<span
|
|
class="text-xs font-bold text-home-foreground">{{ $item['rating'] }}</span>
|
|
<span class="text-xs text-home-foreground/40">({{ $item['reviews'] }})</span>
|
|
</div>
|
|
</div>
|
|
|
|
<h3
|
|
class="text-lg font-bold text-home-foreground group-hover:text-home-primary transition-colors mb-4 line-clamp-1">
|
|
{{ $item['name'] }}</h3>
|
|
|
|
<div
|
|
class="mt-auto pt-4 border-t border-home-foreground/5 flex items-center justify-between">
|
|
<span class="text-xl font-bold text-home-primary">Rp
|
|
{{ number_format($item['price'], 0, ',', '.') }}</span>
|
|
<button
|
|
class="w-10 h-10 rounded-lg bg-home-foreground text-white flex items-center justify-center hover:bg-home-primary transition-colors shadow-md">
|
|
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
|
d="M12 4v16m8-8H4"></path>
|
|
</svg>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</article>
|
|
@endforeach
|
|
</div>
|
|
|
|
<div class="mt-16 flex justify-center">
|
|
<nav class="flex items-center gap-2">
|
|
<button
|
|
class="w-10 h-10 flex items-center justify-center rounded-full border border-home-foreground/10 text-home-foreground/30 cursor-not-allowed hover:bg-transparent">
|
|
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
|
d="M15 19l-7-7 7-7"></path>
|
|
</svg>
|
|
</button>
|
|
<button
|
|
class="w-10 h-10 flex items-center justify-center rounded-full bg-home-primary text-white font-bold shadow-lg shadow-home-primary/20 transition-all">1</button>
|
|
<button
|
|
class="w-10 h-10 flex items-center justify-center rounded-full text-home-foreground hover:bg-home-primary/5 transition-all font-medium">2</button>
|
|
<button
|
|
class="w-10 h-10 flex items-center justify-center rounded-full text-home-foreground hover:bg-home-primary/5 transition-all font-medium">3</button>
|
|
<span class="w-10 h-10 flex items-center justify-center text-home-foreground/40">...</span>
|
|
<button
|
|
class="w-10 h-10 flex items-center justify-center rounded-full border border-home-foreground/10 text-home-foreground hover:border-home-primary hover:text-home-primary transition-all">
|
|
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
|
d="M9 5l7 7-7 7"></path>
|
|
</svg>
|
|
</button>
|
|
</nav>
|
|
</div>
|
|
</section>
|
|
</div>
|
|
|
|
<section class="mt-24 pt-16 border-t border-home-foreground/10">
|
|
<div class="flex items-center justify-between mb-12">
|
|
<h2 class="text-2xl md:text-3xl font-bold text-home-primary">Mungkin Anda Suka</h2>
|
|
<div class="flex gap-3">
|
|
<button id="slideLeft"
|
|
class="w-12 h-12 rounded-full border border-home-foreground/10 flex items-center justify-center text-home-foreground hover:bg-home-primary hover:text-white hover:border-home-primary transition-all shadow-sm">
|
|
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
|
d="M15 19l-7-7 7-7"></path>
|
|
</svg>
|
|
</button>
|
|
<button id="slideRight"
|
|
class="w-12 h-12 rounded-full border border-home-foreground/10 flex items-center justify-center text-home-foreground hover:bg-home-primary hover:text-white hover:border-home-primary transition-all shadow-sm">
|
|
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7">
|
|
</path>
|
|
</svg>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="productSlider"
|
|
class="flex gap-6 overflow-x-auto pb-12 snap-x snap-mandatory scroll-smooth hide-scrollbar"
|
|
style="scrollbar-width: none; -ms-overflow-style: none;">
|
|
@foreach ($recommendations as $rec)
|
|
<article
|
|
class="min-w-[280px] md:min-w-[300px] bg-white rounded-2xl border border-home-foreground/10 overflow-hidden hover:shadow-xl hover:border-home-primary/30 transition-all duration-300 snap-start group flex flex-col h-full">
|
|
<div class="h-60 overflow-hidden relative bg-home-primary/5">
|
|
<img src="{{ $rec['image'] }}" alt="{{ $rec['name'] }}"
|
|
class="w-full h-full object-cover group-hover:scale-105 transition-transform duration-500">
|
|
</div>
|
|
<div class="p-5 flex flex-col flex-grow">
|
|
<div class="text-[10px] font-bold tracking-widest text-home-primary uppercase mb-2">
|
|
{{ $rec['category'] }}</div>
|
|
<h3 class="text-lg font-bold text-home-foreground mb-1">{{ $rec['name'] }}</h3>
|
|
<div class="mt-auto pt-4 flex items-center justify-between">
|
|
<span class="font-bold text-home-primary">Rp
|
|
{{ number_format($rec['price'], 0, ',', '.') }}</span>
|
|
<button
|
|
class="w-8 h-8 rounded bg-home-foreground/5 text-home-foreground hover:bg-home-primary hover:text-white flex items-center justify-center transition-colors">
|
|
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
|
d="M12 4v16m8-8H4"></path>
|
|
</svg>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</article>
|
|
@endforeach
|
|
</div>
|
|
</section>
|
|
|
|
</main>
|
|
</div>
|
|
|
|
<script>
|
|
document.addEventListener("DOMContentLoaded", () => {
|
|
const slider = document.getElementById('productSlider');
|
|
const leftBtn = document.getElementById('slideLeft');
|
|
const rightBtn = document.getElementById('slideRight');
|
|
|
|
if (slider && leftBtn && rightBtn) {
|
|
rightBtn.addEventListener('click', () => {
|
|
slider.scrollBy({
|
|
left: 320,
|
|
behavior: 'smooth'
|
|
});
|
|
});
|
|
|
|
leftBtn.addEventListener('click', () => {
|
|
slider.scrollBy({
|
|
left: -320,
|
|
behavior: 'smooth'
|
|
});
|
|
});
|
|
}
|
|
});
|
|
</script>
|