68 lines
3.7 KiB
HTML
68 lines
3.7 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>
|
||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||
<!-- Загружаем только шрифты, реально используемые встроенными скинами:
|
||
Inter (variable) — sans во всех скинах (iistwin, twenty, omegaprom);
|
||
DM Mono 400/500 — mono в скине twenty (остальные скины используют системные mono).
|
||
TODO: если кастомные скины организаций будут задавать другие font-family,
|
||
их стоит подгружать по требованию отдельно, а не одним общим линком. -->
|
||
<link href="https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap" rel="stylesheet">
|
||
</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> |