Skip to content

Commit aed6804

Browse files
committed
style(web): optimize index.html structure and formatting
- Minify HTML structure for better readability and performance - Consolidate script tags for service worker and flutter.js - Adjust CSS styling for better consistency - Simplify splash screen removal script - Remove unnecessary white spaces and line breaks
1 parent ed80045 commit aed6804

File tree

9 files changed

+22
-29
lines changed

9 files changed

+22
-29
lines changed

web/index.html

Lines changed: 22 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
<!DOCTYPE html>
2-
<html>
3-
4-
<head>
1+
<!DOCTYPE html><html><head>
52
<!--
63
If you are serving your web app in a path other than the root, change the
74
href value below to reflect the base path you are serving from.
@@ -40,6 +37,12 @@
4037

4138

4239

40+
41+
42+
<script>
43+
var serviceWorkerVersion = null;
44+
</script>
45+
<script src="flutter.js" defer=""></script>
4346
<style id="splash-screen-style">
4447
html {
4548
height: 100%
@@ -49,7 +52,7 @@
4952
margin: 0;
5053
min-height: 100%;
5154
background-color: #FFFFFF;
52-
background-size: 100% 100%;
55+
background-size: 100% 100%;
5356
}
5457

5558
.center {
@@ -62,22 +65,19 @@
6265
}
6366

6467
.contain {
65-
display: block;
66-
width: 100%;
67-
height: 100%;
68+
display:block;
69+
width:100%; height:100%;
6870
object-fit: contain;
6971
}
7072

7173
.stretch {
72-
display: block;
73-
width: 100%;
74-
height: 100%;
74+
display:block;
75+
width:100%; height:100%;
7576
}
7677

7778
.cover {
78-
display: block;
79-
width: 100%;
80-
height: 100%;
79+
display:block;
80+
width:100%; height:100%;
8181
object-fit: cover;
8282
}
8383

@@ -104,33 +104,25 @@
104104
@media (prefers-color-scheme: dark) {
105105
body {
106106
background-color: #212121;
107-
}
107+
}
108108
}
109109
</style>
110110
<script id="splash-screen-script">
111111
function removeSplashFromWeb() {
112112
document.getElementById("splash")?.remove();
113113
document.getElementById("splash-branding")?.remove();
114-
document.getElementById("splash-container")?.remove();
115114
document.body.style.background = "transparent";
116115
}
117116
</script>
118-
<script>
119-
var serviceWorkerVersion = null;
120-
</script>
121-
<script src="flutter.js" defer></script>
122117
</head>
123118

124119
<body>
125120
<picture id="splash">
126-
<source
127-
srcset="splash/img/light-1x.png 1x, splash/img/light-2x.png 2x, splash/img/light-3x.png 3x, splash/img/light-4x.png 4x"
128-
media="(prefers-color-scheme: light)">
129-
<source
130-
srcset="splash/img/dark-1x.png 1x, splash/img/dark-2x.png 2x, splash/img/dark-3x.png 3x, splash/img/dark-4x.png 4x"
131-
media="(prefers-color-scheme: dark)">
132-
<img class="center" aria-hidden="true" src="splash/img/light-1x.png" alt="">
121+
<source srcset="splash/img/light-1x.png 1x, splash/img/light-2x.png 2x, splash/img/light-3x.png 3x, splash/img/light-4x.png 4x" media="(prefers-color-scheme: light)">
122+
<source srcset="splash/img/dark-1x.png 1x, splash/img/dark-2x.png 2x, splash/img/dark-3x.png 3x, splash/img/dark-4x.png 4x" media="(prefers-color-scheme: dark)">
123+
<img class="center" aria-hidden="true" src="splash/img/light-1x.png" alt="">
133124
</picture>
125+
134126

135127
<div id="splash-container" class="center">
136128
<div class="loader"></div>
@@ -150,6 +142,7 @@
150142
});
151143
});
152144
</script>
153-
</body>
154145

155-
</html>
146+
147+
148+
</body></html>

web/splash/img/dark-1x.png

-7.63 KB
Loading

web/splash/img/dark-2x.png

-27.8 KB
Loading

web/splash/img/dark-3x.png

-54.9 KB
Loading

web/splash/img/dark-4x.png

-80 KB
Loading

web/splash/img/light-1x.png

7.63 KB
Loading

web/splash/img/light-2x.png

27.8 KB
Loading

web/splash/img/light-3x.png

54.9 KB
Loading

web/splash/img/light-4x.png

80 KB
Loading

0 commit comments

Comments
 (0)