iloom-flatten/public/index.html

39 lines
1.7 KiB
HTML
Raw Normal View History

<!doctype html><html lang="zh-CN"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>昱森 - 以AI为梭织天地经纬</title><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"><style>/* */
html, body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
}
html.light, html.light body {
background-color: #ffffff !important;
color: #000000;
}
html.dark, html.dark body {
background-color: #1a1a1a !important;
color: #ffffff;
}</style><script>// React
(function() {
const isInIframe = window.self !== window.top;
function applyThemeToDOM(theme) {
document.documentElement.classList.remove('light', 'dark');
document.documentElement.classList.add(theme);
document.documentElement.setAttribute('data-theme', theme);
}
if (isInIframe) {
// 监听父窗口主动推送的主题消息
window.addEventListener('message', function(event) {
if (event.data && typeof event.data.theme === 'string') {
const theme = event.data.theme;
if (theme === 'light' || theme === 'dark') {
applyThemeToDOM(theme);
}
}
});
} else {
// 非 iframe 环境,使用默认 light 主题
applyThemeToDOM('light');
}
})();</script></head><body><div id="root"></div><script defer="defer" src="/vendors.c7418a54.js"></script><script defer="defer" src="/main.be9313a5.js"></script></body></html>