wesal/frontend/web/index.html

141 lines
3.7 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<!--
If you are serving your web app in a path other than the root, change the
href value below to reflect the base path you are serving from.
The path provided below has to start and end with a slash "/" in order for
it to work correctly.
For more details:
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
This is a placeholder for base href that will be replaced by the value of
the `--base-href` argument provided to `flutter build`.
-->
<base href="$FLUTTER_BASE_HREF">
<meta charset="UTF-8">
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
<meta name="description" content="Wesal - Connections Made Easier">
<!-- iOS meta tags & icons -->
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="Wesal">
<link rel="apple-touch-icon" href="icons/ios/180.png">
<!-- Favicon -->
<link rel="icon" type="image/png" href="icons/ios/32.png" />
<title>Wesal</title>
<link rel="manifest" href="manifest.json">
<style>
body {
overscroll-behavior-x: none;
-webkit-overflow-scrolling: touch;
}
/* Prevent pull-to-refresh and back gesture */
html,
body {
overflow-x: hidden;
position: fixed;
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
/* Loading screen styles */
#loading {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(180deg, #32B0A5 0%, #4600B9 50%);
display: flex;
align-items: center;
justify-content: center;
z-index: 9999;
}
/* Loading spinner */
.spinner {
width: 80px;
height: 80px;
border: 6px solid rgba(255, 255, 255, 0.3);
border-top: 6px solid white;
border-radius: 50%;
animation: spin 1s linear infinite;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
/* Hide loading screen when Flutter loads */
.flutter-loaded #loading {
display: none;
}
</style>
</head>
<body>
<!-- Loading screen -->
<div id="loading">
<div class="spinner"></div>
</div>
<script src="flutter_bootstrap.js" async></script>
<!-- Hide loading screen when Flutter loads -->
<script>
window.addEventListener('flutter-first-frame', function () {
document.body.classList.add('flutter-loaded');
});
// Fallback: hide after 10 seconds if Flutter doesn't load
setTimeout(function() {
document.body.classList.add('flutter-loaded');
}, 10000);
</script>
<!-- Firebase Messaging Service Worker -->
<script>
if ('serviceWorker' in navigator) {
window.addEventListener('load', function () {
navigator.serviceWorker.register('/firebase-messaging-sw.js')
.then(function (registration) {
console.log('Firebase Messaging Service Worker registered successfully:', registration);
})
.catch(function (error) {
console.log('Firebase Messaging Service Worker registration failed:', error);
});
});
}
// Prevent iOS Safari back gesture
window.addEventListener('touchstart', function (e) {
if (e.touches.length > 1) return;
const touch = e.touches[0];
if (touch.clientX < 20) { // Left edge
e.preventDefault();
}
}, { passive: false });
// Override browser back
window.addEventListener('popstate', function (e) {
e.preventDefault();
// Send message to Flutter
window.dispatchEvent(new CustomEvent('browser-back'));
});
</script>
</body>
</html>