Fix toggle theme

This commit is contained in:
Will Miao
2025-01-26 23:41:55 +08:00
parent 0c80555cc7
commit 87c64f9b71
3 changed files with 9 additions and 7 deletions

View File

@@ -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;

View File

@@ -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();