1
1
<!DOCTYPE html>
2
2
<html>
3
+
3
4
<head>
4
5
<!--
5
6
If you are serving your web app in a path other than the root, change the
18
19
19
20
<meta charset="UTF-8">
20
21
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
21
- <meta name="description" content="Stacke Application ">
22
+ <meta name="description" content="Learn Flutter Web the Right way ">
22
23
23
24
<!-- iOS meta tags & icons -->
24
25
<meta name="apple-mobile-web-app-capable" content="yes">
27
28
<link rel="apple-touch-icon" href="icons/Icon-192.png">
28
29
29
30
<!-- Favicon -->
30
- <link rel="icon" type="image/png" href="favicon.png"/>
31
+ <link rel="icon" type="image/png" href="favicon.png" />
31
32
32
33
<!-- Fonts -->
33
34
<link rel="preconnect" href="https://fonts.googleapis.com">
34
35
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
35
36
36
- <!-- Import the Open Sans Font from Google Fonts -->
37
- <link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;600;700;800&display=swap" rel="stylesheet">
38
37
39
38
<title>My Stacked Application</title>
40
39
<link rel="manifest" href="manifest.json">
46
45
<!-- This script adds the flutter initialization JS code -->
47
46
<script src="flutter.js" defer></script>
48
47
</head>
48
+
49
49
<body>
50
50
<style>
51
+
51
52
body {
52
53
background-color: #0A0A0A;
53
54
height: 100vh;
54
55
width: 100vw;
56
+ position: fixed;
57
+ inset: 0px;
58
+ overflow: hidden;
59
+ padding: 0px;
60
+ margin: 0px;
61
+ user-select: none;
62
+ touch-action: none;
55
63
}
56
64
57
65
.main-content {
60
68
display: flex;
61
69
align-items: center;
62
70
justify-content: center;
71
+ transition: opacity .4s ease-out;
63
72
}
64
73
65
74
img {
66
75
width: 100px;
67
76
height: 100px;
77
+ position: absolute;
68
78
}
69
79
70
80
p {
71
81
color: #fff;
72
82
}
73
83
84
+
85
+ .loader {
86
+ position: relative;
87
+ width: 250px;
88
+ height: 250px;
89
+ border-radius: 50%;
90
+ background: linear-gradient(#f07e6e, #84cdfa, #5ad1cd);
91
+ animation: animate 1.2s linear infinite;
92
+ }
93
+
94
+ @keyframes animate {
95
+ 0% {
96
+ transform: rotate(0deg);
97
+ }
98
+
99
+ 100% {
100
+ transform: rotate(360deg);
101
+ }
102
+ }
103
+
104
+ .loader span {
105
+ position: absolute;
106
+ width: 100%;
107
+ height: 100%;
108
+ border-radius: 60%;
109
+ background: linear-gradient(#f07e6e, #84cdfa, #5ad1cd);
110
+ }
111
+
112
+ .loader span:nth-child(1) {
113
+ filter: blur(5px);
114
+ }
115
+
116
+ .loader span:nth-child(2) {
117
+ filter: blur(10px);
118
+ }
119
+
120
+ .loader span:nth-child(3) {
121
+ filter: blur(25px);
122
+ }
123
+
124
+ .loader span:nth-child(4) {
125
+ filter: blur(50px);
126
+ }
127
+
128
+ .loader:after {
129
+ content: '';
130
+ position: absolute;
131
+ top: 10px;
132
+ left: 10px;
133
+ right: 10px;
134
+ bottom: 10px;
135
+ background: #191919;
136
+ border-radius: 50%;
137
+ }
74
138
</style>
75
139
<script>
76
- window.addEventListener('load', function(ev) {
140
+ function delay(time) {
141
+ return new Promise(resolve => setTimeout(resolve, time));
142
+ }
143
+
144
+ window.addEventListener('load', function (ev) {
145
+ var loaderContent = document.querySelector('#loader-content');
77
146
// Download main.dart.js
78
147
_flutter.loader.loadEntrypoint({
79
148
serviceWorker: {
80
149
serviceWorkerVersion: serviceWorkerVersion,
81
150
}
82
- }).then(function(engineInitializer) {
151
+ }).then(function (engineInitializer) {
83
152
return engineInitializer.initializeEngine();
84
- }).then(function(appRunner) {
85
- return appRunner.runApp();
153
+ }).then(async function (appRunner) {
154
+ loaderContent.style.opacity = "0";
155
+ await delay(400);
156
+ await appRunner.runApp();
86
157
});
87
158
});
88
159
</script>
89
- <div class="main-content">
160
+ <div class="main-content" id="loader-content">
161
+ <div class="loader">
162
+ <span></span>
163
+ <span></span>
164
+ <span></span>
165
+ <span></span>
166
+ </div>
90
167
<img src="main-icon.png" />
91
168
</div>
92
169
</body>
93
- </html>
170
+
171
+ </html>
0 commit comments