huhuih
hzgjuigik
This commit is contained in:
@@ -2,13 +2,80 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||
<!-- Favicons -->
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
|
||||
<link rel="manifest" href="/site.webmanifest" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, user-scalable=yes" />
|
||||
<meta name="description" content="EmailSorter - AI-powered email sorting for maximum productivity. Automatically organize your inbox." />
|
||||
<meta name="description" content="E-Mail-Sorter - AI-powered email sorting for maximum productivity. Automatically organize your inbox." />
|
||||
<meta name="theme-color" content="#22c55e" />
|
||||
<meta name="mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="default" />
|
||||
<title>EmailSorter - Your inbox, finally organized</title>
|
||||
<!-- Prevent FOUC for dark mode - Enhanced Dark Reader detection -->
|
||||
<script>
|
||||
(function() {
|
||||
'use strict';
|
||||
const html = document.documentElement;
|
||||
|
||||
// Enhanced Dark Reader detection (multiple methods)
|
||||
function detectDarkReader() {
|
||||
// Method 1: Check for Dark Reader data attributes
|
||||
if (html.hasAttribute('data-darkreader-mode') ||
|
||||
html.hasAttribute('data-darkreader-scheme') ||
|
||||
html.hasAttribute('data-darkreader-policy')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Method 2: Check for Dark Reader meta tag or stylesheet
|
||||
try {
|
||||
if (document.querySelector('meta[name="darkreader"]') ||
|
||||
document.querySelector('style[data-darkreader]')) {
|
||||
return true;
|
||||
}
|
||||
} catch (e) {
|
||||
// Ignore errors during early initialization
|
||||
}
|
||||
|
||||
// Method 3: Check computed styles for filter/invert (Dark Reader uses CSS filters)
|
||||
try {
|
||||
const computedStyle = window.getComputedStyle(html);
|
||||
const filter = computedStyle.filter;
|
||||
if (filter && filter !== 'none' &&
|
||||
(filter.includes('invert') || filter.includes('brightness'))) {
|
||||
return true;
|
||||
}
|
||||
} catch (e) {
|
||||
// Ignore errors if getComputedStyle fails
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check system preference
|
||||
const prefersDark = window.matchMedia &&
|
||||
window.matchMedia('(prefers-color-scheme: dark)').matches;
|
||||
|
||||
// Detect Dark Reader
|
||||
const hasDarkReader = detectDarkReader();
|
||||
|
||||
// Apply theme: only dark if system prefers it AND Dark Reader is NOT active
|
||||
if (prefersDark && !hasDarkReader) {
|
||||
html.classList.add('dark');
|
||||
html.setAttribute('data-theme', 'dark');
|
||||
} else {
|
||||
// Force light mode if Dark Reader is detected
|
||||
html.classList.remove('dark');
|
||||
html.setAttribute('data-theme', 'light');
|
||||
}
|
||||
|
||||
// Mark as initialized to prevent FOUC transitions
|
||||
html.classList.add('dark-mode-initialized');
|
||||
})();
|
||||
</script>
|
||||
</head>
|
||||
<body class="antialiased">
|
||||
<div id="root"></div>
|
||||
|
||||
Reference in New Issue
Block a user