From 87c64f9b7192d565bc09b414fc0294e660dfe098 Mon Sep 17 00:00:00 2001 From: Will Miao <13051207myq@gmail.com> Date: Sun, 26 Jan 2025 23:41:55 +0800 Subject: [PATCH] Fix toggle theme --- static/css/style.css | 9 ++++++++- static/js/script.js | 5 ----- templates/loras.html | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/static/css/style.css b/static/css/style.css index 88b86f5d..8c0fe2e1 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -15,7 +15,8 @@ body { margin: 0; font-family: 'Segoe UI', sans-serif; - background: var(--background-color); + background: var(--bg-color); + color: var(--text-color); } .container { @@ -85,6 +86,12 @@ body { object-fit: cover; } +.card-preview video { + width: 100%; + height: 100%; + object-fit: cover; +} + .card-footer { position: absolute; bottom: 0; diff --git a/static/js/script.js b/static/js/script.js index bb4f6d3a..5c19396b 100644 --- a/static/js/script.js +++ b/static/js/script.js @@ -279,11 +279,6 @@ function initTheme() { document.body.dataset.theme = savedTheme; } -// 检测系统主题 -window.matchMedia('(prefers-color-scheme: dark)').addListener(e => { - document.body.dataset.theme = e.matches ? 'dark' : 'light'; -}); - // 键盘导航 document.addEventListener('keydown', (e) => { if (e.key === 'Escape') closeModal(); diff --git a/templates/loras.html b/templates/loras.html index bcddbec6..4955801a 100644 --- a/templates/loras.html +++ b/templates/loras.html @@ -57,7 +57,7 @@ data-meta="{{ lora.civitai | default({}) | tojson | forceescape }}">
{% if lora.preview_url.endswith('.mp4') or lora.preview_url.endswith('.webm') %} -