68 lines
3.6 KiB
HTML
68 lines
3.6 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="ru">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, interactive-widget=resizes-content" />
|
|
<meta name="theme-color" content="#09090b" />
|
|
<meta name="description" content="Корпоративная платформа iistwin" />
|
|
<meta name="apple-mobile-web-app-capable" content="yes" />
|
|
<meta name="mobile-web-app-capable" content="yes" />
|
|
<meta name="apple-mobile-web-app-status-bar-style" content="default" />
|
|
<meta name="apple-mobile-web-app-title" content="iistwin" />
|
|
<link rel="manifest" href="/manifest.json" />
|
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
<link rel="apple-touch-icon" href="/icons/icon-192x192.svg" />
|
|
<title>iistwin</title>
|
|
<!-- Шрифты self-hosted (client/public/fonts), @font-face — в src/index.css:
|
|
Inter (variable) — sans во всех скинах (iistwin, twenty, omegaprom);
|
|
DM Mono 400/500 — mono в скине twenty (остальные скины используют системные mono).
|
|
Preload только latin-подмножества Inter — оно нужно при любом первом рендере;
|
|
остальные subset'ы подгружаются браузером по unicode-range.
|
|
TODO: если кастомные скины организаций будут задавать другие font-family,
|
|
их стоит подгружать по требованию отдельно. -->
|
|
<link rel="preload" href="/fonts/inter-var-latin.woff2" as="font" type="font/woff2" crossorigin>
|
|
</head>
|
|
<body>
|
|
<div id="root"></div>
|
|
<script>
|
|
// Boot-скрипт: применяет тему/скин до загрузки React, чтобы не было вспышки
|
|
// дефолтного скина, и восстанавливает rem-размер шрифта в PWA до первого рендера.
|
|
// Зеркалит client/src/themes/ThemeProvider.tsx (ключи THEME_STORAGE_KEY='theme',
|
|
// SKIN_STORAGE_KEY='skin') и client/src/hooks/usePwaFontSize.ts
|
|
// (префикс 'pwa-font-size-', clamp 12..24) — при изменении там править и здесь.
|
|
(function () {
|
|
try {
|
|
var root = document.documentElement;
|
|
var theme = localStorage.getItem('theme');
|
|
if (theme !== 'light' && theme !== 'dark') {
|
|
theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
|
}
|
|
var skin = localStorage.getItem('skin') || 'iistwin';
|
|
root.setAttribute('data-theme', theme);
|
|
root.setAttribute('data-skin', skin);
|
|
root.classList.remove('light', 'dark');
|
|
root.classList.add(theme);
|
|
|
|
var isPwa =
|
|
window.matchMedia('(display-mode: standalone)').matches ||
|
|
window.navigator.standalone === true;
|
|
if (isPwa) {
|
|
for (var i = 0; i < localStorage.length; i++) {
|
|
var key = localStorage.key(i);
|
|
if (key && key.indexOf('pwa-font-size-') === 0) {
|
|
var n = parseInt(localStorage.getItem(key), 10);
|
|
if (!isNaN(n)) {
|
|
root.style.fontSize = Math.max(12, Math.min(24, n)) + 'px';
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
} catch (e) {
|
|
/* ignore: не блокируем загрузку приложения */
|
|
}
|
|
})();
|
|
</script>
|
|
<script type="module" src="/src/main.tsx"></script>
|
|
</body>
|
|
</html> |