mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-25 07:05:43 -03:00
Enhance folder tag functionality and layout; update styles for action buttons and toggle behavior
This commit is contained in:
@@ -25,11 +25,19 @@
|
|||||||
.actions {
|
.actions {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
gap: var(--space-2);
|
gap: var(--space-2);
|
||||||
flex-wrap: nowrap;
|
flex-wrap: nowrap;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.action-buttons {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: var(--space-2);
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
/* Ensure hidden class works properly */
|
/* Ensure hidden class works properly */
|
||||||
.hidden {
|
.hidden {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
@@ -42,11 +50,14 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.folder-tags {
|
.folder-tags {
|
||||||
|
display: flex;
|
||||||
|
gap: 4px;
|
||||||
|
padding: 2px 0;
|
||||||
|
flex-wrap: wrap;
|
||||||
transition: max-height 0.3s ease, opacity 0.2s ease;
|
transition: max-height 0.3s ease, opacity 0.2s ease;
|
||||||
max-height: 150px; /* Limit height to prevent overflow */
|
max-height: 150px; /* Limit height to prevent overflow */
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
overflow-y: auto; /* Enable vertical scrolling */
|
overflow-y: auto; /* Enable vertical scrolling */
|
||||||
padding-right: 40px; /* Make space for the toggle button */
|
|
||||||
margin-bottom: 5px; /* Add margin below the tags */
|
margin-bottom: 5px; /* Add margin below the tags */
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,13 +66,15 @@
|
|||||||
opacity: 0;
|
opacity: 0;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding-bottom: 0;
|
padding-bottom: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toggle-folders-container {
|
||||||
|
margin-left: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Toggle Folders Button */
|
/* Toggle Folders Button */
|
||||||
.toggle-folders-btn {
|
.toggle-folders-btn {
|
||||||
position: absolute;
|
|
||||||
bottom: 0; /* 固定在容器底部 */
|
|
||||||
right: 0; /* 固定在容器右侧 */
|
|
||||||
width: 36px;
|
width: 36px;
|
||||||
height: 36px;
|
height: 36px;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
@@ -73,7 +86,6 @@
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: all 0.3s ease;
|
transition: all 0.3s ease;
|
||||||
z-index: 2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.toggle-folders-btn:hover {
|
.toggle-folders-btn:hover {
|
||||||
@@ -86,25 +98,18 @@
|
|||||||
transition: transform 0.3s ease;
|
transition: transform 0.3s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 折叠状态样式 */
|
/* Icon-only button style */
|
||||||
.folder-tags.collapsed + .toggle-folders-btn {
|
.icon-only {
|
||||||
position: static;
|
min-width: unset !important;
|
||||||
margin-right: auto; /* 确保按钮在左侧 */
|
width: 36px !important;
|
||||||
transform: translateY(0);
|
padding: 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.folder-tags.collapsed + .toggle-folders-btn i {
|
/* Rotate icon when folders are collapsed */
|
||||||
|
.folder-tags.collapsed ~ .actions .toggle-folders-btn i {
|
||||||
transform: rotate(180deg);
|
transform: rotate(180deg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 文件夹标签样式 */
|
|
||||||
.folder-tags {
|
|
||||||
display: flex;
|
|
||||||
gap: 4px;
|
|
||||||
padding: 2px 0;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Add custom scrollbar for better visibility */
|
/* Add custom scrollbar for better visibility */
|
||||||
.folder-tags::-webkit-scrollbar {
|
.folder-tags::-webkit-scrollbar {
|
||||||
width: 6px;
|
width: 6px;
|
||||||
@@ -179,31 +184,27 @@
|
|||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
gap: var(--space-1);
|
gap: var(--space-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
.controls {
|
.action-buttons {
|
||||||
flex-direction: column;
|
flex-wrap: wrap;
|
||||||
gap: 15px;
|
gap: var(--space-1);
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toggle-folders-container {
|
||||||
|
margin-left: 0;
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
}
|
}
|
||||||
|
|
||||||
.folder-tags-container {
|
.folder-tags-container {
|
||||||
order: -1;
|
order: -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.toggle-folders-btn {
|
|
||||||
position: absolute;
|
|
||||||
bottom: 0;
|
|
||||||
right: 0;
|
|
||||||
transform: none; /* 移除transform,防止hover时的位移 */
|
|
||||||
}
|
|
||||||
|
|
||||||
.toggle-folders-btn:hover {
|
.toggle-folders-btn:hover {
|
||||||
transform: none; /* 移动端下禁用hover效果 */
|
transform: none; /* 移动端下禁用hover效果 */
|
||||||
}
|
}
|
||||||
|
|
||||||
.folder-tags.collapsed + .toggle-folders-btn {
|
|
||||||
position: relative;
|
|
||||||
transform: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.back-to-top {
|
.back-to-top {
|
||||||
bottom: 60px; /* Give some extra space from bottom on mobile */
|
bottom: 60px; /* Give some extra space from bottom on mobile */
|
||||||
|
|||||||
@@ -130,12 +130,14 @@ export function toggleFolderTags() {
|
|||||||
folderTags.classList.toggle('collapsed');
|
folderTags.classList.toggle('collapsed');
|
||||||
|
|
||||||
if (folderTags.classList.contains('collapsed')) {
|
if (folderTags.classList.contains('collapsed')) {
|
||||||
toggleBtn.className = 'fas fa-chevron-down';
|
// Change icon to indicate folders are hidden
|
||||||
toggleBtn.parentElement.title = 'Expand folder tags';
|
toggleBtn.className = 'fas fa-folder-plus';
|
||||||
|
toggleBtn.parentElement.title = 'Show folder tags';
|
||||||
localStorage.setItem('folderTagsCollapsed', 'true');
|
localStorage.setItem('folderTagsCollapsed', 'true');
|
||||||
} else {
|
} else {
|
||||||
toggleBtn.className = 'fas fa-chevron-up';
|
// Change icon to indicate folders are visible
|
||||||
toggleBtn.parentElement.title = 'Collapse folder tags';
|
toggleBtn.className = 'fas fa-folder-minus';
|
||||||
|
toggleBtn.parentElement.title = 'Hide folder tags';
|
||||||
localStorage.setItem('folderTagsCollapsed', 'false');
|
localStorage.setItem('folderTagsCollapsed', 'false');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -156,9 +158,20 @@ export function initFolderTagsVisibility() {
|
|||||||
const isCollapsed = localStorage.getItem('folderTagsCollapsed') === 'true';
|
const isCollapsed = localStorage.getItem('folderTagsCollapsed') === 'true';
|
||||||
if (isCollapsed) {
|
if (isCollapsed) {
|
||||||
const folderTags = document.querySelector('.folder-tags');
|
const folderTags = document.querySelector('.folder-tags');
|
||||||
const btn = document.querySelector('.toggle-folders-btn');
|
const toggleBtn = document.querySelector('.toggle-folders-btn i');
|
||||||
folderTags.classList.add('collapsed');
|
if (folderTags) {
|
||||||
btn.title = 'Expand folder tags';
|
folderTags.classList.add('collapsed');
|
||||||
|
}
|
||||||
|
if (toggleBtn) {
|
||||||
|
toggleBtn.className = 'fas fa-folder-plus';
|
||||||
|
toggleBtn.parentElement.title = 'Show folder tags';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const toggleBtn = document.querySelector('.toggle-folders-btn i');
|
||||||
|
if (toggleBtn) {
|
||||||
|
toggleBtn.className = 'fas fa-folder-minus';
|
||||||
|
toggleBtn.parentElement.title = 'Hide folder tags';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,32 +5,36 @@
|
|||||||
<div class="tag" data-folder="{{ folder }}">{{ folder }}</div>
|
<div class="tag" data-folder="{{ folder }}">{{ folder }}</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
<button class="toggle-folders-btn" onclick="toggleFolderTags()" title="Collapse folder tags">
|
|
||||||
<i class="fas fa-chevron-up"></i>
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
<div title="Sort models by..." class="control-group">
|
<div class="action-buttons">
|
||||||
<select id="sortSelect">
|
<div title="Sort models by..." class="control-group">
|
||||||
<option value="name">Name</option>
|
<select id="sortSelect">
|
||||||
<option value="date">Date</option>
|
<option value="name">Name</option>
|
||||||
</select>
|
<option value="date">Date</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div title="Refresh model list" class="control-group">
|
||||||
|
<button onclick="refreshLoras()"><i class="fas fa-sync"></i> Refresh</button>
|
||||||
|
</div>
|
||||||
|
<div class="control-group">
|
||||||
|
<button onclick="fetchCivitai()" class="secondary" title="Fetch from Civitai"><i class="fas fa-download"></i> Fetch</button>
|
||||||
|
</div>
|
||||||
|
<div class="control-group">
|
||||||
|
<button onclick="downloadManager.showDownloadModal()" title="Download from URL">
|
||||||
|
<i class="fas fa-cloud-download-alt"></i> Download
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="control-group">
|
||||||
|
<button id="bulkOperationsBtn" onclick="bulkManager.toggleBulkMode()" title="Bulk Operations">
|
||||||
|
<i class="fas fa-th-large"></i> Bulk
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div title="Refresh model list" class="control-group">
|
<div class="toggle-folders-container">
|
||||||
<button onclick="refreshLoras()"><i class="fas fa-sync"></i> Refresh</button>
|
<button class="toggle-folders-btn icon-only" onclick="toggleFolderTags()" title="Toggle folder tags">
|
||||||
</div>
|
<i class="fas fa-tags"></i>
|
||||||
<div class="control-group">
|
|
||||||
<button onclick="fetchCivitai()" class="secondary" title="Fetch from Civitai"><i class="fas fa-download"></i> Fetch</button>
|
|
||||||
</div>
|
|
||||||
<div class="control-group">
|
|
||||||
<button onclick="downloadManager.showDownloadModal()" title="Download from URL">
|
|
||||||
<i class="fas fa-cloud-download-alt"></i> Download
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div class="control-group">
|
|
||||||
<button id="bulkOperationsBtn" onclick="bulkManager.toggleBulkMode()" title="Bulk Operations">
|
|
||||||
<i class="fas fa-th-large"></i> Bulk
|
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user