From a1b2b06a18cb86258020d768f8297032f6576460 Mon Sep 17 00:00:00 2001 From: Alaguraj0361 Date: Mon, 7 Sep 2026 16:41:59 +0530 Subject: [PATCH] implement dynamic shop page sidebar with category filters and mobile offcanvas drawer --- .../static/src/css/shop_style.css | 70 +-- .../static/src/scss/shop.scss | 480 +++++++++++------- .../views/shop_page.xml | 338 ++++++------ 3 files changed, 499 insertions(+), 389 deletions(-) diff --git a/addons/dine360_dashboard/static/src/css/shop_style.css b/addons/dine360_dashboard/static/src/css/shop_style.css index ca4c9c7..86291b2 100644 --- a/addons/dine360_dashboard/static/src/css/shop_style.css +++ b/addons/dine360_dashboard/static/src/css/shop_style.css @@ -38,22 +38,24 @@ flex-wrap: wrap; } -/* Left Sidebar Column (Categories/Filters) */ -.oe_website_sale #products_grid_before, -.oe_website_sale .col-lg-3, -.oe_website_sale aside { - flex: 0 0 280px !important; - max-width: 280px !important; - display: block !important; - visibility: visible !important; - padding-right: 20px; -} +/* Left Sidebar Column (Categories/Filters) - Desktop Only */ +@media (min-width: 992px) { + .oe_website_sale #products_grid_before, + .oe_website_sale .col-lg-3, + .oe_website_sale aside { + flex: 0 0 280px !important; + max-width: 280px !important; + display: block !important; + visibility: visible !important; + padding-right: 20px; + } -/* Right Products Column */ -.oe_website_sale #products_grid, -.oe_website_sale .col-lg-9 { - flex: 1 !important; - max-width: calc(100% - 280px) !important; + /* Right Products Column */ + .oe_website_sale #products_grid, + .oe_website_sale .col-lg-9 { + flex: 1 !important; + max-width: calc(100% - 280px) !important; + } } /* Filter Sidebar Styling */ @@ -216,32 +218,38 @@ } /* Mobile Responsive */ -@media (max-width: 991px) { - +@media (max-width: 991.98px) { .oe_website_sale #products_grid_before, - .oe_website_sale .col-lg-3, - .oe_website_sale aside { - flex: 0 0 100% !important; - max-width: 100% !important; - margin-bottom: 20px; + .oe_website_sale aside:not(.mobile-category-offcanvas), + aside#products_grid_before { + display: none !important; + visibility: hidden !important; + height: 0 !important; + max-height: 0 !important; + overflow: hidden !important; + margin: 0 !important; + padding: 0 !important; } .oe_website_sale #products_grid, .oe_website_sale .col-lg-9 { flex: 0 0 100% !important; max-width: 100% !important; + width: 100% !important; } } -/* Ensure visibility of all filter elements */ -.oe_website_sale .o_wsale_products_searchbar_form, -.oe_website_sale .o_wsale_products_categories, -.oe_website_sale #wsale_products_categories_collapse, -.oe_website_sale .o_wsale_products_attributes, -.oe_website_sale .o_wsale_products_price { - display: block !important; - visibility: visible !important; - opacity: 1 !important; +/* Ensure visibility of desktop filter elements */ +@media (min-width: 992px) { + .oe_website_sale .o_wsale_products_searchbar_form, + .oe_website_sale .o_wsale_products_categories, + .oe_website_sale #wsale_products_categories_collapse, + .oe_website_sale .o_wsale_products_attributes, + .oe_website_sale .o_wsale_products_price { + display: block !important; + visibility: visible !important; + opacity: 1 !important; + } } /* Category Navigation */ diff --git a/addons/dine360_theme_shivasakthi/static/src/scss/shop.scss b/addons/dine360_theme_shivasakthi/static/src/scss/shop.scss index 13dc873..f4eface 100644 --- a/addons/dine360_theme_shivasakthi/static/src/scss/shop.scss +++ b/addons/dine360_theme_shivasakthi/static/src/scss/shop.scss @@ -454,18 +454,23 @@ body, } } - /* Tablet Layout Tweaks (991px to 768px) */ - @media (max-width: 991px) { + /* Tablet & Mobile Layout Tweaks (Hide Desktop Sidebar, full width product grid) */ + @media (max-width: 991.98px) { .o_wsale_products_main_row { display: flex !important; flex-direction: column !important; } - #products_grid_before { - width: 100% !important; - max-width: 100% !important; - flex: 0 0 100% !important; - margin-bottom: 20px; + #products_grid_before, + aside#products_grid_before, + .oe_website_sale aside:not(.mobile-category-offcanvas) { + display: none !important; + visibility: hidden !important; + height: 0 !important; + max-height: 0 !important; + overflow: hidden !important; + margin: 0 !important; + padding: 0 !important; } #products_grid { @@ -535,12 +540,35 @@ body, .o_sortby_dropdown { margin-left: auto !important; } - - .btn-group.o_wsale_apply_grid, - .o_wsale_apply_grid { - display: none !important; - } } + + .btn-group.o_wsale_apply_grid, + .o_wsale_apply_grid, + .o_wsale_apply_list, + .o_wsale_apply_layout, + .btn-group:has(.fa-th-large), + .btn-group:has(.fa-th-list), + .btn-group:has(.fa-th), + .btn-group:has(.fa-list), + .btn-group:has(.fa-bars), + .o_wsale_products_pager .btn-group:not(.dropdown):not(.o_sortby_dropdown), + .o_wsale_products_pager a[href*="layout=grid"], + .o_wsale_products_pager a[href*="layout=list"] { + display: none !important; + } + } + + /* Global Grid/List Button Hide on Mobile */ + .btn-group.o_wsale_apply_grid, + .o_wsale_apply_grid, + .o_wsale_apply_list, + .o_wsale_apply_layout, + .btn-group:has(.fa-th-large), + .btn-group:has(.fa-th-list), + .btn-group:has(.fa-th), + .btn-group:has(.fa-list), + .btn-group:has(.fa-bars) { + display: none !important; } /* Mobile Categories Bar Button (Bottom-left of Search) */ @@ -594,173 +622,17 @@ body, display: none !important; } - /* Category Header/Toggle */ - #products_grid_before { - order: 3 !important; - width: 100% !important; - max-width: 100% !important; - flex: 0 0 100% !important; - margin-bottom: 0 !important; - padding: 0 !important; - z-index: 1 !important; - position: static !important; - } - - /* Backdrop for Mobile Categories Drawer */ - .mobile-category-backdrop { - position: fixed !important; - top: 0 !important; - left: 0 !important; - width: 100vw !important; - height: 100vh !important; - height: 100dvh !important; - background: rgba(14, 19, 23, 0.7) !important; - backdrop-filter: blur(4px) !important; - -webkit-backdrop-filter: blur(4px) !important; - z-index: 9999998 !important; - opacity: 0; - visibility: hidden; - transition: opacity 0.3s ease, visibility 0.3s ease; - pointer-events: none; - - &.show { - opacity: 1 !important; - visibility: visible !important; - pointer-events: auto !important; - } - } - - /* Fixed Full-Height Mobile Drawer */ - .mobile-category-offcanvas { - position: fixed !important; - top: 0 !important; - bottom: 0 !important; - left: 0 !important; - width: 300px !important; - max-width: 85vw !important; - height: 100vh !important; - height: 100dvh !important; - background: #ffffff !important; - z-index: 9999999 !important; - display: flex !important; - flex-direction: column !important; - box-shadow: 10px 0 40px rgba(0, 0, 0, 0.35) !important; - transform: translateX(-100%) !important; - transition: transform 0.32s cubic-bezier(0.25, 1, 0.5, 1), visibility 0.32s ease !important; - visibility: hidden; + /* Hide Desktop Sidebar on Mobile (since Mobile Offcanvas Drawer is used) */ + #products_grid_before, + aside#products_grid_before, + .oe_website_sale aside:not(.mobile-category-offcanvas) { + display: none !important; + visibility: hidden !important; + height: 0 !important; + max-height: 0 !important; overflow: hidden !important; - - &.show { - transform: translateX(0) !important; - visibility: visible !important; - } - - .offcanvas-header { - background: #ffffff; - border-bottom: 1px solid #f0f0f0; - padding: 16px 20px; - flex-shrink: 0; - - .drawer-header-icon { - width: 32px; - height: 32px; - background: #ffb800; - border-radius: 6px; - display: flex; - align-items: center; - justify-content: center; - font-size: 0.95rem; - } - - .offcanvas-title { - font-weight: 800 !important; - font-size: 1.05rem !important; - color: #0e1317 !important; - letter-spacing: 0.5px; - } - - .btn-close-drawer { - width: 34px; - height: 34px; - background: #f4f4f4; - border: 1px solid #e5e5e5; - border-radius: 50%; - cursor: pointer; - transition: all 0.2s; - - &:hover { - background: #ffb800; - border-color: #ffb800; - } - } - } - - .offcanvas-body { - padding: 20px 16px; - overflow-y: auto !important; - -webkit-overflow-scrolling: touch !important; - flex: 1 1 auto; - height: calc(100vh - 65px) !important; - max-height: calc(100dvh - 65px) !important; - - .category-list { - list-style: none; - padding: 0; - margin: 0; - - .category-item { - margin-bottom: 10px; - - a { - display: flex; - align-items: center; - padding: 12px 16px; - border-radius: 10px; - text-decoration: none; - background: #fbfbfb; - border: 1px solid #eeeeee; - color: #222222; - font-weight: 700; - font-size: 0.95rem; - text-transform: uppercase; - letter-spacing: 0.3px; - transition: all 0.2s ease; - - img { - width: 26px; - height: 26px; - object-fit: contain; - margin-right: 14px; - } - - span { - color: #222222; - font-weight: 700; - } - - &:hover { - background: #fff8e7; - border-color: #ffb800; - color: #000000; - transform: translateX(4px); - } - - &.active { - background: #ffb800 !important; - border-color: #ffb800 !important; - color: #000000 !important; - font-weight: 900 !important; - box-shadow: 0 4px 12px rgba(255, 184, 0, 0.35) !important; - - span { - color: #000000 !important; - font-weight: 900 !important; - } - } - } - } - } - } + margin: 0 !important; + padding: 0 !important; } /* Product Grid (2 products per row) */ @@ -1054,20 +926,9 @@ body, box-shadow: 0 6px 20px rgba(254, 205, 79, 0.4) !important; } -/* Global Highest Z-Index for Mobile Categories Drawer */ -.mobile-category-offcanvas { - position: fixed !important; - top: 0 !important; - bottom: 0 !important; - left: 0 !important; - width: 300px !important; - max-width: 85vw !important; - height: 100vh !important; - height: 100dvh !important; - background: #ffffff !important; - z-index: 9999999 !important; -} - +/* ========================================================================== + Global Full-Height Mobile Categories Drawer (Root Level for Reparenting) + ========================================================================== */ .mobile-category-backdrop { position: fixed !important; top: 0 !important; @@ -1075,5 +936,240 @@ body, width: 100vw !important; height: 100vh !important; height: 100dvh !important; + background: rgba(14, 19, 23, 0.7) !important; + backdrop-filter: blur(4px) !important; + -webkit-backdrop-filter: blur(4px) !important; z-index: 9999998 !important; + opacity: 0; + visibility: hidden; + transition: opacity 0.3s ease, visibility 0.3s ease; + pointer-events: none; + + &.show { + opacity: 1 !important; + visibility: visible !important; + pointer-events: auto !important; + } +} + +.mobile-category-offcanvas { + position: fixed !important; + top: 0 !important; + bottom: 0 !important; + left: 0 !important; + width: 320px !important; + max-width: 85vw !important; + height: 100vh !important; + height: 100dvh !important; + background: #ffffff !important; + z-index: 9999999 !important; + display: flex !important; + flex-direction: column !important; + box-shadow: 10px 0 40px rgba(0, 0, 0, 0.35) !important; + transform: translateX(-100%) !important; + transition: transform 0.32s cubic-bezier(0.25, 1, 0.5, 1), visibility 0.32s ease !important; + visibility: hidden; + overflow: hidden !important; + + &.show { + transform: translateX(0) !important; + visibility: visible !important; + } + + .offcanvas-header { + background: #ffffff; + border-bottom: 1px solid #f0f0f0; + padding: 16px 20px; + flex-shrink: 0; + display: flex; + align-items: center; + justify-content: space-between; + + .drawer-header-icon { + width: 32px; + height: 32px; + background: #ffb800; + border-radius: 6px; + display: flex; + align-items: center; + justify-content: center; + font-size: 0.95rem; + } + + .offcanvas-title { + font-weight: 800 !important; + font-size: 1.05rem !important; + color: #0e1317 !important; + letter-spacing: 0.5px; + margin: 0 !important; + } + + .btn-close-drawer { + width: 36px; + height: 36px; + background: #f4f4f4; + border: 1px solid #e0e0e0; + border-radius: 50%; + cursor: pointer; + display: flex; + align-items: center; + justify-content: center; + transition: all 0.2s; + pointer-events: auto !important; + + i { + font-size: 16px; + color: #333; + pointer-events: none; + } + + &:hover, &:active { + background: #ffb800; + border-color: #ffb800; + color: #000; + } + } + } + + .offcanvas-body { + padding: 20px 16px; + overflow-y: auto !important; + -webkit-overflow-scrolling: touch !important; + flex: 1 1 auto; + height: calc(100vh - 65px) !important; + max-height: calc(100dvh - 65px) !important; + + .food-sidebar-section { + margin-bottom: 25px; + + .section-title { + display: flex; + align-items: center; + font-size: 1.05rem; + font-weight: 800; + color: #0e1317; + text-transform: uppercase; + margin-bottom: 16px; + letter-spacing: 0.8px; + + &::before { + content: ''; + display: inline-block; + width: 4px; + height: 18px; + background: #ffb800; + border-radius: 2px; + margin-right: 10px; + } + } + + .attribute-list { + padding: 0; + margin: 0; + list-style: none; + + li { + margin-bottom: 8px; + + .form-check { + display: flex; + align-items: center; + gap: 10px; + padding: 6px 10px; + border-radius: 6px; + transition: background 0.2s ease; + + &:hover { + background: #f8f9fa; + } + + .form-check-input { + width: 18px; + height: 18px; + min-width: 18px; + margin-top: 0; + cursor: pointer; + border: 2px solid #bbb; + border-radius: 4px; + + &:checked { + background-color: #ffb800; + border-color: #ffb800; + } + } + + .attrib-name { + font-size: 0.95rem; + color: #333333; + font-weight: 700; + } + } + } + } + } + + .category-list { + list-style: none !important; + padding: 0 !important; + margin: 0 !important; + + .category-item { + margin-bottom: 8px; + list-style: none !important; + + a { + display: flex !important; + align-items: center !important; + padding: 10px 14px !important; + border-radius: 8px !important; + text-decoration: none !important; + background: #fbfbfb !important; + border: 1px solid #eeeeee !important; + color: #222222 !important; + font-weight: 700 !important; + font-size: 0.9rem !important; + text-transform: uppercase !important; + letter-spacing: 0.3px; + transition: all 0.2s ease; + + img { + width: 28px !important; + height: 28px !important; + max-width: 28px !important; + max-height: 28px !important; + object-fit: cover !important; + border-radius: 6px !important; + margin-right: 12px !important; + flex-shrink: 0 !important; + } + + span, .category-name { + color: #222222 !important; + font-weight: 700 !important; + font-size: 0.9rem !important; + } + + &:hover { + background: #fff8e7 !important; + border-color: #ffb800 !important; + color: #000000 !important; + transform: translateX(3px); + } + + &.active { + background: #ffb800 !important; + border-color: #ffb800 !important; + color: #000000 !important; + font-weight: 900 !important; + box-shadow: 0 4px 12px rgba(255, 184, 0, 0.35) !important; + + span, .category-name { + color: #000000 !important; + font-weight: 900 !important; + } + } + } + } + } + } } diff --git a/addons/dine360_theme_shivasakthi/views/shop_page.xml b/addons/dine360_theme_shivasakthi/views/shop_page.xml index 0205389..5d24795 100644 --- a/addons/dine360_theme_shivasakthi/views/shop_page.xml +++ b/addons/dine360_theme_shivasakthi/views/shop_page.xml @@ -3,210 +3,216 @@