Skip to content

Commit ffadc15

Browse files
committed
feat: add loading indicator
- Added loading indicator - Improved initial UX
1 parent 576e6ff commit ffadc15

File tree

1 file changed

+52
-10
lines changed

1 file changed

+52
-10
lines changed

web/index.html

Lines changed: 52 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@
3131
<link rel="manifest" href="manifest.json">
3232
<style id="splash-screen-style">
3333
html {
34-
height: 100%
34+
height: 100%;
3535
}
3636

3737
body {
3838
margin: 0;
3939
min-height: 100%;
4040
background-color: #FFFFFF;
41-
background-size: 100% 100%;
41+
background-size: 100% 100%;
4242
}
4343

4444
.center {
@@ -51,19 +51,22 @@
5151
}
5252

5353
.contain {
54-
display:block;
55-
width:100%; height:100%;
54+
display: block;
55+
width: 100%;
56+
height: 100%;
5657
object-fit: contain;
5758
}
5859

5960
.stretch {
60-
display:block;
61-
width:100%; height:100%;
61+
display: block;
62+
width: 100%;
63+
height: 100%;
6264
}
6365

6466
.cover {
65-
display:block;
66-
width:100%; height:100%;
67+
display: block;
68+
width: 100%;
69+
height: 100%;
6770
object-fit: cover;
6871
}
6972

@@ -90,22 +93,61 @@
9093
@media (prefers-color-scheme: dark) {
9194
body {
9295
background-color: #212121;
93-
}
96+
}
97+
}
98+
99+
/* Styles for the loading indicator */
100+
#loading-indicator {
101+
position: fixed;
102+
top: 0;
103+
left: 0;
104+
width: 100%;
105+
height: 100%;
106+
background-color: #FFFFFF; /* Match body background */
107+
display: flex;
108+
justify-content: center;
109+
align-items: center;
110+
z-index: 9999; /* Ensure it's on top */
111+
}
112+
113+
@media (prefers-color-scheme: dark) {
114+
#loading-indicator {
115+
background-color: #212121; /* Match dark mode body background */
116+
}
117+
}
118+
119+
/* Simple spinner animation */
120+
.spinner {
121+
border: 4px solid rgba(0, 0, 0, 0.1);
122+
border-left-color: #0175C2; /* Use theme color from manifest */
123+
border-radius: 50%;
124+
width: 50px;
125+
height: 50px;
126+
animation: spin 1s linear infinite;
127+
}
128+
129+
@keyframes spin {
130+
0% { transform: rotate(0deg); }
131+
100% { transform: rotate(360deg); }
94132
}
95133
</style>
96134
<script id="splash-screen-script">
97135
function removeSplashFromWeb() {
98136
document.getElementById("splash")?.remove();
99137
document.getElementById("splash-branding")?.remove();
138+
document.getElementById("loading-indicator")?.remove(); // Remove the new loading indicator
100139
document.body.style.background = "transparent";
101140
}
102141
</script>
103142
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport">
104143
</head>
105144
<body>
145+
<div id="loading-indicator">
146+
<div class="spinner"></div>
147+
</div>
106148
<script>
107149
{{flutter_bootstrap_js}}
108150
</script>
109151

110152

111-
</body></html>
153+
</body></html>

0 commit comments

Comments
 (0)