-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
110 lines (98 loc) · 3.24 KB
/
index.html
File metadata and controls
110 lines (98 loc) · 3.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="TACS - Advanced AI-powered Traffic AI Control System with real-time optimization" />
<meta name="theme-color" content="#000000" />
<!-- Preconnect to external domains -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<!-- Preload critical styles only -->
<link rel="preload" href="/src/index.css" as="style">
<!-- Web App Manifest -->
<link rel="manifest" href="/manifest.json">
<title>TACS - Traffic AI Control System</title>
<!-- Inline critical CSS for faster initial paint -->
<style>
body {
margin: 0;
padding: 0;
background: #000000;
color: #ffffff;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
#root {
width: 100vw;
min-height: 100vh;
overflow-x: hidden;
overflow-y: visible;
}
/* Initial loading state */
.app-loading {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
background: #000000;
z-index: 9999;
}
.loading-spinner {
width: 60px;
height: 60px;
border: 3px solid rgba(0, 255, 136, 0.3);
border-top: 3px solid #00ff88;
border-radius: 50%;
animation: spin 1s linear infinite;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
</style>
</head>
<body>
<div id="root">
<!-- Initial loading placeholder -->
<div class="app-loading">
<div class="loading-spinner"></div>
</div>
</div>
<script type="module" src="/src/main.tsx"></script>
<!-- Service Worker Registration -->
<script>
if ('serviceWorker' in navigator) {
window.addEventListener('load', () => {
navigator.serviceWorker.register('/service-worker.js')
.then(registration => {
console.log('Service Worker registered successfully:', registration.scope);
})
.catch(error => {
console.log('Service Worker registration failed:', error);
});
});
}
// Remove loading spinner once React mounts
window.addEventListener('DOMContentLoaded', () => {
const checkRoot = setInterval(() => {
const root = document.getElementById('root');
if (root && root.children.length > 1) {
const loader = document.querySelector('.app-loading');
if (loader) {
loader.style.opacity = '0';
setTimeout(() => loader.remove(), 300);
}
clearInterval(checkRoot);
}
}, 100);
});
</script>
</body>
</html>