Files
memind/index.html
T
John 06ba9e8bb7 fix(portal): remember theme choice and restore light as default
Stop the one-time force-dark migration from overriding users, default first visits to light, and roll forced-dark browsers back to light once.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-12 09:30:28 +08:00

39 lines
1.5 KiB
HTML

<!doctype html>
<html lang="zh-CN" data-theme="light">
<head>
<meta charset="UTF-8" />
<meta name="theme-color" content="#f4f1ea" />
<script>
(function () {
var storageKey = 'memind-theme';
var migrationKey = 'memind-theme-migration';
var migrationVersion = 'light-default-2026-09-12';
if (localStorage.getItem(migrationKey) !== migrationVersion) {
var previousMigration = localStorage.getItem(migrationKey);
var stored = localStorage.getItem(storageKey);
if (previousMigration === 'dark-default-2026-09-11' && stored !== 'light') {
localStorage.setItem(storageKey, 'light');
}
localStorage.setItem(migrationKey, migrationVersion);
}
var theme = localStorage.getItem(storageKey) === 'dark' ? 'dark' : 'light';
document.documentElement.dataset.theme = theme;
document.documentElement.style.colorScheme = theme;
var meta = document.querySelector('meta[name="theme-color"]');
if (meta) meta.setAttribute('content', theme === 'dark' ? '#0f1419' : '#f4f1ea');
})();
</script>
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover"
/>
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<title>TKMind</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>