mirror of
https://github.com/Sagit-chu/flvx.git
synced 2026-10-11 11:46:37 +08:00
修复转发暂停问题 增加安卓apk
This commit is contained in:
@@ -6,16 +6,44 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>哆啦A梦</title>
|
||||
<script>
|
||||
// 防止暗黑模式闪烁:在页面加载前立即应用主题
|
||||
// 防止暗黑模式闪烁:在页面加载前立即应用系统主题
|
||||
(function() {
|
||||
const theme = localStorage.getItem('heroui-theme') || 'light';
|
||||
if (theme === 'dark') {
|
||||
// 立即检测系统主题并应用
|
||||
const isDarkMode = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
|
||||
|
||||
// 立即设置主题类,避免闪烁
|
||||
if (isDarkMode) {
|
||||
document.documentElement.classList.add('dark');
|
||||
document.documentElement.style.colorScheme = 'dark';
|
||||
} else {
|
||||
document.documentElement.classList.remove('dark');
|
||||
document.documentElement.style.colorScheme = 'light';
|
||||
}
|
||||
|
||||
// 监听系统主题变化
|
||||
if (window.matchMedia) {
|
||||
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', function(e) {
|
||||
if (e.matches) {
|
||||
document.documentElement.classList.add('dark');
|
||||
document.documentElement.style.colorScheme = 'dark';
|
||||
} else {
|
||||
document.documentElement.classList.remove('dark');
|
||||
document.documentElement.style.colorScheme = 'light';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 检测H5模式并设置标记,避免布局切换时的闪屏
|
||||
const isMobile = window.innerWidth <= 768;
|
||||
const isMobileBrowser = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const isH5Param = urlParams.get('h5') === 'true';
|
||||
|
||||
if (isMobile || isMobileBrowser || isH5Param) {
|
||||
document.documentElement.classList.add('h5-mode');
|
||||
} else {
|
||||
document.documentElement.classList.add('pc-mode');
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
<style>
|
||||
@@ -32,19 +60,51 @@
|
||||
--toaster-border: #4b5563;
|
||||
}
|
||||
|
||||
/* 默认浅色主题样式 */
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background-color: #f8fafc;
|
||||
transition: background-color 0.2s ease;
|
||||
background-color: #ffffff;
|
||||
color: #000000;
|
||||
transition: background-color 0.2s ease, color 0.2s ease;
|
||||
}
|
||||
|
||||
/* 暗色主题样式 */
|
||||
html.dark body {
|
||||
background-color: #000000;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
#root {
|
||||
min-height: 100vh;
|
||||
background-color: inherit;
|
||||
}
|
||||
|
||||
/* 防止加载时的闪烁 */
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* 确保在主题切换时平滑过渡 */
|
||||
html {
|
||||
transition: color-scheme 0.2s ease;
|
||||
}
|
||||
|
||||
/* 防止布局切换时的闪屏 */
|
||||
.h5-mode #root {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.h5-mode.dark #root {
|
||||
background-color: #000000;
|
||||
}
|
||||
|
||||
.pc-mode #root {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.pc-mode.dark #root {
|
||||
background-color: #000000;
|
||||
}
|
||||
</style>
|
||||
<meta key="title" content="哆啦A梦" property="og:title" />
|
||||
|
||||
Reference in New Issue
Block a user