diff --git a/static/css/components/search-filter.css b/static/css/components/search-filter.css new file mode 100644 index 00000000..50f7fc40 --- /dev/null +++ b/static/css/components/search-filter.css @@ -0,0 +1,279 @@ +/* Search Container Styles */ +.search-container { + position: relative; + width: 250px; + margin-left: auto; + flex-shrink: 0; /* 防止搜索框被压缩 */ + display: flex; + align-items: center; + gap: 4px; +} + +/* 调整搜索框样式以匹配其他控件 */ +.search-container input { + width: 100%; + padding: 6px 75px 6px 12px; /* Increased right padding to accommodate both buttons */ + border: 1px solid oklch(65% 0.02 256); /* 更深的边框颜色,提高对比度 */ + border-radius: var(--border-radius-sm); + background: var(--lora-surface); + color: var(--text-color); + font-size: 0.9em; + height: 32px; + box-sizing: border-box; /* 确保padding不会增加总宽度 */ +} + +.search-container input:focus { + outline: none; + border-color: var(--lora-accent); +} + +.search-icon { + position: absolute; + right: 80px; /* Adjusted to make space for both toggle buttons */ + top: 50%; + transform: translateY(-50%); + color: oklch(var(--text-color) / 0.5); + pointer-events: none; + line-height: 1; /* 防止图标影响容器高度 */ +} + +/* 修改清空按钮样式 */ +.search-clear { + position: absolute; + right: 105px; /* Adjusted further left to avoid overlapping */ + top: 50%; + transform: translateY(-50%); + color: oklch(var(--text-color) / 0.5); + cursor: pointer; + border: none; + background: none; + padding: 4px 8px; /* 增加点击区域 */ + display: none; /* 默认隐藏 */ + line-height: 1; + transition: color 0.2s ease; +} + +.search-clear:hover { + color: var(--lora-accent); +} + +.search-clear.visible { + display: block; +} + +.search-mode-toggle { + background: var(--lora-surface); + border: 1px solid oklch(65% 0.02 256); + border-radius: var(--border-radius-sm); + color: var(--text-color); + width: 32px; + height: 32px; + padding: 0; + display: flex; + align-items: center; + justify-content: center; + cursor: pointer; + transition: all 0.2s ease; + flex-shrink: 0; +} + +.search-mode-toggle:hover { + background-color: var(--lora-surface-hover, oklch(95% 0.02 256)); + color: var(--lora-accent); + border-color: var(--lora-accent); +} + +.search-mode-toggle.active { + background-color: oklch(95% 0.05 256); /* Lighter background that's more consistent */ + color: var(--lora-accent); + border-color: var(--lora-accent); +} + +.search-mode-toggle i { + font-size: 0.9em; +} + +.search-filter-toggle { + background: var(--lora-surface); + border: 1px solid oklch(65% 0.02 256); + border-radius: var(--border-radius-sm); + color: var(--text-color); + width: 32px; + height: 32px; + padding: 0; + display: flex; + align-items: center; + justify-content: center; + cursor: pointer; + transition: all 0.2s ease; + flex-shrink: 0; + position: relative; +} + +.search-filter-toggle:hover { + background-color: var(--lora-surface-hover, oklch(95% 0.02 256)); + color: var(--lora-accent); + border-color: var(--lora-accent); +} + +.search-filter-toggle.active { + background-color: oklch(95% 0.05 256); /* Lighter background that's more consistent */ + color: var(--lora-accent); + border-color: var(--lora-accent); +} + +.search-filter-toggle i { + font-size: 0.9em; +} + +.filter-badge { + position: absolute; + top: -6px; + right: -6px; + background-color: var(--lora-accent); + color: white; + width: 16px; + height: 16px; + border-radius: 50%; + font-size: 10px; + display: inline-flex; + align-items: center; + justify-content: center; + font-weight: bold; +} + +/* Filter Panel Styles */ +.filter-panel { + position: absolute; + top: 140px; /* Adjust to be closer to the filter button */ + right: 20px; + width: 300px; + background-color: var(--card-bg); + border: 1px solid var(--border-color); + border-radius: var(--border-radius-base); + box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); + z-index: var(--z-overlay); /* Increase z-index to be above cards */ + padding: 16px; + transition: transform 0.3s ease, opacity 0.3s ease; + transform-origin: top right; + max-height: calc(100vh - 160px); + overflow-y: auto; +} + +.filter-panel.hidden { + opacity: 0; + transform: scale(0.95); + pointer-events: none; +} + +.filter-header { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 16px; +} + +.filter-header h3 { + margin: 0; + font-size: 18px; + color: var(--text-color); +} + +.close-filter-btn { + background: none; + border: none; + color: var(--text-color); + cursor: pointer; + font-size: 16px; + padding: 4px; + display: flex; + align-items: center; + justify-content: center; +} + +.close-filter-btn:hover { + color: var(--lora-accent); +} + +.filter-section { + margin-bottom: 16px; +} + +.filter-section h4 { + margin: 0 0 8px 0; + font-size: 14px; + color: var(--text-color); + opacity: 0.8; +} + +.filter-tags { + display: flex; + flex-wrap: wrap; + gap: 6px; +} + +.filter-tag { + padding: 4px 10px; + border-radius: var(--border-radius-sm); + background-color: var(--lora-surface); + border: 1px solid var(--border-color); + color: var(--text-color); + font-size: 14px; + cursor: pointer; + transition: all 0.2s ease; + user-select: none; /* Prevent text selection */ + -webkit-user-select: none; /* For Safari */ + -moz-user-select: none; /* For Firefox */ + -ms-user-select: none; /* For IE/Edge */ +} + +.filter-tag:hover { + background-color: var(--lora-surface-hover); +} + +.filter-tag.active { + background-color: var(--lora-accent); + color: white; + border-color: var(--lora-accent); +} + +/* Filter actions */ +.filter-actions { + display: flex; + justify-content: center; + margin-top: 16px; + gap: 8px; +} + +.clear-filters-btn { + background-color: transparent; + color: var(--text-color); + border: 1px solid var(--border-color); + padding: 6px 12px; + border-radius: var(--border-radius-sm); + font-size: 14px; + cursor: pointer; + transition: background-color 0.2s ease; + width: 100%; +} + +.clear-filters-btn:hover { + background-color: var(--lora-surface-hover); +} + +/* Mobile Responsive Styles */ +@media (max-width: 768px) { + .search-container { + width: 100%; + order: -1; + margin-left: 0; + margin-right: 0; + } + + .filter-panel { + width: calc(100% - 40px); + left: 20px; + right: 20px; + top: 140px; + } +} \ No newline at end of file diff --git a/static/css/layout.css b/static/css/layout.css index cebaf311..32d91605 100644 --- a/static/css/layout.css +++ b/static/css/layout.css @@ -19,148 +19,7 @@ width: 100%; } -.search-container { - position: relative; - width: 250px; - margin-left: auto; - flex-shrink: 0; /* 防止搜索框被压缩 */ - display: flex; - align-items: center; - gap: 4px; -} - -/* 调整搜索框样式以匹配其他控件 */ -.search-container input { - width: 100%; - padding: 6px 75px 6px 12px; /* Increased right padding to accommodate both buttons */ - border: 1px solid oklch(65% 0.02 256); /* 更深的边框颜色,提高对比度 */ - border-radius: var(--border-radius-sm); - background: var(--lora-surface); - color: var(--text-color); - font-size: 0.9em; - height: 32px; - box-sizing: border-box; /* 确保padding不会增加总宽度 */ -} - -.search-container input:focus { - outline: none; - border-color: var(--lora-accent); -} - -.search-icon { - position: absolute; - right: 80px; /* Adjusted to make space for both toggle buttons */ - top: 50%; - transform: translateY(-50%); - color: oklch(var(--text-color) / 0.5); - pointer-events: none; - line-height: 1; /* 防止图标影响容器高度 */ -} - -/* 修改清空按钮样式 */ -.search-clear { - position: absolute; - right: 105px; /* Adjusted further left to avoid overlapping */ - top: 50%; - transform: translateY(-50%); - color: oklch(var(--text-color) / 0.5); - cursor: pointer; - border: none; - background: none; - padding: 4px 8px; /* 增加点击区域 */ - display: none; /* 默认隐藏 */ - line-height: 1; - transition: color 0.2s ease; -} - -.search-clear:hover { - color: var(--lora-accent); -} - -.search-clear.visible { - display: block; -} - -.search-mode-toggle { - background: var(--lora-surface); - border: 1px solid oklch(65% 0.02 256); - border-radius: var(--border-radius-sm); - color: var(--text-color); - width: 32px; - height: 32px; - padding: 0; - display: flex; - align-items: center; - justify-content: center; - cursor: pointer; - transition: all 0.2s ease; - flex-shrink: 0; -} - -.search-mode-toggle:hover { - background-color: var(--lora-surface-hover, oklch(95% 0.02 256)); - color: var(--lora-accent); - border-color: var(--lora-accent); -} - -.search-mode-toggle.active { - background-color: oklch(95% 0.05 256); /* Lighter background that's more consistent */ - color: var(--lora-accent); - border-color: var(--lora-accent); -} - -.search-mode-toggle i { - font-size: 0.9em; -} - -.search-filter-toggle { - background: var(--lora-surface); - border: 1px solid oklch(65% 0.02 256); - border-radius: var(--border-radius-sm); - color: var(--text-color); - width: 32px; - height: 32px; - padding: 0; - display: flex; - align-items: center; - justify-content: center; - cursor: pointer; - transition: all 0.2s ease; - flex-shrink: 0; - position: relative; -} - -.search-filter-toggle:hover { - background-color: var(--lora-surface-hover, oklch(95% 0.02 256)); - color: var(--lora-accent); - border-color: var(--lora-accent); -} - -.search-filter-toggle.active { - background-color: oklch(95% 0.05 256); /* Lighter background that's more consistent */ - color: var(--lora-accent); - border-color: var(--lora-accent); -} - -.search-filter-toggle i { - font-size: 0.9em; -} - -.filter-badge { - position: absolute; - top: -6px; - right: -6px; - background-color: var(--lora-accent); - color: white; - width: 16px; - height: 16px; - border-radius: 50%; - font-size: 10px; - display: inline-flex; - align-items: center; - justify-content: center; - font-weight: bold; -} +/* Search and filter styles moved to components/search-filter.css */ /* Update corner-controls for collapsible behavior */ .corner-controls { @@ -479,141 +338,6 @@ opacity: 0; } -/* Filter Panel Styles */ -.filter-panel { - position: absolute; - top: 140px; /* Adjust to be closer to the filter button */ - right: 20px; - width: 300px; - background-color: var(--card-bg); - border: 1px solid var(--border-color); - border-radius: var(--border-radius-base); - box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); - z-index: var(--z-overlay); /* Increase z-index to be above cards */ - padding: 16px; - transition: transform 0.3s ease, opacity 0.3s ease; - transform-origin: top right; - max-height: calc(100vh - 160px); - overflow-y: auto; -} - -.filter-panel.hidden { - opacity: 0; - transform: scale(0.95); - pointer-events: none; -} - -.filter-header { - display: flex; - justify-content: space-between; - align-items: center; - margin-bottom: 16px; -} - -.filter-header h3 { - margin: 0; - font-size: 18px; - color: var(--text-color); -} - -.close-filter-btn { - background: none; - border: none; - color: var(--text-color); - cursor: pointer; - font-size: 16px; - padding: 4px; - display: flex; - align-items: center; - justify-content: center; -} - -.close-filter-btn:hover { - color: var(--lora-accent); -} - -.filter-section { - margin-bottom: 16px; -} - -.filter-section h4 { - margin: 0 0 8px 0; - font-size: 14px; - color: var(--text-color); - opacity: 0.8; -} - -.filter-tags { - display: flex; - flex-wrap: wrap; - gap: 6px; -} - -.filter-tag { - padding: 4px 10px; - border-radius: var(--border-radius-sm); - background-color: var(--lora-surface); - border: 1px solid var(--border-color); - color: var(--text-color); - font-size: 14px; - cursor: pointer; - transition: all 0.2s ease; - user-select: none; /* Prevent text selection */ - -webkit-user-select: none; /* For Safari */ - -moz-user-select: none; /* For Firefox */ - -ms-user-select: none; /* For IE/Edge */ -} - -.filter-tag:hover { - background-color: var(--lora-surface-hover); -} - -.filter-tag.active { - background-color: var(--lora-accent); - color: white; - border-color: var(--lora-accent); -} - -/* Base model tag specific styles - removing accent colors */ -.filter-tag.base-model-tag.sd-1-5, -.filter-tag.base-model-tag.sd-2-0, -.filter-tag.base-model-tag.sd-2-1, -.filter-tag.base-model-tag.sdxl, -.filter-tag.base-model-tag.flux, -.filter-tag.base-model-tag.il, -.filter-tag.base-model-tag.pony, -.filter-tag.base-model-tag.hunyuan, -.filter-tag.base-model-tag.unknown { - /* Removing the specific colored borders */ - border-left: none; -} - -/* Filter actions */ -.filter-actions { - display: flex; - justify-content: center; - margin-top: 16px; - gap: 8px; -} - -.clear-filters-btn { - background-color: transparent; - color: var(--text-color); - border: 1px solid var(--border-color); - padding: 6px 12px; - border-radius: var(--border-radius-sm); - font-size: 14px; - cursor: pointer; - transition: background-color 0.2s ease; - width: 100%; -} - -.clear-filters-btn:hover { - background-color: var(--lora-surface-hover); -} - -/* Remove apply-filters-btn styles since we no longer need it */ - @media (max-width: 768px) { .actions { flex-wrap: wrap; @@ -625,13 +349,6 @@ gap: 15px; } - .search-container { - width: 100%; - order: -1; - margin-left: 0; - margin-right: 0; - } - .folder-tags-container { order: -1; } @@ -668,11 +385,4 @@ .back-to-top { bottom: 60px; /* Give some extra space from bottom on mobile */ } - - .filter-panel { - width: calc(100% - 40px); - left: 20px; - right: 20px; - top: 140px; - } } \ No newline at end of file diff --git a/static/css/style.css b/static/css/style.css index 1b2c249a..c81e5ada 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -14,6 +14,7 @@ @import 'components/update-modal.css'; @import 'components/lora-modal.css'; @import 'components/support-modal.css'; +@import 'components/search-filter.css'; .initialization-notice { display: flex;