Files
ComfyUI-Lora-Manager/static/css/style.css
2025-01-25 19:22:02 +08:00

315 lines
5.4 KiB
CSS
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

:root {
--bg-color: #ffffff;
--text-color: #333333;
--card-bg: #ffffff;
--border-color: #e0e0e0;
}
[data-theme="dark"] {
--bg-color: #1a1a1a;
--text-color: #e0e0e0;
--card-bg: #2d2d2d;
--border-color: #404040;
}
body {
margin: 0;
font-family: 'Segoe UI', sans-serif;
background: var(--background-color);
}
.container {
max-width: 1400px;
margin: 20px auto;
padding: 0 15px;
}
/* 文件夹标签样式 */
.folder-tags {
display: flex;
gap: 8px;
overflow-x: auto;
padding: 10px 0;
}
.tag {
padding: 6px 12px;
border-radius: 20px;
background: #e0e0e0;
cursor: pointer;
white-space: nowrap;
transition: all 0.3s;
}
.tag.active {
background: var(--primary-color);
color: white;
}
/* 卡片网格布局 */
.card-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
gap: 12px;
margin-top: 20px;
}
.lora-card {
background: var(--card-bg);
border-radius: 12px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
overflow: hidden;
transition: transform 0.2s;
aspect-ratio: 896/1152;
max-width: 240px;
margin: 0 auto;
}
.lora-card:hover {
transform: translateY(-5px);
}
/* Card Preview and Footer Overlay */
.card-preview {
position: relative;
width: 100%;
height: 100%;
}
.card-preview img {
width: 100%;
height: 100%;
object-fit: cover;
}
.card-footer {
position: absolute;
bottom: 0;
left: 0;
right: 0;
background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
color: white;
padding: 15px;
display: flex;
justify-content: space-between;
align-items: flex-end;
min-height: 80px;
}
.model-name {
font-weight: bold;
text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}
.model-meta {
font-size: 0.9em;
opacity: 0.9;
}
.card-header {
position: absolute;
top: 0;
left: 0;
right: 0;
background: linear-gradient(rgba(0, 0, 0, 0.85), transparent);
color: white;
padding: 15px;
display: flex;
justify-content: space-between;
align-items: center;
z-index: 1;
}
.card-actions i {
margin-left: 10px;
cursor: pointer;
color: white;
transition: opacity 0.2s;
}
.card-actions i:hover {
opacity: 0.8;
}
/* 响应式设计 */
@media (max-width: 768px) {
.card-grid {
grid-template-columns: 1fr;
}
.controls {
flex-direction: column;
gap: 15px;
}
}
/* 新增元数据相关样式 */
.model-info {
flex: 1;
}
.model-meta {
font-size: 0.8em;
color: #666;
margin-top: 4px;
}
.base-model {
display: inline-block;
background: #f0f0f0;
padding: 2px 6px;
border-radius: 4px;
margin-right: 6px;
}
.file-size,
.modified {
display: block;
margin-top: 2px;
}
.tooltip {
position: relative;
cursor: help;
}
.tooltip::after {
content: attr(data-tooltip);
position: absolute;
bottom: 120%;
left: 50%;
transform: translateX(-50%);
background: rgba(0, 0, 0, 0.8);
color: white;
padding: 4px 8px;
border-radius: 4px;
font-size: 0.8em;
white-space: nowrap;
opacity: 0;
transition: opacity 0.2s;
pointer-events: none;
}
.tooltip:hover::after {
opacity: 1;
}
/* 模态窗口样式 */
.modal {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.8);
z-index: 1000;
overflow-y: auto; /* 允许模态窗口内容滚动 */
}
/* 当模态窗口打开时禁止body滚动 */
body.modal-open {
overflow: hidden;
}
.modal-content {
position: relative;
max-width: 800px;
margin: 2rem auto;
background: var(--card-bg);
border-radius: 12px;
padding: 20px;
}
.carousel {
display: grid;
grid-auto-flow: column;
gap: 1rem;
overflow-x: auto;
scroll-snap-type: x mandatory;
}
.carousel img {
scroll-snap-align: start;
max-height: 60vh;
object-fit: contain;
}
/* 主题切换按钮 */
.theme-toggle {
position: fixed;
top: 20px;
right: 20px;
cursor: pointer;
padding: 8px;
border-radius: 50%;
background: var(--card-bg);
}
.base-model-label {
max-width: 120px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
display: inline-block;
color: white;
text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
background: rgba(255, 255, 255, 0.2);
padding: 2px 8px;
border-radius: 4px;
backdrop-filter: blur(2px);
}
.loading-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.7);
display: flex;
justify-content: center;
align-items: center;
z-index: 1000;
}
.loading-content {
background: #fff;
padding: 2rem;
border-radius: 8px;
text-align: center;
}
.loading-spinner {
border: 4px solid #f3f3f3;
border-top: 4px solid #3498db;
border-radius: 50%;
width: 40px;
height: 40px;
animation: spin 1s linear infinite;
margin: 0 auto 1rem;
}
.loading-status {
margin-bottom: 1rem;
color: #333;
}
.progress-container {
width: 300px;
background-color: #f0f0f0;
border-radius: 4px;
overflow: hidden;
}
.progress-bar {
width: 0%;
height: 20px;
background-color: #4CAF50;
transition: width 0.3s ease;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}