From 01963218abd17d0a1aeafdbfae262b107740ebea Mon Sep 17 00:00:00 2001 From: Daniel Dada Date: Thu, 5 Feb 2026 16:49:00 +0300 Subject: [PATCH] redesign of popup --- popup/popup.css | 1549 +++++++++++++++++++++++----------- popup/popup.html | 346 +++++--- src/popup/PopupController.ts | 370 ++++---- 3 files changed, 1525 insertions(+), 740 deletions(-) diff --git a/popup/popup.css b/popup/popup.css index e25b9f6..38cfe8e 100644 --- a/popup/popup.css +++ b/popup/popup.css @@ -1,15 +1,19 @@ @import url('../shared/colors.css'); -@import url('../shared/ui-components.css'); -body { - font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; - background: radial-gradient(120% 120% at 12% 0%, rgba(204, 106, 42, 0.08) 0%, transparent 45%), - linear-gradient(180deg, var(--bg-color) 0%, #f4e9df 100%); - color: var(--text-color); +/* Reset and Base Styles */ +* { + box-sizing: border-box; margin: 0; padding: 0; - width: 360px; - height: 600px; +} + +body { + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif; + background: var(--bg-color); + color: var(--text-color); + width: 600px; + min-height: 600px; + max-height: 600px; overflow: hidden; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; @@ -17,12 +21,6 @@ body { flex-direction: column; } -html.dark body, -body.dark { - background: radial-gradient(120% 120% at 10% 0%, rgba(242, 168, 101, 0.08) 0%, transparent 45%), - linear-gradient(180deg, var(--bg-color) 0%, #0f0d0b 100%); -} - /* Loading Overlay */ .loading-overlay { position: fixed; @@ -58,602 +56,895 @@ body.dark { } } -.container { - padding: 14px; +/* Main Container */ +.popup-container { display: flex; flex-direction: column; - gap: 12px; flex: 1; + background: var(--bg-color); overflow: hidden; min-height: 0; } +/* Header */ +.header { + display: flex; + align-items: center; + justify-content: space-between; + padding: 16px 20px; + border-bottom: 1px solid var(--input-border); + background: var(--bg-color); + flex-shrink: 0; +} + +.header-content { + display: flex; + align-items: center; + gap: 10px; +} + +.header-logo { + width: 32px; + height: 32px; + border-radius: 8px; + background: var(--highlight-tag); + display: flex; + align-items: center; + justify-content: center; + padding: 4px; +} + +.header-logo img { + width: 100%; + height: 100%; + object-fit: contain; +} + +.header-title { + font-size: 14px; + font-weight: 600; + color: var(--text-color); +} + +/* Switch Component */ +.switch-wrapper { + position: relative; + display: inline-block; + width: 44px; + height: 24px; + cursor: pointer; +} + +.switch-input { + opacity: 0; + width: 0; + height: 0; + position: absolute; +} + +.switch-slider { + position: absolute; + cursor: pointer; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: var(--input-border); + transition: 0.3s; + border-radius: 24px; +} + +.switch-slider:before { + position: absolute; + content: ""; + height: 18px; + width: 18px; + left: 3px; + bottom: 3px; + background-color: white; + transition: 0.3s; + border-radius: 50%; +} + +.switch-input:checked + .switch-slider { + background-color: var(--accent); +} + +.switch-input:checked + .switch-slider:before { + transform: translateX(20px); +} + /* Tabs */ .tabs { display: flex; - gap: 6px; - padding: 6px; - border-radius: 12px; - background: var(--section-bg); - border: 1px solid var(--input-border); - box-shadow: var(--shadow-sm); - margin-bottom: 8px; + align-items: center; + gap: 4px; + padding: 12px 16px; + border-bottom: 1px solid var(--input-border); + background: transparent; + flex-shrink: 0; } .tab-button { flex: 1; - background: transparent; - border: 1px solid transparent; - border-bottom: none; - padding: 8px 6px; - font-size: 0.75em; - font-weight: 500; - color: var(--text-color); - opacity: 0.6; - cursor: pointer; display: flex; align-items: center; justify-content: center; - gap: 4px; - margin-bottom: 0; + gap: 6px; + padding: 6px 12px; + font-size: 12px; + font-weight: 500; + color: var(--text-color); + opacity: 0.6; + background: transparent; + border: none; + border-radius: 6px; + cursor: pointer; transition: all 0.2s; - border-radius: 10px; } .tab-button:hover { opacity: 0.9; - background: var(--highlight-tag); + background: var(--section-bg); } .tab-button.active { opacity: 1; - background: var(--accent); - color: var(--accent-text); - border-color: transparent; - box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2); + background: var(--section-bg); + color: var(--text-color); } .tab-button i { - font-size: 0.9em; + font-size: 14px; } +/* Tab Content */ .tab-content { display: none; - flex-direction: column; - gap: 8px; flex: 1; overflow: hidden; - min-height: 0; } .tab-content.active { display: flex; -} - -/* Header */ -.header-bar { - display: flex; - justify-content: space-between; - align-items: center; - padding: 12px 14px; - background: linear-gradient(145deg, var(--section-bg) 0%, var(--input-bg) 100%); - border-radius: 14px; - border: 1px solid var(--highlight-tag-border); - color: var(--text-color); - font-weight: 600; - font-size: 0.95em; - margin-bottom: 0; - box-shadow: var(--shadow); - letter-spacing: -0.02em; -} - -.header-bar .title { - display: flex; - align-items: center; - gap: 6px; -} - -.header-bar .title i { - color: var(--accent); - font-size: 1em; -} - -.icon-toggles { - display: flex; - gap: 4px; -} - -/* GLOBAL HIGHLIGHT ICON: toggle-on/off */ -.global-icon::before { - content: "\f204"; -} - -#globalHighlightToggle:checked+.global-icon::before { - content: "\f205"; -} - -/* Sections */ -.section { - background: var(--section-bg); - border: 1px solid var(--highlight-tag-border); - border-radius: 14px; - padding: 12px; - box-shadow: var(--shadow); - display: flex; flex-direction: column; } -.section:hover { - box-shadow: var(--shadow); -} - -.section[data-section="wordlist"] { +.tab-inner { flex: 1; - overflow: hidden; + overflow-y: auto; + padding: 20px; + display: flex; + flex-direction: column; + gap: 16px; min-height: 0; - display: grid; - grid-template-rows: auto auto auto 1fr auto; - row-gap: 6px; } -.selection-hint { - font-size: 0.7em; - opacity: 0.6; - text-align: center; - font-style: italic; - padding: 4px 0 0 0; -} - -.section[data-section="addwords"] textarea { - height: 44px; -} - -.section h3 { - font-size: 0.85em; - margin: 0 0 8px 0; - font-weight: 600; - display: flex; - align-items: center; - gap: 6px; - letter-spacing: -0.01em; - color: var(--text-color); - opacity: 0.9; -} - -input[type="text"], -textarea, -select { - margin-top: 4px; - margin-bottom: 6px; -} - -textarea { - resize: none; - height: 60px; -} - -input[type="color"] { - box-shadow: var(--shadow-sm); - width: 24px; - height: 24px; - margin-left: 6px; -} - -.color-row { +/* Lists Tab Styles */ +.list-selector-section { display: flex; + flex-direction: column; gap: 12px; - align-items: center; - margin-bottom: 8px; - margin-top: 4px; } -.color-label { +.list-selector-row { + display: flex; + gap: 8px; +} + +.list-dropdown-wrapper { + flex: 1; + position: relative; +} + +.list-dropdown-button { + width: 100%; + height: 40px; display: flex; align-items: center; - gap: 6px; - font-size: 0.8em; - font-weight: 500; + justify-content: space-between; + padding: 0 12px; + background: var(--input-bg); + border: 1px solid var(--input-border); + border-radius: 8px; + cursor: pointer; + transition: all 0.2s; + font-size: 14px; + color: var(--text-color); } - - -button { - padding: 8px 12px; - font-size: 0.8em; +.list-dropdown-button:hover { + background: var(--section-bg); } -.button-row { +.list-dropdown-content { display: flex; - gap: 6px; - flex-wrap: wrap; - margin-top: 6px; - margin-bottom: 8px; align-items: center; + gap: 8px; } -.section[data-section="wordlist"] .button-row { - flex-wrap: wrap; - overflow: visible; - gap: 4px; - margin: 0; -} - -.section[data-section="wordlist"] .button-row button { - padding: 6px 8px; - font-size: 0.72em; -} - -.button-row button { +.list-color-indicator { + width: 12px; + height: 12px; + border-radius: 50%; flex-shrink: 0; } -.button-row label { - display: flex; - align-items: center; - gap: 6px; - cursor: pointer; - font-size: 0.8em; - padding: 6px 10px; - border-radius: 999px; - border: 1px solid var(--input-border); - background: var(--input-bg); +.list-dropdown-text { + font-size: 14px; + color: var(--text-color); } -.button-row label:hover { - background: var(--highlight-tag); - border-color: var(--highlight-tag-border); +.list-dropdown-button i { + font-size: 16px; + color: var(--text-color); + opacity: 0.6; } -.button-row input[type="checkbox"] { - margin: 0; - vertical-align: middle; -} - -input[type="file"] { +.list-dropdown-menu { display: none; -} - -/* Word List */ -#wordSearch { - width: 100%; - margin: 0; -} - -#wordList { - margin-top: 6px; - position: relative; - overflow-y: auto; - overflow-x: hidden; - flex: 1 1 auto; - min-height: 0; - height: 100%; - max-height: 100%; - box-sizing: border-box; + position: absolute; + top: 100%; + left: 0; + right: 0; + margin-top: 4px; + background: var(--input-bg); border: 1px solid var(--input-border); - border-radius: 12px; - background: var(--section-bg); - padding: 6px; -} - -#wordList .word-item { - width: calc(100% - 8px); - left: 4px; - height: 34px; - display: grid; - grid-template-columns: 1fr auto auto auto auto; - align-items: center; - gap: 6px; - padding: 6px 8px; - box-sizing: border-box; border-radius: 8px; - background: var(--input-bg); - border: 2px solid transparent; - transition: all 0.2s; - cursor: pointer; + box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); + z-index: 100; + max-height: 200px; + overflow-y: auto; } -#wordList .word-item:hover { - background: var(--highlight-tag); - border-color: rgba(242, 168, 101, 0.3); - box-shadow: var(--shadow-sm); -} - -#wordList .word-item.selected { - background: rgba(242, 168, 101, 0.15); - border-color: rgba(242, 168, 101, 0.6); -} - -#wordList .word-item.disabled { - opacity: 0.5; - background: var(--section-bg); -} - -#wordList .word-item.disabled:hover { - opacity: 0.65; -} - -#wordList .word-item.disabled .word-text { - text-decoration: line-through; -} - -#wordList .word-text { - font-size: 0.8em; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - user-select: none; - min-width: 0; -} - -#wordList .word-text.editing { - display: none; -} - -#wordList .word-edit-input { - display: none; - min-width: 0; - width: 100%; - background-color: var(--section-bg) !important; - color: var(--text-color) !important; - border: 1px solid var(--accent) !important; - padding: 4px 6px; - border-radius: 6px; - font-size: 0.8em; - transition: border-color 0.2s; - margin: 0; -} - -#wordList .word-edit-input.active { +.list-dropdown-menu.open { display: block; } -#wordList .word-edit-input:focus { - border-color: var(--accent) !important; - outline: none; -} - -#wordList .word-actions { +.list-dropdown-item { display: flex; - gap: 4px; align-items: center; - pointer-events: auto; -} - -#wordList .word-actions > * { - pointer-events: auto; -} - -#wordList .icon-btn { - background: transparent; - border: none; - color: var(--text-color); - opacity: 0.6; + gap: 8px; + padding: 10px 12px; cursor: pointer; - padding: 3px 5px; - border-radius: 4px; - transition: all 0.2s ease; - font-size: 0.75em; + transition: background 0.2s; +} + +.list-dropdown-item:hover { + background: var(--section-bg); +} + +.list-dropdown-item.selected { + background: var(--section-bg); +} + +.list-dropdown-item-check { + margin-left: auto; + color: var(--accent); + font-size: 16px; +} + +.icon-button { + width: 40px; + height: 40px; display: flex; align-items: center; justify-content: center; - min-width: 22px; - min-height: 22px; + background: var(--input-bg); + border: 1px solid var(--input-border); + border-radius: 8px; + cursor: pointer; + transition: all 0.2s; + flex-shrink: 0; } -#wordList .icon-btn:hover { - opacity: 1; - background: rgba(242, 168, 101, 0.15); +.icon-button:hover { + background: var(--section-bg); +} + +.icon-button.danger:hover { + background: rgba(239, 68, 68, 0.1); + color: var(--danger); + border-color: rgba(239, 68, 68, 0.5); +} + +.icon-button i { + font-size: 16px; + color: var(--text-color); +} + +.icon-button.danger i { + color: var(--text-color); +} + +.icon-button.danger:hover i { + color: var(--danger); +} + +.manage-lists-btn { + width: 100%; + height: 36px; + display: flex; + align-items: center; + justify-content: center; + gap: 8px; + background: var(--input-bg); + border: 1px solid var(--input-border); + border-radius: 8px; + cursor: pointer; + transition: all 0.2s; + font-size: 14px; + color: var(--text-color); +} + +.manage-lists-btn:hover { + background: var(--section-bg); +} + +.manage-lists-btn i { + font-size: 16px; +} + +/* Color Pickers */ +.color-pickers-row { + display: flex; + gap: 16px; +} + +.color-picker-group { + flex: 1; + display: flex; + flex-direction: column; + gap: 6px; +} + +.color-picker-label { + font-size: 12px; + color: var(--text-color); + opacity: 0.6; +} + +.color-picker-input-group { + display: flex; + align-items: center; + gap: 8px; +} + +.color-picker-swatch { + width: 40px; + height: 40px; + border-radius: 8px; + border: 2px solid var(--input-border); + cursor: pointer; + background: transparent; + padding: 0; +} + +.color-picker-swatch::-webkit-color-swatch-wrapper { + padding: 0; + border-radius: 6px; +} + +.color-picker-swatch::-webkit-color-swatch { + border: none; + border-radius: 6px; +} + +.color-picker-text { + flex: 1; + height: 40px; + padding: 0 12px; + background: var(--input-bg); + border: 1px solid var(--input-border); + border-radius: 8px; + font-size: 14px; + font-family: 'Courier New', monospace; + text-transform: uppercase; + color: var(--text-color); +} + +.color-picker-text:focus { + outline: none; + border-color: var(--accent); +} + +/* Preview */ +.preview-section { + display: flex; + flex-direction: column; + gap: 6px; +} + +.preview-label { + font-size: 12px; + color: var(--text-color); + opacity: 0.6; +} + +.preview-box { + padding: 12px; + background: var(--input-bg); + border: 1px solid var(--input-border); + border-radius: 8px; +} + +.preview-text { + font-size: 14px; + color: var(--text-color); + opacity: 0.6; + line-height: 1.5; +} + +.preview-highlight { + padding: 2px 4px; + border-radius: 4px; +} + +/* Enable Toggle */ +.enable-toggle-section { + padding: 12px; + background: var(--input-bg); + border: 1px solid var(--input-border); + border-radius: 8px; +} + +.enable-toggle-content { + display: flex; + align-items: center; + justify-content: space-between; +} + +.enable-toggle-text { + display: flex; + flex-direction: column; + gap: 2px; +} + +.enable-toggle-title { + font-size: 14px; + font-weight: 500; + color: var(--text-color); +} + +.enable-toggle-subtitle { + font-size: 12px; + color: var(--text-color); + opacity: 0.6; +} + +/* Apply Button */ +.apply-button { + width: 100%; + height: 40px; + display: flex; + align-items: center; + justify-content: center; + gap: 8px; + background: var(--accent); + color: var(--accent-text); + border: none; + border-radius: 8px; + cursor: pointer; + font-size: 14px; + font-weight: 500; + transition: all 0.2s; +} + +.apply-button:hover { + background: var(--accent-hover); +} + +.apply-button i { + font-size: 16px; +} + +/* Words Tab Styles */ +.add-words-section { + display: flex; + flex-direction: column; + gap: 8px; +} + +.section-label { + display: flex; + align-items: center; + gap: 6px; + font-size: 12px; + font-weight: 500; + color: var(--text-color); + opacity: 0.6; + text-transform: uppercase; + letter-spacing: 0.5px; +} + +.section-label i { + font-size: 14px; +} + +.word-count-badge { color: var(--accent); + opacity: 1; } -#wordList .icon-btn i { +.add-words-textarea { + min-height: 72px; + padding: 10px 12px; + background: var(--input-bg); + border: 1px solid var(--input-border); + border-radius: 8px; + font-size: 14px; + color: var(--text-color); + font-family: inherit; + resize: none; + line-height: 1.5; +} + +.add-words-textarea:focus { + outline: none; + border-color: var(--accent); +} + +.add-words-button { + width: 100%; + height: 36px; + display: flex; + align-items: center; + justify-content: center; + background: var(--accent); + color: var(--accent-text); + border: none; + border-radius: 8px; + cursor: pointer; + font-size: 14px; + font-weight: 500; + transition: all 0.2s; +} + +.add-words-button:hover { + background: var(--accent-hover); +} + +.add-words-button:disabled { + opacity: 0.5; + cursor: not-allowed; +} + +/* Word List Section */ +.word-list-section { + display: flex; + flex-direction: column; + gap: 8px; + flex: 1; + min-height: 0; +} + +.word-list-header { + display: flex; + align-items: center; + justify-content: space-between; +} + +.word-actions-row { + display: flex; + flex-wrap: wrap; + gap: 6px; +} + +.word-action-btn { + height: 28px; + padding: 0 10px; + background: var(--input-bg); + border: 1px solid var(--input-border); + border-radius: 6px; + cursor: pointer; + font-size: 12px; + color: var(--text-color); + transition: all 0.2s; +} + +.word-action-btn:hover { + background: var(--section-bg); +} + +.word-action-btn:disabled { + opacity: 0.5; + cursor: not-allowed; +} + +.word-action-btn.danger { + background: rgba(239, 68, 68, 0.1); + border-color: rgba(239, 68, 68, 0.3); + color: var(--danger); +} + +.word-action-btn.danger:hover { + background: rgba(239, 68, 68, 0.2); +} + +/* Word Search */ +.word-search-wrapper { + position: relative; +} + +.word-search-icon { + position: absolute; + left: 12px; + top: 50%; + transform: translateY(-50%); + font-size: 16px; + color: var(--text-color); + opacity: 0.6; pointer-events: none; } -#wordList .toggle-btn { - width: 32px; - height: 18px; - background: rgba(255, 255, 255, 0.1); +.word-search-input { + width: 100%; + height: 36px; + padding: 0 12px 0 36px; + background: var(--input-bg); border: 1px solid var(--input-border); - border-radius: 9px; - position: relative; - cursor: pointer; - transition: all 0.2s ease; - padding: 0; - flex-shrink: 0; + border-radius: 8px; + font-size: 14px; + color: var(--text-color); } -#wordList .toggle-btn::after { - content: ''; - position: absolute; - width: 12px; - height: 12px; - background: var(--text-color); - border-radius: 50%; - top: 2px; - left: 2px; - transition: all 0.2s ease; -} - -#wordList .toggle-btn.active { - background: var(--accent); +.word-search-input:focus { + outline: none; border-color: var(--accent); } -#wordList .toggle-btn.active::after { - left: 16px; - background: var(--accent-text); -} - -#wordList input[type="color"] { - width: 22px; - height: 22px; - padding: 0; - border-radius: 3px; - border: 1px solid var(--input-border); - cursor: pointer; - transition: all 0.2s; - align-self: center; - flex-shrink: 0; -} - -#wordList input[type="color"]:hover { - border-color: var(--accent); - transform: scale(1.05); -} - -#wordCount { - font-weight: normal; - margin-left: -8px; - margin-right: -8px; -} - -/* Exception Panel */ -.section[data-section="exceptions"] { - flex: 1; - overflow: hidden; - min-height: 0; -} - -.exceptions-list { +/* Word List Container */ +.word-list-container { flex: 1; overflow-y: auto; - margin: 8px 0; - border: 1px solid var(--input-border); - border-radius: 12px; background: var(--input-bg); + border: 1px solid var(--input-border); + border-radius: 8px; + max-height: 180px; min-height: 0; } -.exception-item { - display: flex; - justify-content: space-between; - align-items: center; - gap: 10px; - padding: 8px 12px; - border-bottom: none; - font-size: 0.85em; -} - -.exception-item:nth-child(odd) { - background: var(--section-bg); -} - -.exception-item:nth-child(even) { - background: var(--input-bg); -} - -.exception-item:hover { - background: var(--highlight-tag) !important; -} - -.exception-domain { - flex: 1; - word-break: break-word; - font-family: inherit; - font-size: 1em; - line-height: 1.4; - display: flex; - align-items: center; -} - -.exception-remove { - background: var(--danger); - color: white; - border: none; - padding: 4px 10px; - border-radius: 4px; - cursor: pointer; - font-size: 0.75em; - font-weight: 500; - white-space: nowrap; - flex-shrink: 0; - display: flex; - align-items: center; - justify-content: center; -} - -.exception-remove:hover { - background: #dc2626; -} - -/* Footer */ -.footer { - padding: 10px 12px; - border-top: 1px solid var(--highlight-tag-border); - background: var(--section-bg); - flex-shrink: 0; - box-shadow: 0 -6px 14px rgba(0, 0, 0, 0.12); -} - -.footer-content { - display: flex; - justify-content: space-between; - align-items: center; - font-size: 0.75em; +.word-list-empty { + padding: 24px; + text-align: center; + font-size: 14px; color: var(--text-color); opacity: 0.6; } -.version { - font-weight: 500; - font-family: 'Courier New', monospace; +.word-item { + display: flex; + align-items: center; + gap: 8px; + padding: 8px 12px; + cursor: pointer; + transition: all 0.2s; + border-bottom: 1px solid var(--input-border); } -.github-link { +.word-item:last-child { + border-bottom: none; +} + +.word-item:hover { + background: var(--highlight-tag); +} + +.word-item.selected { + background: var(--section-bg); +} + +.word-item-checkbox { + width: 16px; + height: 16px; + border: 1.5px solid var(--text-color); + border-radius: 4px; + cursor: pointer; + flex-shrink: 0; + opacity: 0.6; + position: relative; + background: transparent; +} + +.word-item-checkbox.checked { + background: var(--accent); + border-color: var(--accent); + opacity: 1; +} + +.word-item-checkbox.checked::after { + content: "✓"; + position: absolute; + top: -3px; + left: 2px; + color: white; + font-size: 12px; + font-weight: bold; +} + +.word-item-text { + flex: 1; + font-size: 14px; + color: var(--text-color); + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + min-width: 0; +} + +.word-item-edit-input { + flex: 1; + height: 28px; + padding: 0 8px; + background: var(--bg-color); + border: 1px solid var(--accent); + border-radius: 4px; + font-size: 14px; + color: var(--text-color); +} + +.word-item-edit-input:focus { + outline: none; +} + +.word-item-actions { display: flex; align-items: center; gap: 4px; - color: var(--text-color); - text-decoration: none; - padding: 3px 6px; +} + +.word-item-icon-btn { + width: 28px; + height: 28px; + display: flex; + align-items: center; + justify-content: center; + background: transparent; + border: none; + cursor: pointer; border-radius: 4px; - border: 1px solid transparent; + transition: all 0.2s; + color: var(--text-color); + opacity: 0.6; + flex-shrink: 0; } -.github-link:hover { +.word-item-icon-btn:hover { opacity: 1; - color: var(--accent); background: var(--highlight-tag); - border-color: var(--highlight-tag-border); + color: var(--accent); } +.word-item-icon-btn i { + font-size: 14px; +} +.word-item-color-picker { + width: 28px; + height: 28px; + border-radius: 4px; + border: 1px solid var(--input-border); + cursor: pointer; + background: transparent; + padding: 0; + flex-shrink: 0; +} -/* Page Highlights Section */ -.section[data-section="page-highlights"] { +.word-item-color-picker::-webkit-color-swatch-wrapper { + padding: 0; + border-radius: 3px; +} + +.word-item-color-picker::-webkit-color-swatch { + border: none; + border-radius: 3px; +} + +.word-item-color-picker:hover { + border-color: var(--accent); +} + +.word-item-switch { + flex-shrink: 0; +} + +.word-list-hint { + font-size: 12px; + color: var(--text-color); + opacity: 0.6; + text-align: center; +} + +/* Empty State */ +.empty-state { + flex: 1; + display: flex; + align-items: center; + justify-content: center; + padding: 32px; + text-align: center; +} + +.empty-state p { + font-size: 14px; + color: var(--text-color); + opacity: 0.6; +} + +/* Page Highlights Tab */ +.page-highlights-section { + display: flex; + flex-direction: column; + gap: 12px; flex: 1; - overflow: hidden; min-height: 0; } -.page-highlights-info { - font-size: 0.85em; - padding: 8px 10px; +.page-highlights-info-card { + display: flex; + align-items: center; + justify-content: space-between; + padding: 12px 16px; background: var(--input-bg); - border-radius: 10px; border: 1px solid var(--input-border); - margin-bottom: 8px; + border-radius: 8px; + font-size: 14px; + color: var(--text-color); +} + +.page-highlights-info-card strong { + font-weight: 600; + color: var(--accent); +} + +.refresh-button { + width: 100%; + height: 36px; + display: flex; + align-items: center; + justify-content: center; + gap: 8px; + background: var(--input-bg); + border: 1px solid var(--input-border); + border-radius: 8px; + cursor: pointer; + font-size: 14px; + color: var(--text-color); + transition: all 0.2s; +} + +.refresh-button:hover { + background: var(--section-bg); +} + +.refresh-button i { + font-size: 16px; } .page-highlights-list { flex: 1; overflow-y: auto; - margin-top: 8px; - border: 1px solid var(--input-border); - border-radius: 12px; background: var(--input-bg); + border: 1px solid var(--input-border); + border-radius: 8px; min-height: 0; } +.page-highlights-empty { + padding: 24px; + text-align: center; + font-size: 14px; + color: var(--text-color); + opacity: 0.6; +} + .page-highlight-item { display: flex; - justify-content: space-between; align-items: center; - gap: 8px; - padding: 10px 12px; + justify-content: space-between; + gap: 12px; + padding: 12px; border-bottom: 1px solid var(--input-border); - font-size: 0.85em; cursor: pointer; transition: all 0.2s; } @@ -663,7 +954,7 @@ input[type="file"] { } .page-highlight-item:hover { - background: var(--highlight-tag); + background: var(--section-bg); border-left: 3px solid var(--accent); padding-left: 9px; } @@ -673,23 +964,30 @@ input[type="file"] { display: flex; align-items: center; gap: 8px; - word-break: break-word; - font-weight: 500; + min-width: 0; } .page-highlight-preview { display: inline-block; - padding: 2px 6px; - border-radius: 3px; - font-size: 0.9em; + padding: 3px 8px; + border-radius: 4px; + font-size: 13px; + font-weight: 500; +} + +.page-highlight-position { + font-size: 11px; + color: var(--text-color); + opacity: 0.6; + margin-left: 4px; } .page-highlight-count { background: var(--accent); color: var(--accent-text); - padding: 2px 8px; + padding: 3px 10px; border-radius: 12px; - font-size: 0.75em; + font-size: 12px; font-weight: 600; flex-shrink: 0; } @@ -701,22 +999,291 @@ input[type="file"] { } .page-highlight-nav button { - padding: 4px 8px; - font-size: 0.75em; - min-width: 28px; + width: 32px; + height: 32px; + display: flex; + align-items: center; + justify-content: center; + background: var(--input-bg); + border: 1px solid var(--input-border); + border-radius: 6px; + cursor: pointer; + transition: all 0.2s; + padding: 0; } -.page-highlight-position { - font-size: 0.7em; +.page-highlight-nav button:hover { + background: var(--section-bg); + border-color: var(--accent); +} + +.page-highlight-nav button i { + font-size: 14px; + color: var(--text-color); +} + +/* Exceptions Tab */ +.exceptions-section { + display: flex; + flex-direction: column; + gap: 12px; + flex: 1; + min-height: 0; +} + +.exception-toggle-btn { + width: 100%; + height: 40px; + display: flex; + align-items: center; + justify-content: center; + gap: 8px; + background: var(--input-bg); + border: 1px solid var(--input-border); + border-radius: 8px; + cursor: pointer; + font-size: 14px; + color: var(--text-color); + transition: all 0.2s; +} + +.exception-toggle-btn:hover { + background: var(--section-bg); +} + +.exception-toggle-btn.danger { + background: rgba(239, 68, 68, 0.1); + border-color: rgba(239, 68, 68, 0.3); + color: var(--danger); +} + +.exception-toggle-btn.danger:hover { + background: rgba(239, 68, 68, 0.2); +} + +.exception-toggle-btn i { + font-size: 16px; +} + +.exceptions-list-wrapper { + display: flex; + flex-direction: column; + gap: 8px; + flex: 1; + min-height: 0; +} + +.exceptions-list { + flex: 1; + overflow-y: auto; + background: var(--input-bg); + border: 1px solid var(--input-border); + border-radius: 8px; + min-height: 0; +} + +.exception-item { + display: flex; + align-items: center; + justify-content: space-between; + gap: 12px; + padding: 12px; + border-bottom: 1px solid var(--input-border); + transition: background 0.2s; +} + +.exception-item:last-child { + border-bottom: none; +} + +.exception-item:hover { + background: var(--section-bg); +} + +.exception-domain { + flex: 1; + font-size: 14px; + color: var(--text-color); + word-break: break-word; + line-height: 1.4; +} + +.exception-remove { + background: var(--danger); + color: white; + border: none; + padding: 6px 12px; + border-radius: 6px; + cursor: pointer; + font-size: 12px; + font-weight: 500; + white-space: nowrap; + flex-shrink: 0; + transition: all 0.2s; +} + +.exception-remove:hover { + background: #dc2626; +} + +.clear-exceptions-btn { + width: 100%; + height: 40px; + display: flex; + align-items: center; + justify-content: center; + gap: 8px; + background: rgba(239, 68, 68, 0.1); + border: 1px solid rgba(239, 68, 68, 0.3); + color: var(--danger); + border-radius: 8px; + cursor: pointer; + font-size: 14px; + transition: all 0.2s; +} + +.clear-exceptions-btn:hover { + background: rgba(239, 68, 68, 0.2); +} + +.clear-exceptions-btn i { + font-size: 16px; +} + +/* Options Tab */ +.options-section { + display: flex; + flex-direction: column; + gap: 16px; +} + +.options-checkboxes { + display: flex; + flex-direction: column; + gap: 12px; + padding: 12px; + background: var(--input-bg); + border: 1px solid var(--input-border); + border-radius: 8px; +} + +.option-checkbox-label { + display: flex; + align-items: center; + gap: 10px; + cursor: pointer; + font-size: 14px; + color: var(--text-color); +} + +.option-checkbox { + width: 18px; + height: 18px; + border: 2px solid var(--input-border); + border-radius: 4px; + cursor: pointer; + flex-shrink: 0; + appearance: none; + background: var(--input-bg); + position: relative; +} + +.option-checkbox:checked { + background: var(--accent); + border-color: var(--accent); +} + +.option-checkbox:checked::after { + content: "✓"; + position: absolute; + top: -2px; + left: 3px; + color: white; + font-size: 14px; + font-weight: bold; +} + +.options-buttons { + display: flex; + gap: 8px; +} + +.option-button { + flex: 1; + height: 40px; + display: flex; + align-items: center; + justify-content: center; + gap: 8px; + background: var(--input-bg); + border: 1px solid var(--input-border); + border-radius: 8px; + cursor: pointer; + font-size: 14px; + color: var(--text-color); + transition: all 0.2s; +} + +.option-button:hover { + background: var(--section-bg); +} + +.option-button i { + font-size: 16px; +} + +/* Footer */ +.footer { + display: flex; + align-items: center; + justify-content: space-between; + padding: 12px 20px; + border-top: 1px solid var(--input-border); + background: var(--section-bg); + flex-shrink: 0; +} + +.footer-version { + font-size: 12px; color: var(--text-color); opacity: 0.6; - margin-left: 4px; } -.page-highlights-empty { - padding: 20px; - text-align: center; +.footer-link { + display: flex; + align-items: center; + gap: 6px; + font-size: 12px; color: var(--text-color); - opacity: 0.5; - font-size: 0.85em; + opacity: 0.6; + text-decoration: none; + transition: all 0.2s; +} + +.footer-link:hover { + opacity: 1; + color: var(--accent); +} + +.footer-link i { + font-size: 14px; +} + +/* Scrollbar Styles */ +::-webkit-scrollbar { + width: 8px; + height: 8px; +} + +::-webkit-scrollbar-track { + background: transparent; +} + +::-webkit-scrollbar-thumb { + background: var(--input-border); + border-radius: 4px; +} + +::-webkit-scrollbar-thumb:hover { + background: var(--accent); } diff --git a/popup/popup.html b/popup/popup.html index d447b20..77e0331 100644 --- a/popup/popup.html +++ b/popup/popup.html @@ -4,160 +4,292 @@ - Goose Highlighter + Goose Highlighter -
-
+