From 65a6a73d1729ddc2bbd30cfd3af046537b1fea05 Mon Sep 17 00:00:00 2001 From: Caleb Allen Date: Mon, 30 Mar 2026 15:55:25 -0400 Subject: [PATCH] =?UTF-8?q?fix:=20pill=20toggle=20layout=20=E2=80=94=20ico?= =?UTF-8?q?ns=20absolutely=20positioned,=20thumb=20slides=20over?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Icons are now at fixed positions inside the pill (globe left, hard-drive right) with absolute positioning. The thumb slides between them. The active icon is the one NOT covered by the thumb: - Off: thumb left (covers globe), hard-drive visible - On: thumb right (covers hard-drive), globe visible Icons fade with opacity transitions. Thumb changes from white (off) to black (on) to contrast with the yellow active background. --- frontend/index.css | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/frontend/index.css b/frontend/index.css index fa3d3f6..8c76dd8 100644 --- a/frontend/index.css +++ b/frontend/index.css @@ -44,14 +44,12 @@ p { position: relative; display: flex; align-items: center; - width: 56px; - height: 28px; - border-radius: 14px; + width: 52px; + height: 26px; + border-radius: 13px; background: var(--yj-bg-overlay, rgba(255, 255, 255, 0.1)); cursor: pointer; flex-shrink: 0; - padding: 0 4px; - justify-content: space-between; transition: background 0.2s ease; } @@ -61,18 +59,19 @@ p { .mode-toggle-thumb { position: absolute; - top: 3px; - left: 3px; + top: 2px; + left: 2px; width: 22px; height: 22px; border-radius: 50%; background: var(--yj-text-primary, #fff); - transition: left 0.2s ease; + transition: left 0.2s ease, background 0.2s ease; z-index: 1; } .mode-toggle.active .mode-toggle-thumb { - left: 31px; + left: 28px; + background: #000; } .mode-toggle.active { @@ -80,25 +79,33 @@ p { } .mode-icon { - font-size: 13px; + position: absolute; + top: 50%; + transform: translateY(-50%); + font-size: 12px; z-index: 2; - transition: color 0.2s ease; + transition: opacity 0.2s ease; + pointer-events: none; } .mode-icon-globe { - color: var(--yj-text-primary, #fff); + left: 7px; + color: #000; + opacity: 0; } .mode-icon-local { + right: 7px; color: var(--yj-text-secondary, #b3b3b3); + opacity: 1; } .mode-toggle.active .mode-icon-globe { - color: rgba(0, 0, 0, 0.3); + opacity: 1; } .mode-toggle.active .mode-icon-local { - color: #000; + opacity: 0; } ul {