From 0ae5f49bcf07ec3a7560ec6faca1c1975f6c045a Mon Sep 17 00:00:00 2001 From: elvira Date: Sat, 24 Oct 2026 00:20:57 +0300 Subject: [PATCH] responsive design --- resources/css/app.css | 81 +++++++++- .../js/stimulus/auto-submit-controller.js | 11 +- resources/views/category/show.blade.php | 6 +- .../views/components/back-to-top.blade.php | 2 +- resources/views/components/footer.blade.php | 34 +++-- resources/views/components/header.blade.php | 114 ++++++++++++-- .../components/newsletter-split.blade.php | 6 +- .../views/components/newsletter.blade.php | 4 +- .../views/components/product-grid.blade.php | 2 +- .../views/components/review-card.blade.php | 2 +- .../views/components/search-overlay.blade.php | 2 +- resources/views/components/ui/icon.blade.php | 4 +- .../views/components/ui/pagination.blade.php | 2 +- .../components/ui/product-card.blade.php | 10 +- resources/views/components/ui/tabs.blade.php | 4 +- resources/views/contact.blade.php | 6 +- resources/views/errors/layout.blade.php | 4 +- resources/views/home.blade.php | 42 ++--- resources/views/product/show.blade.php | 43 +++--- resources/views/products/index.blade.php | 6 +- resources/views/search/index.blade.php | 6 +- .../views/shop/partials/listing.blade.php | 144 +++++++++++------- resources/views/wishlist/list.blade.php | 2 +- 23 files changed, 380 insertions(+), 157 deletions(-) diff --git a/resources/css/app.css b/resources/css/app.css index 30f59e8..9592cb9 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -260,6 +260,84 @@ @layer components { } } + /* ── Mobile menu (popover) — wipes down from under the header ──── */ + /* clip-path, not height: compositor-only, so the reveal never counts + toward CLS. */ + .mobile-menu { + clip-path: inset(0 0 100% 0); + transition: + clip-path 0.4s cubic-bezier(0.61, 1, 0.88, 1), + display 0.4s allow-discrete, + overlay 0.4s allow-discrete; + } + + .mobile-menu:popover-open { + clip-path: inset(0); + } + + @starting-style { + .mobile-menu:popover-open { + clip-path: inset(0 0 100% 0); + } + } + + /* ── Burger — three lines that morph into a flat X while the menu is + open. Lines are 4px tall, 7px apart, so ±11px meets in the middle. ── */ + .burger span { + transition: + transform 0.4s cubic-bezier(0.61, 1, 0.88, 1), + opacity 0.2s ease; + } + + header:has(#mobile-nav:popover-open) .burger span:nth-child(1) { + transform: translateY(11px) rotate(25deg); + } + + header:has(#mobile-nav:popover-open) .burger span:nth-child(2) { + opacity: 0; + } + + header:has(#mobile-nav:popover-open) .burger span:nth-child(3) { + transform: translateY(-11px) rotate(-25deg); + } + + /* ── Drawer (popover) — slides in from the left; mobile filters ─── */ + .drawer { + transform: translateX(-100%); + transition: + transform 0.3s cubic-bezier(0.2, 0.78, 0.12, 0.86), + display 0.3s allow-discrete, + overlay 0.3s allow-discrete; + } + + .drawer:popover-open { + transform: translateX(0); + } + + @starting-style { + .drawer:popover-open { + transform: translateX(-100%); + } + } + + .drawer::backdrop { + background-color: rgb(0 0 0 / 0); + transition: + background-color 0.3s ease, + display 0.3s allow-discrete, + overlay 0.3s allow-discrete; + } + + .drawer:popover-open::backdrop { + background-color: rgb(0 0 0 / 0.3); + } + + @starting-style { + .drawer:popover-open::backdrop { + background-color: rgb(0 0 0 / 0); + } + } + /* ── Shared underline-slide animation ────────────────────────── */ .underline-slide { background-image: linear-gradient(currentColor, currentColor); @@ -415,8 +493,9 @@ @layer components { @apply font-bold text-black; } + /* Wide tables scroll sideways on phones instead of pushing the page wider. */ .legal-content table { - @apply w-full border-collapse text-left text-sm; + @apply w-full border-collapse text-left text-sm max-sm:block max-sm:overflow-x-auto; } .legal-content th, diff --git a/resources/js/stimulus/auto-submit-controller.js b/resources/js/stimulus/auto-submit-controller.js index df51c6f..c8313bc 100644 --- a/resources/js/stimulus/auto-submit-controller.js +++ b/resources/js/stimulus/auto-submit-controller.js @@ -11,10 +11,19 @@ import { Controller } from '@hotwired/stimulus' // `change` covers native inputs (checkbox, select); the range slider emits its // own `range-slider:change` on commit. Uses requestSubmit() (not submit()) so a // around the form still captures the navigation and validation runs. +// +// Optional data-auto-submit-media-value="(min-width: 64rem)" limits auto-submit +// to viewports matching that query — below it the form waits for its own submit +// button (e.g. the mobile filters drawer's "Apply"). export default class extends Controller { - static values = { delay: { type: Number, default: 300 } } + static values = { + delay: { type: Number, default: 300 }, + media: String, + } submit() { + if (this.mediaValue && !window.matchMedia(this.mediaValue).matches) return + clearTimeout(this.#timer) this.#timer = setTimeout(() => this.element.requestSubmit(), this.delayValue) } diff --git a/resources/views/category/show.blade.php b/resources/views/category/show.blade.php index bf4f9b5..7f6ed73 100644 --- a/resources/views/category/show.blade.php +++ b/resources/views/category/show.blade.php @@ -15,10 +15,10 @@ @section('content') {{--
--}} -
+
-
-

{{ $collection['name'] }}

+
+

{{ $collection['name'] }}

-
+
{{-- Logo --}} - - {{ config('app.name') }} + + {{ config('app.name') }} -
+
{{-- Links --}} -