mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-05 06:24:37 +00:00
Add lazy loading of Telegram SDK only when running inside Telegram Mini App environment instead of unconditionally loading in all browsers. Includes: - New environment detection functions: isTelegramEnvironment(), isTelegramApp() - Dynamic SDK loading with 3s timeout via loadTelegramSdk() - Removed static script tag from index.html - Made haptic feedback lazy (SDK check on each call) - Made theme listeners lazy (attached in initializeTheme()) - Updated all components to use unified detection functions This prevents SDK load time overhead in regular browser environments while ensuring the app works correctly both in Telegram and browser contexts.
42 lines
1.5 KiB
HTML
42 lines
1.5 KiB
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta
|
|
name="viewport"
|
|
content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover, interactive-widget=resizes-content"
|
|
/>
|
|
|
|
<!-- PWA Meta Tags -->
|
|
<meta name="theme-color" content="#ffffff" media="(prefers-color-scheme: light)" />
|
|
<meta name="theme-color" content="#1c1c1e" media="(prefers-color-scheme: dark)" />
|
|
<meta name="description" content="AI-powered development assistant" />
|
|
|
|
<!-- iOS PWA Meta Tags -->
|
|
<meta name="apple-mobile-web-app-capable" content="yes" />
|
|
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
|
|
<meta name="apple-mobile-web-app-title" content="Hapi" />
|
|
<link rel="apple-touch-icon" href="/apple-touch-icon-180x180.png" />
|
|
|
|
<!-- Favicon -->
|
|
<link rel="icon" href="/favicon.ico" sizes="48x48" />
|
|
<link rel="icon" href="/icon.svg" sizes="any" type="image/svg+xml" />
|
|
|
|
<!-- Safari Pinned Tab -->
|
|
<link rel="mask-icon" href="/mask-icon.svg" color="#111827" />
|
|
|
|
<title>Hapi</title>
|
|
<script type="importmap">
|
|
{
|
|
"imports": {
|
|
"socket.io-client": "https://cdn.socket.io/4.8.1/socket.io.esm.min.js"
|
|
}
|
|
}
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<div id="root"></div>
|
|
<script type="module" src="/src/main.tsx"></script>
|
|
</body>
|
|
</html>
|