fix: unblock page rendering when Telegram CDN is unavailable

- Google Fonts: non-render-blocking via media="print" onload trick
- telegram-web-app.js: load only inside Telegram environment
- Telegram SDK init: skip entirely outside Telegram
- Script load timeout: 8000ms → 2000ms for faster deep link fallback
- Email login form: expanded by default (80% of registrations)
This commit is contained in:
c0mrade
2026-03-31 14:10:22 +03:00
parent 60f11e97a2
commit 826a82aa1c
4 changed files with 34 additions and 5 deletions

View File

@@ -18,8 +18,29 @@
<link
href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=Manrope:wght@400;500;600;700;800&family=Outfit:wght@400;500;600;700&display=swap"
rel="stylesheet"
media="print"
onload="this.media='all'"
/>
<script src="https://telegram.org/js/telegram-web-app.js" async></script>
<noscript>
<link
href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=Manrope:wght@400;500;600;700;800&family=Outfit:wght@400;500;600;700&display=swap"
rel="stylesheet"
/>
</noscript>
<script>
// Load Telegram Web App script only inside Telegram environment
(function() {
var isTelegram = window.TelegramWebviewProxy ||
location.hash.indexOf('tgWebApp') !== -1 ||
location.search.indexOf('tgWebApp') !== -1;
if (isTelegram) {
var s = document.createElement('script');
s.src = 'https://telegram.org/js/telegram-web-app.js';
s.async = true;
document.head.appendChild(s);
}
})();
</script>
<style>
body {
background-color: #0a0f1a;