From b0e5fec03e81384165b3b41d611945ffe582eb01 Mon Sep 17 00:00:00 2001 From: zenn Date: Tue, 3 Feb 2026 19:02:11 +0900 Subject: [PATCH] =?UTF-8?q?=EC=B9=A9=20=EC=BB=AC=EB=9F=AC=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 18 +++------------ scripts/app.js | 57 ++++++++++++++++++++++++++++++++++++---------- style/tailwind.css | 16 +++++++++++++ 3 files changed, 64 insertions(+), 27 deletions(-) diff --git a/index.html b/index.html index d1c135e..bfb97be 100644 --- a/index.html +++ b/index.html @@ -185,15 +185,6 @@
@@ -289,13 +280,10 @@ diff --git a/scripts/app.js b/scripts/app.js index 971647a..1ebc43f 100644 --- a/scripts/app.js +++ b/scripts/app.js @@ -81,6 +81,28 @@ let activeStatuses = new Set( .map(([status]) => status), ); +function getStatusChipClass(status, isActive) { + const base = STATUS_COLOR[status] ?? ''; + + if (isActive) { + return ` + ${base} + opacity-100 + shadow-sm + `; + } + + // 🔥 비활성 + return ` + bg-slate-50 + text-slate-400 + border-slate-200 + opacity-30 + grayscale + hover:opacity-50 + `; +} + function renderStatusChips() { const container = document.getElementById('status-chips'); if (!container) return; @@ -89,21 +111,20 @@ function renderStatusChips() { STATUS_FILTERS.filter((f) => f.visible).forEach(({ key, label }) => { const isActive = activeStatuses.has(key); - const baseColor = STATUS_COLOR[key] ?? ''; const chip = document.createElement('button'); - chip.className = ` - status-chip px-4 py-2 rounded-full text-sm font-medium transition - border - ${isActive ? baseColor : 'bg-slate-50 text-slate-600 border-slate-200'} - `; + status-chip + px-4 py-2 + rounded-full + text-sm font-medium + transition-all duration-200 + border + ${getStatusChipClass(key, isActive)} + `; chip.textContent = label; - - chip.onclick = () => { - toggleStatusFilter(key); - }; + chip.onclick = () => toggleStatusFilter(key); container.appendChild(chip); }); @@ -382,11 +403,23 @@ function renderPagination() { if (!container) return; const totalPages = Math.ceil(visibleProducts.length / ITEMS_PER_PAGE); - let html = ``; + let html = ``; for (let i = 1; i <= totalPages; i++) { html += ``; } - html += ``; + html += ``; container.innerHTML = html; } diff --git a/style/tailwind.css b/style/tailwind.css index 471387a..a5525e2 100644 --- a/style/tailwind.css +++ b/style/tailwind.css @@ -398,6 +398,9 @@ .h-2 { height: calc(var(--spacing) * 2); } + .h-5 { + height: calc(var(--spacing) * 5); + } .h-9 { height: calc(var(--spacing) * 9); } @@ -446,6 +449,9 @@ .w-4 { width: calc(var(--spacing) * 4); } + .w-5 { + width: calc(var(--spacing) * 5); + } .w-6 { width: calc(var(--spacing) * 6); } @@ -1006,6 +1012,9 @@ .underline { text-decoration-line: underline; } + .opacity-30 { + opacity: 30%; + } .opacity-70 { opacity: 70%; } @@ -1165,6 +1174,13 @@ } } } + .hover\:opacity-50 { + &:hover { + @media (hover: hover) { + opacity: 50%; + } + } + } .hover\:opacity-100 { &:hover { @media (hover: hover) {