fix(ux): replace overlay button with clean gradient mask for mobile catalog filters
Deploy Canina / deploy (push) Successful in 2m7s
Deploy Canina / deploy (push) Successful in 2m7s
This commit is contained in:
1 parent
994086e580
commit
5534d050af
3 files changed
+8
-28
No files matched your search
@@ -140,10 +140,11 @@
|
||||
background: var(--color-canina-blue);
|
||||
}
|
||||
|
||||
/* Mobile catalog filter edge affordances */
|
||||
.catalog-filter-fade { position:absolute; top:0; bottom:0.625rem; width:2.5rem; z-index:10; pointer-events:none; }
|
||||
.catalog-filter-fade-start { inset-inline-start:0; background:linear-gradient(to right, rgba(248,250,252,1), rgba(248,250,252,0)); }
|
||||
.catalog-filter-fade-end { inset-inline-end:0; background:linear-gradient(to left, rgba(248,250,252,1), rgba(248,250,252,0)); }
|
||||
/* Mobile catalog filter edge affordances (clean mask-based fade) */
|
||||
.mobile-filter-mask {
|
||||
-webkit-mask-image: linear-gradient(to right, transparent, black 24px, black calc(100% - 24px), transparent 100%);
|
||||
mask-image: linear-gradient(to right, transparent, black 24px, black calc(100% - 24px), transparent 100%);
|
||||
}
|
||||
|
||||
/* Micro horizontal scrollbar for dark backgrounds (catalog etc.) */
|
||||
.micro-hscroll-dark {
|
||||
@@ -185,6 +186,3 @@
|
||||
.animate-marquee:hover {
|
||||
animation-play-state: paused;
|
||||
}
|
||||
|
||||
[dir="rtl"] .catalog-filter-fade-start { background:linear-gradient(to left, rgba(248,250,252,1), rgba(248,250,252,0)); }
|
||||
[dir="rtl"] .catalog-filter-fade-end { background:linear-gradient(to right, rgba(248,250,252,1), rgba(248,250,252,0)); }
|
||||
@@ -829,7 +829,7 @@ export default function ArchivePage({
|
||||
|
||||
{/* Horizontal Scrollable Row for Sort, Pet Type, Solutions & Symptoms Filter */}
|
||||
<div className="relative -mx-4 mt-2 mb-4" data-testid="mobile-catalog-filters-edge">
|
||||
<div data-testid="mobile-catalog-filters" aria-label="فیلترهای محصولات" className="flex items-center gap-2 overflow-x-auto pb-2.5 pt-0.5 micro-hscroll px-4 select-none touch-pan-x">
|
||||
<div data-testid="mobile-catalog-filters" aria-label="فیلترهای محصولات" className="flex items-center gap-2 overflow-x-auto pb-2.5 pt-0.5 micro-hscroll px-4 select-none touch-pan-x mobile-filter-mask">
|
||||
|
||||
{/* 1. View Mode Switch: 2 Buttons (List / Card) */}
|
||||
<div className="flex-shrink-0 inline-flex items-center bg-white border border-medical-gray-200 rounded-xl p-0.5 shadow-2xs mr-auto">
|
||||
@@ -1052,25 +1052,8 @@ export default function ArchivePage({
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
<span aria-hidden="true" className="catalog-filter-fade catalog-filter-fade-start" />
|
||||
<span aria-hidden="true" className="catalog-filter-fade catalog-filter-fade-end" />
|
||||
<button
|
||||
type="button"
|
||||
data-testid="mobile-catalog-more-filters"
|
||||
onClick={() => {
|
||||
const el = document.querySelector('[data-testid="mobile-catalog-filters"]');
|
||||
if (el) {
|
||||
el.scrollBy({ left: -140, behavior: "smooth" });
|
||||
}
|
||||
}}
|
||||
aria-label="مشاهده فیلترهای بیشتر"
|
||||
className="absolute left-2 top-1/2 -translate-y-1/2 flex items-center gap-1 bg-white/95 backdrop-blur-xs border border-medical-gray-200 text-medical-gray-700 px-2 py-1 rounded-full text-[10px] font-black shadow-md z-20 hover:bg-medical-gray-50 active:scale-95 transition-all"
|
||||
>
|
||||
<span>فیلترهای بیشتر</span>
|
||||
<svg className="w-3 h-3 text-canina-blue" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2.5} d="M15 19l-7-7 7-7" />
|
||||
</svg>
|
||||
</button>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -170,7 +170,6 @@ describe("ArchivePage Component", () => {
|
||||
const filterRow = screen.getByTestId("mobile-catalog-filters");
|
||||
expect(filterRow).toHaveAttribute("aria-label", "فیلترهای محصولات");
|
||||
expect(screen.getByTestId("mobile-catalog-filters-edge")).toBeInTheDocument();
|
||||
expect(screen.getByTestId("mobile-catalog-more-filters")).toHaveAttribute("aria-label", "مشاهده فیلترهای بیشتر");
|
||||
});
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user