Add filters - checkpoint

This commit is contained in:
Will Miao
2025-03-05 19:07:11 +08:00
parent 879df0d563
commit c17f2c885a
6 changed files with 428 additions and 8 deletions

View File

@@ -32,7 +32,7 @@
/* 调整搜索框样式以匹配其他控件 */
.search-container input {
width: 100%;
padding: 6px 40px 6px 12px; /* 减小右侧padding */
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);
@@ -49,7 +49,7 @@
.search-icon {
position: absolute;
right: 40px; /* 调整到toggle按钮左侧 */
right: 80px; /* Adjusted to make space for both toggle buttons */
top: 50%;
transform: translateY(-50%);
color: oklch(var(--text-color) / 0.5);
@@ -60,7 +60,7 @@
/* 修改清空按钮样式 */
.search-clear {
position: absolute;
right: 65px; /* 放到search-icon左侧 */
right: 105px; /* Adjusted further left to avoid overlapping */
top: 50%;
transform: translateY(-50%);
color: oklch(var(--text-color) / 0.5);
@@ -98,19 +98,70 @@
}
.search-mode-toggle:hover {
background: var(--lora-accent);
color: white;
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: var(--lora-accent);
color: white;
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;
}
.corner-controls {
position: fixed;
top: 20px;
@@ -308,6 +359,151 @@
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;
}
.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: space-between;
margin-top: 16px;
gap: 8px;
}
.clear-filters-btn,
.apply-filters-btn {
padding: 6px 12px;
border-radius: var(--border-radius-sm);
font-size: 14px;
cursor: pointer;
transition: background-color 0.2s ease;
}
.clear-filters-btn {
background-color: transparent;
color: var(--text-color);
border: 1px solid var(--border-color);
flex: 1;
}
.clear-filters-btn:hover {
background-color: var(--lora-surface-hover);
}
.apply-filters-btn {
background-color: var(--lora-accent);
color: white;
border: 1px solid var(--lora-accent);
flex: 1;
}
.apply-filters-btn:hover {
background-color: var(--lora-accent-hover, var(--lora-accent));
filter: brightness(1.1);
}
@media (max-width: 768px) {
.actions {
flex-wrap: wrap;
@@ -323,6 +519,7 @@
width: 100%;
order: -1;
margin-left: 0;
margin-right: 0;
}
.folder-tags-container {
@@ -355,4 +552,11 @@
.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;
}
}