Skip to content

Commit 328fbbf

Browse files
authored
Optimize homepage UI and search bar styling and interactions. (#1446)
1 parent 64dbbaf commit 328fbbf

8 files changed

Lines changed: 775 additions & 250 deletions

File tree

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,3 +222,11 @@ pnpm-debug.log*
222222

223223
# These are backup files generated by rustfmt
224224
**/*.rs.bk
225+
.monkeycode
226+
AGENTS.md
227+
.codex
228+
.claude
229+
.aider*
230+
.cursor/
231+
.env
232+
.env.*

extensions/chrome/popup.css

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,64 @@ button {
139139
margin-top: 8px;
140140
}
141141

142+
.search-input-wrapper {
143+
position: relative;
144+
display: flex;
145+
align-items: center;
146+
}
147+
148+
.search-icon {
149+
position: absolute;
150+
left: 10px;
151+
width: 16px;
152+
height: 16px;
153+
color: var(--muted);
154+
pointer-events: none;
155+
}
156+
157+
.search-input-wrapper input {
158+
width: 100%;
159+
padding-left: 34px;
160+
padding-right: 34px;
161+
transition: border-color 0.2s, box-shadow 0.2s;
162+
}
163+
164+
.search-input-wrapper input:focus {
165+
outline: none;
166+
border-color: var(--primary);
167+
box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
168+
}
169+
170+
.search-clear {
171+
position: absolute;
172+
right: 8px;
173+
display: flex;
174+
align-items: center;
175+
justify-content: center;
176+
width: 20px;
177+
height: 20px;
178+
padding: 0;
179+
background: var(--muted);
180+
border: none;
181+
border-radius: 50%;
182+
cursor: pointer;
183+
transition: background-color 0.2s;
184+
}
185+
186+
.search-clear svg {
187+
width: 12px;
188+
height: 12px;
189+
color: #fff;
190+
}
191+
192+
.search-clear:hover {
193+
background: var(--text);
194+
}
195+
196+
.search-clear[hidden] {
197+
display: none;
198+
}
199+
142200
.import-hint {
143201
margin-top: 6px;
144202
font-size: 12px;

extensions/chrome/popup.html

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,23 @@ <h2 data-i18n="import_section">从 CCFDDL 导入</h2>
6262
</div>
6363
<label class="search-label">
6464
<span data-i18n="search_label">搜索会议</span>
65-
<input id="ccfddl-search" type="text" placeholder="例如:ICML / SIGMOD" data-i18n-placeholder="search_placeholder" />
65+
<div class="search-input-wrapper">
66+
<svg class="search-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true">
67+
<circle cx="11" cy="11" r="8" />
68+
<path d="m21 21-4.35-4.35" />
69+
</svg>
70+
<input
71+
id="ccfddl-search"
72+
type="text"
73+
placeholder="例如:ICML / SIGMOD"
74+
data-i18n-placeholder="search_placeholder"
75+
/>
76+
<button id="ccfddl-clear" type="button" class="search-clear" aria-label="清除搜索" hidden>
77+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true">
78+
<path d="M18 6 6 18M6 6l12 12" />
79+
</svg>
80+
</button>
81+
</div>
6682
</label>
6783
<ul id="ccfddl-list" class="import-list"></ul>
6884
<p id="ccfddl-empty" class="empty" data-i18n="import_empty">

extensions/chrome/popup.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const emptyEl = document.getElementById("empty-state");
1111
const countEl = document.getElementById("count");
1212
const loadCcfddlBtn = document.getElementById("load-ccfddl");
1313
const ccfddlSearchInput = document.getElementById("ccfddl-search");
14+
const ccfddlClearBtn = document.getElementById("ccfddl-clear");
1415
const ccfddlList = document.getElementById("ccfddl-list");
1516
const ccfddlEmpty = document.getElementById("ccfddl-empty");
1617
const langToggle = document.getElementById("lang-toggle");
@@ -554,5 +555,14 @@ chrome.storage.local.get({ [LANG_STORAGE_KEY]: "zh" }, (result) => {
554555
});
555556

556557
loadCcfddlBtn.addEventListener("click", loadCcfddlData);
557-
ccfddlSearchInput.addEventListener("input", filterCcfddlList);
558+
ccfddlSearchInput.addEventListener("input", () => {
559+
filterCcfddlList();
560+
ccfddlClearBtn.hidden = !ccfddlSearchInput.value.trim();
561+
});
562+
ccfddlClearBtn.addEventListener("click", () => {
563+
ccfddlSearchInput.value = "";
564+
ccfddlClearBtn.hidden = true;
565+
filterCcfddlList();
566+
ccfddlSearchInput.focus();
567+
});
558568
refreshDeadlinesBtn.addEventListener("click", loadDeadlines);

0 commit comments

Comments
 (0)