Skip to content

Commit 717e81a

Browse files
author
hoang.tran12
committed
optimize popup load speed
1 parent 00f7b4a commit 717e81a

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

popup/main.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import("./index.js").then(() => {
2+
document.querySelector("#loading-fullscreen")?.remove();
3+
});

popup/popup.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,13 @@ <h3 class="modal-title">Modal Title</h3>
4848
</div>
4949
</div>
5050

51-
<script type="module" src="./index.js"></script>
51+
<!-- loading fullscreen -->
52+
<div id="loading-fullscreen" class="loading-container">
53+
<div class="loader"></div>
54+
</div>
55+
56+
<!-- <script type="module" src="./index.js"></script> -->
57+
<script src="main.js"></script>
5258
</body>
5359

5460
</html>

popup/styles/style.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,14 @@ a:hover {
388388
}
389389

390390
/* --------- Loading --------- */
391+
#loading-fullscreen {
392+
position: fixed;
393+
top: 0;
394+
left: 0;
395+
right: 0;
396+
bottom: 0;
397+
}
398+
391399
.loading-container {
392400
position: fixed;
393401
top: 0;

0 commit comments

Comments
 (0)