termsearch 0.3.6 → 0.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/frontend/dist/app.js +15 -8
- package/frontend/dist/style.css +48 -5
- package/package.json +1 -1
package/frontend/dist/app.js
CHANGED
|
@@ -208,6 +208,7 @@ function svg(paths, size = 16, extra = '') {
|
|
|
208
208
|
|
|
209
209
|
const ICONS = {
|
|
210
210
|
search: svg('<circle cx="11" cy="11" r="8"/><path d="m21 21-4.35-4.35"/>'),
|
|
211
|
+
filter: svg('<polygon points="22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"/>'),
|
|
211
212
|
settings: svg('<circle cx="12" cy="12" r="3"/><path d="M12 2v3m0 14v3M2 12h3m14 0h3m-3.7-8.3-2.1 2.1m-8.4 8.4-2.1 2.1m12.5 0-2.1-2.1M5.7 5.7 3.6 3.6"/>'),
|
|
212
213
|
theme: svg('<circle cx="12" cy="12" r="5"/><path d="M12 1v2m0 18v2M4.22 4.22l1.42 1.42m12.72 12.72 1.42 1.42M1 12h2m18 0h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42"/>'),
|
|
213
214
|
back: svg('<path d="M19 12H5"/><path d="m12 5-7 7 7 7"/>'),
|
|
@@ -314,13 +315,19 @@ function LangPicker() {
|
|
|
314
315
|
return wrap;
|
|
315
316
|
}
|
|
316
317
|
|
|
317
|
-
function EnginePicker() {
|
|
318
|
-
const
|
|
318
|
+
function EnginePicker(opts = {}) {
|
|
319
|
+
const compact = Boolean(opts.compact);
|
|
320
|
+
const details = el('details', { className: `engine-picker${compact ? ' engine-picker-compact' : ''}` });
|
|
319
321
|
const selectedCount = state.selectedEngines.length;
|
|
320
|
-
const summary =
|
|
321
|
-
el('
|
|
322
|
-
|
|
323
|
-
|
|
322
|
+
const summary = compact
|
|
323
|
+
? el('summary', { className: 'engine-picker-summary engine-picker-summary-icon', title: 'Search engines' },
|
|
324
|
+
iconEl('filter', 'engine-filter-icon'),
|
|
325
|
+
selectedCount ? el('span', { className: 'engine-picker-count' }, String(selectedCount)) : null,
|
|
326
|
+
)
|
|
327
|
+
: el('summary', { className: 'engine-picker-summary' },
|
|
328
|
+
el('span', { className: 'engine-picker-title' }, selectedCount ? `Engines (${selectedCount})` : 'Engines (all)'),
|
|
329
|
+
iconEl('chevron', 'engine-chevron'),
|
|
330
|
+
);
|
|
324
331
|
|
|
325
332
|
const body = el('div', { className: 'engine-picker-body' });
|
|
326
333
|
const presetRow = el('div', { className: 'engine-preset-row' });
|
|
@@ -1021,6 +1028,7 @@ function renderApp() {
|
|
|
1021
1028
|
el('div', { className: 'header-search' }, SearchForm(state.query, (q, cat) => { state.query = q; doSearch(q, cat); })),
|
|
1022
1029
|
el('div', { className: 'header-nav' },
|
|
1023
1030
|
LangPicker(),
|
|
1031
|
+
EnginePicker({ compact: true }),
|
|
1024
1032
|
el('button', { className: 'btn-icon', title: 'Settings', onClick: () => navigate('#/settings') }, iconEl('settings')),
|
|
1025
1033
|
el('button', { className: 'btn-icon', title: 'Toggle theme', onClick: toggleTheme }, iconEl('theme')),
|
|
1026
1034
|
),
|
|
@@ -1047,20 +1055,19 @@ function renderApp() {
|
|
|
1047
1055
|
});
|
|
1048
1056
|
};
|
|
1049
1057
|
buildCatTabs(categoryBar);
|
|
1050
|
-
categoryBar.append(EnginePicker());
|
|
1051
1058
|
|
|
1052
1059
|
const mobileTabs = el('div', { className: 'mobile-bar-tabs' });
|
|
1053
1060
|
buildCatTabs(mobileTabs);
|
|
1054
1061
|
const mobileBar = el('div', { className: 'mobile-bar' },
|
|
1055
1062
|
el('div', { className: 'mobile-bar-search' }, SearchForm(state.query, (q, cat) => { state.query = q; doSearch(q, cat); })),
|
|
1056
1063
|
mobileTabs,
|
|
1057
|
-
el('div', { className: 'mobile-bar-engine' }, EnginePicker()),
|
|
1058
1064
|
el('div', { className: 'mobile-bar-row' },
|
|
1059
1065
|
el('div', {
|
|
1060
1066
|
className: 'mobile-logo',
|
|
1061
1067
|
onClick: () => { state.query = ''; state.category = 'web'; navigate('#/'); renderApp(); },
|
|
1062
1068
|
}, 'Term', el('strong', {}, 'Search')),
|
|
1063
1069
|
LangPicker(),
|
|
1070
|
+
EnginePicker({ compact: true }),
|
|
1064
1071
|
el('button', { className: 'btn-icon', title: 'Settings', onClick: () => navigate('#/settings') }, iconEl('settings')),
|
|
1065
1072
|
el('button', { className: 'btn-icon', title: 'Toggle theme', onClick: toggleTheme }, iconEl('theme')),
|
|
1066
1073
|
),
|
package/frontend/dist/style.css
CHANGED
|
@@ -161,7 +161,6 @@ a:hover { color: var(--link-h); }
|
|
|
161
161
|
}
|
|
162
162
|
|
|
163
163
|
.engine-picker {
|
|
164
|
-
margin-left: auto;
|
|
165
164
|
position: relative;
|
|
166
165
|
}
|
|
167
166
|
.engine-picker summary {
|
|
@@ -182,6 +181,43 @@ a:hover { color: var(--link-h); }
|
|
|
182
181
|
font-size: 11px;
|
|
183
182
|
cursor: pointer;
|
|
184
183
|
}
|
|
184
|
+
.engine-picker-summary-icon {
|
|
185
|
+
width: 32px;
|
|
186
|
+
height: 32px;
|
|
187
|
+
padding: 0;
|
|
188
|
+
border-radius: var(--radius-sm);
|
|
189
|
+
justify-content: center;
|
|
190
|
+
background: transparent;
|
|
191
|
+
color: var(--text3);
|
|
192
|
+
border-color: var(--border);
|
|
193
|
+
position: relative;
|
|
194
|
+
}
|
|
195
|
+
.engine-picker-summary-icon:hover {
|
|
196
|
+
border-color: #3a3a3a;
|
|
197
|
+
color: var(--text2);
|
|
198
|
+
}
|
|
199
|
+
.engine-filter-icon {
|
|
200
|
+
display: inline-flex;
|
|
201
|
+
align-items: center;
|
|
202
|
+
}
|
|
203
|
+
.engine-picker-count {
|
|
204
|
+
position: absolute;
|
|
205
|
+
top: -5px;
|
|
206
|
+
right: -5px;
|
|
207
|
+
min-width: 14px;
|
|
208
|
+
height: 14px;
|
|
209
|
+
border-radius: 999px;
|
|
210
|
+
padding: 0 3px;
|
|
211
|
+
display: inline-flex;
|
|
212
|
+
align-items: center;
|
|
213
|
+
justify-content: center;
|
|
214
|
+
background: rgba(109,40,217,0.95);
|
|
215
|
+
color: #fff;
|
|
216
|
+
border: 1px solid rgba(167,139,250,0.55);
|
|
217
|
+
font-size: 9px;
|
|
218
|
+
font-weight: 700;
|
|
219
|
+
line-height: 1;
|
|
220
|
+
}
|
|
185
221
|
.engine-picker-title {
|
|
186
222
|
white-space: nowrap;
|
|
187
223
|
}
|
|
@@ -962,7 +998,6 @@ a:hover { color: var(--link-h); }
|
|
|
962
998
|
scrollbar-width: none;
|
|
963
999
|
}
|
|
964
1000
|
.mobile-bar-tabs::-webkit-scrollbar { display: none; }
|
|
965
|
-
.mobile-bar-engine { padding: 0 12px 4px; }
|
|
966
1001
|
.mobile-bar-row {
|
|
967
1002
|
display: flex;
|
|
968
1003
|
align-items: center;
|
|
@@ -978,9 +1013,17 @@ a:hover { color: var(--link-h); }
|
|
|
978
1013
|
.main { padding-bottom: calc(20px + var(--mobile-bar-height, 0px) + env(safe-area-inset-bottom, 0px)); }
|
|
979
1014
|
|
|
980
1015
|
.cat-tab { font-size: 10px; padding: 4px 8px; }
|
|
981
|
-
.mobile-bar-
|
|
982
|
-
.
|
|
983
|
-
|
|
1016
|
+
.mobile-bar-row .engine-picker-summary-icon { width: 30px; height: 30px; }
|
|
1017
|
+
.engine-picker-body {
|
|
1018
|
+
position: fixed;
|
|
1019
|
+
left: 10px;
|
|
1020
|
+
right: 10px;
|
|
1021
|
+
width: auto;
|
|
1022
|
+
max-height: min(62vh, 520px);
|
|
1023
|
+
bottom: calc(var(--mobile-bar-height, 0px) + env(safe-area-inset-bottom, 0px) + 10px);
|
|
1024
|
+
top: auto;
|
|
1025
|
+
z-index: 260;
|
|
1026
|
+
}
|
|
984
1027
|
.logo-text { font-size: 15px; }
|
|
985
1028
|
.home-logo { font-size: 40px; }
|
|
986
1029
|
.home-tagline { letter-spacing: 0.08em; margin-bottom: 20px; }
|