feat: Update styles for creator info and Civitai view in Lora modal; refactor button to div

This commit is contained in:
Will Miao
2025-07-22 18:07:19 +08:00
parent 29d2b5ee4b
commit 6d3feb4bef
4 changed files with 14 additions and 65 deletions

View File

@@ -445,14 +445,15 @@
transition: all 0.2s; transition: all 0.2s;
} }
[data-theme="dark"] .creator-info { [data-theme="dark"] .creator-info,
[data-theme="dark"] .civitai-view {
background: rgba(255, 255, 255, 0.03); background: rgba(255, 255, 255, 0.03);
border: 1px solid var(--lora-border); border: 1px solid var(--lora-border);
} }
.creator-avatar { .creator-avatar {
width: 28px; width: 26px;
height: 28px; height: 26px;
border-radius: 50%; border-radius: 50%;
overflow: hidden; overflow: hidden;
flex-shrink: 0; flex-shrink: 0;
@@ -484,7 +485,8 @@
} }
/* Add hover effect for creator info */ /* Add hover effect for creator info */
.creator-info:hover { .creator-info:hover,
.civitai-view:hover {
background: oklch(var(--lora-accent-l) var(--lora-accent-c) var(--lora-accent-h) / 0.1); background: oklch(var(--lora-accent-l) var(--lora-accent-c) var(--lora-accent-h) / 0.1);
border-color: var(--lora-accent); border-color: var(--lora-accent);
transform: translateY(-1px); transform: translateY(-1px);
@@ -498,26 +500,22 @@
flex-wrap: wrap; flex-wrap: wrap;
} }
.civitai-view-btn { .civitai-view {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 6px; gap: 6px;
padding: 6px 12px; padding: 6px 12px;
background: var(--lora-accent); background: rgba(0, 0, 0, 0.03);
color: white; border: 1px solid rgba(0, 0, 0, 0.1);
border: none;
border-radius: var(--border-radius-sm); border-radius: var(--border-radius-sm);
color: var(--text-color);
cursor: pointer; cursor: pointer;
font-weight: 500;
font-size: 0.9em; font-size: 0.9em;
transition: all 0.2s; transition: all 0.2s;
} }
.civitai-view-btn:hover { .civitai-view i {
opacity: 0.9;
transform: translateY(-1px);
}
.civitai-view-btn i {
font-size: 20px; font-size: 20px;
display: flex; display: flex;
align-items: center; align-items: center;

View File

@@ -97,9 +97,9 @@ export function showModelModal(model, modelType) {
<div class="creator-actions"> <div class="creator-actions">
${model.from_civitai ? ` ${model.from_civitai ? `
<button class="civitai-view-btn" title="View on Civitai" data-action="view-civitai" data-filepath="${model.file_path}"> <div class="civitai-view" title="View on Civitai" data-action="view-civitai" data-filepath="${model.file_path}">
<i class="fas fa-globe"></i> View on Civitai <i class="fas fa-globe"></i> View on Civitai
</button>` : ''} </div>` : ''}
${model.civitai?.creator ? ` ${model.civitai?.creator ? `
<div class="creator-info" data-username="${model.civitai.creator.username}" data-action="view-creator" title="View Creator Profile"> <div class="creator-info" data-username="${model.civitai.creator.username}" data-action="view-creator" title="View Creator Profile">

View File

@@ -118,11 +118,8 @@ export function toggleTheme() {
const currentTheme = getStorageItem('theme') || 'auto'; const currentTheme = getStorageItem('theme') || 'auto';
let newTheme; let newTheme;
// Cycle through themes: light → dark → auto → light
if (currentTheme === 'light') { if (currentTheme === 'light') {
newTheme = 'dark'; newTheme = 'dark';
} else if (currentTheme === 'dark') {
newTheme = 'auto';
} else { } else {
newTheme = 'light'; newTheme = 'light';
} }

View File

@@ -177,52 +177,6 @@
</div> </div>
</div> </div>
<!-- Add Video Settings Section -->
<div class="settings-section">
<h3>Video Settings</h3>
<div class="setting-item">
<div class="setting-row">
<div class="setting-info">
<label for="autoplayOnHover">Autoplay Videos on Hover</label>
</div>
<div class="setting-control">
<label class="toggle-switch">
<input type="checkbox" id="autoplayOnHover"
onchange="settingsManager.saveToggleSetting('autoplayOnHover', 'autoplay_on_hover')">
<span class="toggle-slider"></span>
</label>
</div>
</div>
<div class="input-help">
Only play video previews when hovering over them
</div>
</div>
</div>
<!-- Add Video Settings Section -->
<div class="settings-section">
<h3>Video Settings</h3>
<div class="setting-item">
<div class="setting-row">
<div class="setting-info">
<label for="autoplayOnHover">Autoplay Videos on Hover</label>
</div>
<div class="setting-control">
<label class="toggle-switch">
<input type="checkbox" id="autoplayOnHover"
onchange="settingsManager.saveToggleSetting('autoplayOnHover', 'autoplay_on_hover')">
<span class="toggle-slider"></span>
</label>
</div>
</div>
<div class="input-help">
Only play video previews when hovering over them
</div>
</div>
</div>
<!-- Add Folder Settings Section --> <!-- Add Folder Settings Section -->
<div class="settings-section"> <div class="settings-section">
<h3>Folder Settings</h3> <h3>Folder Settings</h3>