<?phpuse Livewire\Attributes\Computed;use Livewire\Component;new class extends Component { #[Computed] public function cartItems(): array { return [ ['name' => 'Oryn QuietForm 40 Adaptive Noise-Cancelling Headphones', 'image' => 'sky-blue', 'color' => 'Sky blue', 'price' => '$160.99'], ['name' => 'Vela Audio Studio N7 Premium Wireless Over-Ear Headphones', 'image' => 'red', 'color' => 'Red', 'price' => '$248.99'], ]; } #[Computed] public function colors(): array { return ['Black' => '#27272a', 'Silver' => '#d4d4d8', 'Blue' => '#3b82f6', 'Gold' => '#b59410', 'Lilac' => '#e7c3ef']; } #[Computed] public function plans(): array { return ['No protection' => '$0.00', '1-Year plan' => '$9.99', '2-Year plan' => '$14.99']; } #[Computed] public function features(): array { return [ ['icon' => 'sparkles', 'title' => 'Adaptive noise cancellation', 'body' => 'Advanced noise-cancelling technology continuously reduces distracting background sounds so you can focus more clearly on what you are listening to. It is especially effective against consistent noises such as traffic, aircraft engines, office ventilation, and the general hum of busy public spaces. When you need to stay aware of your surroundings, transparency mode lets outside sound in without requiring you to remove the headphones.'], ['icon' => 'speaker-wave', 'title' => 'Rich, balanced sound', 'body' => 'Custom-tuned drivers deliver clear vocals, detailed highs, and deep, controlled bass across a wide range of music and entertainment. The balanced sound profile remains natural and consistent at both low and high volumes.'], ['icon' => 'battery-100', 'title' => 'Up to 40 hours of battery life', 'body' => 'Enjoy up to 40 hours of wireless listening on a single charge. USB-C fast charging provides several additional hours of playback after just a short charge.'], ['icon' => 'play-pause', 'title' => 'All-day comfort', 'body' => 'Soft memory-foam ear cushions gently surround the ears, while the adjustable headband provides a secure and comfortable fit. The lightweight design helps reduce fatigue during longer listening sessions.'], ['icon' => 'microphone', 'title' => 'Clearer calls', 'body' => 'Built-in microphones use noise reduction to keep your voice clear during calls and online meetings. Voice controls let you manage calls, playback, and compatible assistants without reaching for your device.'], ['icon' => 'device-phone-mobile', 'title' => 'Seamless device switching', 'body' => 'Connect to two compatible Bluetooth devices at the same time and move between them effortlessly. Answer a call on your phone, then return to audio on your laptop without reconnecting manually.'], ['icon' => 'adjustments-vertical', 'title' => 'Simple, intuitive controls', 'body' => 'Physical buttons provide quick access to playback, volume, calls, noise cancellation, and voice assistance. Additional sound and control preferences can be adjusted through the companion app.'], ]; } #[Computed] public function specifications(): array { return [ 'SKU' => 'NH6P-BLK-001', 'Brand' => 'Noren', 'Model' => 'H6 Pro Wireless Over-Ear Headphones', 'Headphone type' => 'Closed-back wireless headphones with optional wired listening', 'Product dimensions' => '7.7 × 6.5 × 3.2 in / 19.6 × 16.5 × 8.1 cm', 'Sound profile' => 'Balanced tuning with enhanced bass, clear vocals and detailed highs', 'Noise control' => 'Adaptive active noise cancellation with adjustable transparency mode', 'Listening modes' => 'Noise Cancelling, Transparency, Standard', 'Microphones' => '5 built-in microphones for calls, noise cancellation and voice pickup', 'Call features' => 'Voice isolation, beamforming microphones and wind-noise reduction', 'Wireless connection' => 'Bluetooth 5.3 with multipoint pairing and automatic reconnection', 'Bluetooth range' => 'Up to 33 ft / 10 m in open indoor environments', 'Multipoint connection' => 'Up to 2 devices', 'Supported devices' => 'Compatible with iOS, Android, macOS and Windows devices', 'Audio codecs' => 'SBC and AAC', 'Battery life' => 'Up to 40 hours', 'Battery with ANC' => 'Up to 30 hours', 'Charging time' => 'Approximately 2 hours for full charge; 10 minutes for up to 7 hours of playback', 'Charging connection' => 'USB-C', 'Warranty' => '2-year limited warranty covering manufacturing defects', 'Included accessories' => 'Headphones, USB-C charging cable, 3.5 mm audio cable, carrying pouch and quick-start guide', ]; } #[Computed] public function ratings(): array { return [5 => 84, 4 => 7, 3 => 3, 2 => 2, 1 => 3]; } #[Computed] public function reviewSummary(): array { return [ 'Users like about the product' => ['Easy device switching', 'Long battery life', 'Comfortable for extended wear', 'Clear and balanced sound', 'Deep bass', 'Effective noise cancellation', 'Quick and reliable pairing'], 'Users don’t like about the product' => ['Bulky for travel', 'Earcups feel warm', 'Limited controls', 'Weak wind reduction', 'App required'], ]; } #[Computed] public function reviews(): array { return [ ['name' => 'Daniel R.', 'avatar' => 'daniel-r.jpg', 'date' => 'Jul 12, 2026', 'rating' => 5, 'title' => 'Comfortable, reliable, and great for everyday use', 'body' => 'Very comfortable and surprisingly lightweight, even after wearing them for several hours at a time. Pairing was quick, and switching between my laptop and phone works smoothly without having to reconnect everything manually. The sound is clear and detailed, with plenty of bass but not so much that it overpowers vocals. Battery life has also been excellent - I only need to charge them every few days with regular use. The controls are easy to understand, the connection stays stable around the house, and the overall build feels solid. Definitely recommend them for everyday listening, work, and travel.', 'helpful' => 7, 'unhelpful' => 0, 'recommends' => true], ['name' => 'Jerry A.', 'avatar' => 'jerry-a.jpg', 'date' => 'Jul 11, 2026', 'rating' => 5, 'title' => 'Excellent noise cancellation!', 'body' => 'I have been using these headphones every day for work calls, music, podcasts, and the occasional movie, and they have been great so far. The ear cushions are soft and remain comfortable throughout most of the day without putting too much pressure on my head. Noise cancellation does a very good job of reducing office chatter, traffic, and other background sounds. Setup was simple, and they connected to both my phone and laptop within a few minutes. Call quality is clear, the battery lasts longer than I expected, and the headphones feel premium without being overly heavy. Very happy with this purchase.', 'helpful' => 4, 'unhelpful' => 0, 'recommends' => true], ['name' => 'Lucas Bennet', 'avatar' => 'lucas-bennet.jpg', 'date' => 'Jul 7, 2026', 'rating' => 4, 'title' => 'Great sound with slightly confusing controls', 'body' => 'Sound quality is excellent, and the battery life has been better than expected. They fit securely and remain comfortable during longer listening sessions. My only complaint is that the controls take some time to get used to, but otherwise they are a great pair of headphones.', 'helpful' => 3, 'unhelpful' => 1, 'recommends' => true], ['name' => 'Mark W.', 'avatar' => 'mark-w.jpg', 'date' => 'Jul 4, 2026', 'rating' => 3, 'title' => 'Good audio, but comfort could be better', 'body' => 'The headphones sound good and connect reliably, but the overall experience has been a little mixed. Music and podcasts are clear, and the noise cancellation works well with steady sounds such as fans, engines, and traffic. However, voices and sudden noises still come through more than I expected. The fit is comfortable at first, but the headband starts to feel tight after wearing them for more than a couple of hours. The microphone is fine for casual calls, although it can pick up background noise in busier environments. Battery life is good and the design looks nice, but at this price I expected slightly better comfort and noise cancellation. A decent option, but there is room for improvement.', 'helpful' => 2, 'unhelpful' => 0, 'recommends' => false], ]; } #[Computed] public function similar(): array { return [ ['brand' => 'Vela Audio', 'name' => 'Studio N7 Premium Wireless Over-Ear Headphones', 'image' => 'red', 'rating' => 4.6, 'reviews' => 185, 'price' => '$248.99'], ['brand' => 'Oryn', 'name' => 'QuietForm 40 Adaptive Noise-Cancelling Headphones', 'image' => 'sky-blue', 'rating' => 4.7, 'reviews' => 157, 'price' => '$160.99'], ['brand' => 'Sona', 'name' => 'Horizon ANC Everyday Wireless Over-Ear Headphones', 'image' => 'lavender', 'rating' => 4.2, 'reviews' => 126, 'price' => '$119.99'], ['brand' => 'Eiden Audio', 'name' => 'Forma X5 Studio Wireless Over-Ear Noise-Cancelling Headphones', 'image' => 'midnight', 'rating' => 4.4, 'reviews' => 101, 'price' => '$185.99'], ]; }};?>{{-- This standalone demo keeps its store header inline. In a production app, move the header into your storefront layout. --}}<div class="min-h-dvh bg-white dark:bg-zinc-950"> <header class="bg-zinc-50 dark:bg-zinc-900"> <div class="flex h-11 items-center justify-between gap-4 bg-zinc-950 px-4 text-sm font-medium text-white/70 sm:px-6 lg:px-12 dark:bg-white dark:text-zinc-500"> <div class="flex items-center gap-2"> <flux:icon.tag variant="mini" /> App Exclusive · Save 10% </div> <div class="flex items-center gap-6"> <a href="#" class="flex items-center gap-2 hover:text-white dark:hover:text-zinc-800"> <flux:icon.map-pin variant="mini" /> <span class="max-sm:sr-only">Locations</span> </a> <a href="#" class="flex items-center gap-2 hover:text-white dark:hover:text-zinc-800"> <flux:icon.chat-bubble-left-right variant="mini" /> <span class="max-sm:sr-only">Help</span> </a> </div> </div> <div class="flex h-18 items-center gap-4 border-b border-zinc-200 px-4 sm:gap-8 sm:px-6 lg:px-12 dark:border-white/10"> <flux:brand href="#" logo="https://fluxui.dev/img/demos/shop/logo.svg" logo:dark="https://fluxui.dev/img/demos/shop/logo-dark.svg" name="AURAL" alt="Aural" class="max-sm:hidden" /> <flux:brand href="#" logo="https://fluxui.dev/img/demos/shop/logo.svg" logo:dark="https://fluxui.dev/img/demos/shop/logo-dark.svg" alt="Aural" class="sm:hidden" /> <flux:input icon="magnifying-glass" value="wireless headphones" clearable placeholder="Search products" aria-label="Search products" class="max-w-lg" /> <div class="ms-auto flex items-center gap-4"> <flux:dropdown align="end"> <flux:avatar as="button" src="https://fluxui.dev/img/demos/shop/avatar.jpg" name="Liam Carter" size="sm" circle aria-label="Account menu" /> <flux:menu> <flux:menu.item icon="user">Account</flux:menu.item> <flux:menu.item icon="list-bullet">My orders</flux:menu.item> <flux:menu.item icon="heart">Wishlist</flux:menu.item> <flux:menu.separator /> <flux:menu.item icon="arrow-right-start-on-rectangle">Logout</flux:menu.item> </flux:menu> </flux:dropdown> <flux:separator vertical class="my-2 max-sm:hidden" /> <flux:navbar class="-me-2"> <flux:dropdown align="end"> <flux:navbar.item icon="shopping-bag" badge="2" aria-label="Shopping cart" /> <flux:popover class="flex w-80 flex-col gap-4 sm:w-md"> <flux:heading size="lg">Shopping cart</flux:heading> @foreach ($this->cartItems as $item) <flux:separator variant="subtle" /> <div class="flex gap-4"> <div class="flex size-20 shrink-0 items-center justify-center rounded-lg border border-zinc-200 bg-white dark:border-white/10 dark:bg-white/5"> <img src="https://fluxui.dev/img/demos/shop/{{ $item['image'] }}.webp" alt="" class="size-16"> </div> <div class="flex min-w-0 flex-1 flex-col gap-2"> <div class="flex justify-between gap-4"> <flux:heading>{{ $item['name'] }}</flux:heading> <flux:heading>{{ $item['price'] }}</flux:heading> </div> <div class="flex items-center gap-2"> <flux:text>{{ $item['color'] }}</flux:text> <flux:badge color="green" size="sm">In stock</flux:badge> </div> <div class="flex flex-wrap items-center justify-between gap-2"> <div class="-ms-2 flex gap-2"> <flux:button variant="subtle" size="sm" icon="bookmark" class="max-sm:hidden">Save for later</flux:button> <flux:button variant="subtle" size="sm" icon="trash">Remove</flux:button> </div> <div class="w-24"> <flux:input.group> <flux:button size="sm" icon="minus" aria-label="Decrease quantity" /> <flux:input size="sm" value="1" readonly aria-label="Quantity" class:input="text-center" /> <flux:button size="sm" icon="plus" aria-label="Increase quantity" /> </flux:input.group> </div> </div> </div> </div> @endforeach <flux:separator variant="subtle" /> <div class="space-y-2"> <div class="flex justify-between"><flux:heading>Subtotal</flux:heading> <flux:heading>$409.98</flux:heading></div> <div class="flex justify-between"><flux:text>Shipping</flux:text> <flux:text>$5.99</flux:text></div> <div class="flex justify-between"><flux:text>Taxes</flux:text> <flux:text>Calculated at checkout</flux:text></div> </div> <flux:separator variant="subtle" /> <div class="flex justify-between"><flux:heading>Estimated total</flux:heading> <flux:heading>$415.97</flux:heading></div> </flux:popover> </flux:dropdown> </flux:navbar> </div> </div> <div class="flex items-center justify-between gap-8 border-b border-zinc-200 px-4 sm:px-6 lg:px-12 dark:border-white/10"> <flux:navbar scrollable aria-label="Categories" class="-ms-3"> @foreach (['All', 'Headphones', 'Earbuds', 'Speakers', 'Soundbars', 'Turntables', 'Amplifiers', 'Accessories', 'Other', 'Deals'] as $category) <flux:navbar.item href="#">{{ $category }}</flux:navbar.item> @endforeach </flux:navbar> <flux:navbar class="-me-3 max-md:hidden"> <flux:navbar.item icon="list-bullet" href="#">My orders</flux:navbar.item> <flux:navbar.item icon="heart" href="#">Wishlist</flux:navbar.item> </flux:navbar> </div> </header> <div class="flex flex-col gap-6 px-4 py-8 sm:px-6 lg:px-12 lg:py-12"> <flux:breadcrumbs> <flux:breadcrumbs.item href="#">Home</flux:breadcrumbs.item> <flux:breadcrumbs.item href="#">Headphones</flux:breadcrumbs.item> <flux:breadcrumbs.item>Over-Ear Headphones</flux:breadcrumbs.item> </flux:breadcrumbs> <div class="grid gap-8 lg:grid-cols-5 lg:gap-12"> <div class="grid grid-cols-7 items-start gap-2 lg:col-span-3"> <div class="flex flex-col gap-2"> @foreach (range(1, 6) as $photo) <button type="button" aria-label="Show photo {{ $photo }}" @class(['overflow-hidden rounded-lg bg-zinc-100', 'ring-2 ring-zinc-800 dark:ring-white' => $photo === 1])> <img src="https://fluxui.dev/img/demos/shop-product/noren-h6-pro-{{ $photo }}.webp" alt="" class="aspect-square object-cover"> </button> @endforeach </div> <div class="relative col-span-6 overflow-hidden rounded-xl bg-zinc-100"> <img src="https://fluxui.dev/img/demos/shop-product/noren-h6-pro-1.webp" alt="Noren H6 Pro headphones in black" class="aspect-square object-cover"> <div class="absolute end-4 top-4 flex flex-col gap-2"> <flux:button icon="arrow-up-tray" aria-label="Share" /> <flux:button icon="heart" icon:variant="outline" aria-label="Save to wishlist" /> <flux:button icon="magnifying-glass-plus" aria-label="Zoom" class="max-sm:hidden" /> </div> <div class="absolute end-4 top-1/2 -translate-y-1/2"> <flux:button icon="chevron-right" aria-label="Next photo" /> </div> </div> </div> <div class="flex flex-col gap-6 lg:col-span-2"> <div> <flux:text size="lg">Noren Sound</flux:text> <flux:heading level="1" size="xl" class="mt-2">Noren H6 Pro Adaptive Noise-Cancelling Headphones</flux:heading> <div class="mt-3 flex items-center gap-2"> <div class="flex" role="img" aria-label="Rated 4.7 out of 5"> @foreach (range(1, 5) as $star) <flux:icon.star variant="micro" @class(['text-zinc-800 dark:text-white' => $star <= 4, 'text-zinc-300 dark:text-zinc-600' => $star > 4]) /> @endforeach </div> <flux:text><span class="font-medium">4.7</span> · 326 reviews</flux:text> </div> </div> <flux:radio.group label="Color" variant="pills"> @foreach ($this->colors as $color => $hex) <flux:radio :value="$color" :checked="$loop->first"> <span class="size-3 rounded-full border border-white dark:border-zinc-900" style="background-color: {{ $hex }}"></span> {{ $color }} </flux:radio> @endforeach </flux:radio.group> <div> <flux:radio.group label="Availability" variant="cards" :indicator="false"> <flux:radio value="shipping" icon="truck" label="Shipping" description="In stock" checked /> <flux:radio value="pickup" icon="building-storefront" label="Pickup" description="Choose store" /> </flux:radio.group> <flux:text class="mt-3">Free shipping to <flux:link href="#">05264</flux:link></flux:text> </div> <flux:radio.group label="Aural Accident protection" description="Covers drops, spills and cracked parts from day one." variant="cards" :indicator="false"> @foreach ($this->plans as $plan => $price) <flux:radio :value="$plan" :label="$plan" :description="$price" :checked="$loop->first" /> @endforeach </flux:radio.group> <div> <div class="flex items-baseline gap-2"> <flux:heading size="xl">$199.99</flux:heading> <flux:text class="line-through"><span class="sr-only">Was </span>$279.99</flux:text> </div> <flux:text color="green" class="mt-1">29% off · Limited time sale</flux:text> </div> <div class="flex flex-col items-center gap-3"> <flux:button variant="primary" icon="shopping-bag" class="w-full">Add to cart</flux:button> <flux:text size="sm" class="flex items-center gap-1.5"> <flux:icon.check-circle variant="micro" /> Free returns </flux:text> </div> </div> </div> </div> <div class="bg-zinc-50 px-4 py-8 sm:px-6 lg:px-12 lg:py-12 dark:bg-zinc-900"> <flux:card> <flux:tab.group> <flux:tabs scrollable> <flux:tab name="features">Features</flux:tab> <flux:tab name="specifications">Specifications</flux:tab> <flux:tab name="reviews">Reviews</flux:tab> </flux:tabs> <flux:tab.panel name="features"> <flux:accordion transition> @foreach ($this->features as $feature) <flux:accordion.item :expanded="$loop->first"> <flux:accordion.heading> <span class="flex items-center gap-3"> <flux:icon :icon="$feature['icon']" variant="mini" /> {{ $feature['title'] }} </span> </flux:accordion.heading> <flux:accordion.content>{{ $feature['body'] }}</flux:accordion.content> </flux:accordion.item> @endforeach </flux:accordion> </flux:tab.panel> <flux:tab.panel name="specifications"> <flux:table> <flux:table.rows> @foreach ($this->specifications as $label => $value) <flux:table.row> <flux:table.cell class="w-1/3 whitespace-normal">{{ $label }}</flux:table.cell> <flux:table.cell variant="strong" class="whitespace-normal">{{ $value }}</flux:table.cell> </flux:table.row> @endforeach </flux:table.rows> </flux:table> </flux:tab.panel> <flux:tab.panel name="reviews" class="space-y-8"> <div class="flex flex-col gap-8 lg:flex-row lg:gap-12"> <div class="space-y-4 lg:w-96"> <flux:heading size="lg" class="flex items-center gap-1.5"> <flux:icon.star variant="mini" /> 4.7 · 326 reviews </flux:heading> @foreach ($this->ratings as $stars => $percent) <div class="flex items-center gap-4"> <flux:text variant="strong" class="flex w-8 shrink-0 items-center gap-0.5"> {{ $stars }} <flux:icon.star variant="micro" /> </flux:text> <flux:progress :value="$percent" aria-label="{{ $stars }} star reviews" /> <flux:text class="w-8 shrink-0 text-end">{{ $percent }}%</flux:text> </div> @endforeach <flux:text variant="strong">84% recommend this product.</flux:text> </div> <flux:card variant="soft" class="flex-1 space-y-6"> <div class="flex items-start justify-between gap-4"> <flux:heading size="lg">Reviews summary</flux:heading> <flux:link href="#" variant="subtle" class="text-sm">How this works?</flux:link> </div> @foreach ($this->reviewSummary as $heading => $tags) <div> <flux:heading>{{ $heading }}</flux:heading> <div class="mt-3 flex flex-wrap gap-2"> @foreach ($tags as $tag) <flux:badge size="sm">{{ $tag }}</flux:badge> @endforeach </div> </div> @endforeach </flux:card> </div> @foreach ($this->reviews as $review) <flux:separator variant="subtle" /> <div class="space-y-4"> <div class="flex items-center justify-between gap-4"> <div class="flex items-center gap-3"> <flux:avatar circle src="https://fluxui.dev/img/demos/shop-product/{{ $review['avatar'] }}" :name="$review['name']" /> <div> <div class="flex flex-wrap items-center gap-x-3"> <flux:heading>{{ $review['name'] }}</flux:heading> <flux:text class="flex items-center gap-1"> <flux:icon.check-badge variant="micro" class="text-blue-500" /> Verified purchase </flux:text> </div> <flux:text class="mt-1">{{ $review['date'] }}</flux:text> </div> </div> <div class="flex shrink-0" role="img" aria-label="Rated {{ $review['rating'] }} out of 5"> @foreach (range(1, 5) as $star) <flux:icon.star variant="mini" @class(['text-zinc-800 dark:text-white' => $star <= $review['rating'], 'text-zinc-300 dark:text-zinc-600' => $star > $review['rating']]) /> @endforeach </div> </div> <div> <flux:heading level="3" size="lg">{{ $review['title'] }}</flux:heading> <flux:text variant="strong" class="mt-2 leading-6">{{ $review['body'] }}</flux:text> </div> <div class="flex flex-wrap items-center justify-between gap-4"> <div class="flex flex-wrap gap-2"> <flux:button size="sm" icon="hand-thumb-up">Helpful ({{ $review['helpful'] }})</flux:button> <flux:button size="sm" icon="hand-thumb-down">Unhelpful ({{ $review['unhelpful'] }})</flux:button> <flux:button size="sm" icon="flag">Report</flux:button> </div> @if ($review['recommends']) <flux:text class="flex items-center gap-1.5"> <flux:icon.check variant="micro" class="text-green-600 dark:text-green-400" /> Recommends </flux:text> @endif </div> </div> @endforeach <flux:button variant="ghost" size="sm" icon:trailing="chevron-down" inset="left">Show more reviews</flux:button> </flux:tab.panel> </flux:tab.group> </flux:card> </div> <div class="space-y-6 px-4 pt-8 pb-12 sm:px-6 lg:px-12 lg:pt-12 lg:pb-16"> <div class="flex items-end justify-between gap-4"> <div> <flux:heading level="2" size="lg">Similar items you might like</flux:heading> <flux:text class="mt-1">Based on your recent activity</flux:text> </div> <flux:carousel.controls name="similar" /> </div> <flux:carousel name="similar" :arrows="false" aria-label="Similar items"> @foreach ($this->similar as $product) <flux:carousel.slide class="w-64 space-y-4 sm:w-70"> <div class="relative flex h-50 items-center justify-center rounded-xl bg-zinc-100 dark:bg-zinc-800"> <img src="https://fluxui.dev/img/demos/shop/{{ $product['image'] }}.webp" alt="{{ $product['brand'] }} {{ $product['name'] }}" class="size-36"> <div class="absolute end-3 top-3"> <flux:button icon="heart" icon:variant="outline" size="sm" aria-label="Add to wishlist" /> </div> </div> <div class="space-y-3"> <div> <flux:text>{{ $product['brand'] }}</flux:text> <flux:heading level="3" size="lg" class="mt-1"><a href="#" class="hover:underline">{{ $product['name'] }}</a></flux:heading> </div> <div class="flex items-center gap-2"> <div class="flex" role="img" aria-label="Rated {{ $product['rating'] }} out of 5"> @foreach (range(1, 5) as $star) <flux:icon.star variant="micro" @class(['text-zinc-800 dark:text-white' => $star <= floor($product['rating']), 'text-zinc-300 dark:text-zinc-600' => $star > floor($product['rating'])]) /> @endforeach </div> <flux:text>{{ $product['rating'] }} ({{ $product['reviews'] }})</flux:text> </div> <flux:heading size="xl">{{ $product['price'] }}</flux:heading> </div> </flux:carousel.slide> @endforeach </flux:carousel> </div></div>