From 36ec4ae0cea831921073b809cf9a9248c921cd0c Mon Sep 17 00:00:00 2001 From: Ruslan Date: Tue, 12 May 2026 19:58:36 +0300 Subject: [PATCH] feat: mini vendor logos on chips --- static/css/index.css | 19 ++++++++++++++++++- static/js/index.js | 10 +++++++++- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/static/css/index.css b/static/css/index.css index 78e15b3..3e1d944 100644 --- a/static/css/index.css +++ b/static/css/index.css @@ -270,13 +270,30 @@ .chip { border: 1px solid #ccdbf7; border-radius: 999px; - padding: 8px 12px; + padding: 6px 12px 6px 6px; background: #f7faff; color: #22427a; font-size: 13px; cursor: pointer; user-select: none; transition: .18s ease; + display: inline-flex; + align-items: center; + gap: 7px; + } + .chip-logo { + width: 22px; + height: 22px; + object-fit: contain; + border-radius: 4px; + background: #fff; + flex-shrink: 0; + } + .chip.active .chip-logo { + filter: brightness(0) invert(1) opacity(.9); + } + .chip.dim .chip-logo { + opacity: .45; } .chip:hover { diff --git a/static/js/index.js b/static/js/index.js index 0bfb898..2e5aaa7 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -205,7 +205,15 @@ node.className = "chip"; if (state.selectedVendors.has(vendor.id)) node.classList.add("active"); else if (!allowedVendors.has(vendor.id)) node.classList.add("dim"); - node.textContent = vendor.name; + if (vendor.logo) { + const img = document.createElement('img'); + img.src = `/static/${vendor.logo}`; + img.alt = ''; + img.className = 'chip-logo'; + img.onerror = () => img.remove(); + node.appendChild(img); + } + node.appendChild(document.createTextNode(vendor.name)); node.addEventListener("click", () => { const wasSelected = state.selectedVendors.has(vendor.id); state.selectedVendors.clear();