mirror of
https://github.com/driftywinds/driftywinds.github.io.git
synced 2025-12-19 11:03:32 +00:00
Re-add loading screen
This commit is contained in:
@@ -42,6 +42,7 @@ export function main(callback, fallbackURL = "../../") {
|
||||
setApps(json.apps);
|
||||
// main(json);
|
||||
callback(json);
|
||||
loaded();
|
||||
waitForAllImagesToLoad();
|
||||
})
|
||||
.catch(error => {
|
||||
@@ -57,7 +58,7 @@ export function main(callback, fallbackURL = "../../") {
|
||||
// New img element that won't be rendered to the DOM
|
||||
var newImage = document.createElement("img");
|
||||
// Attach load listener
|
||||
newImage.addEventListener("load", loaded);
|
||||
// newImage.addEventListener("load", imageLoaded);
|
||||
// Set src
|
||||
newImage.src = image.src;
|
||||
|
||||
@@ -66,15 +67,17 @@ export function main(callback, fallbackURL = "../../") {
|
||||
if (event.target.id == "app-icon") {
|
||||
event.target.src = `${fallbackURL}common/assets/img/generic_app.jpeg`;
|
||||
} else event.target.remove()
|
||||
// loaded();
|
||||
// imageLoaded();
|
||||
});
|
||||
});
|
||||
|
||||
function imageLoaded() {
|
||||
if (++count == allImages.length) loaded();
|
||||
}
|
||||
}
|
||||
|
||||
function loaded() {
|
||||
if (++count == allImages.length) {
|
||||
document.querySelector("body").classList.remove("loading");
|
||||
document.getElementById("loading").remove();
|
||||
}
|
||||
}
|
||||
document.getElementById("loading")?.remove();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,11 @@
|
||||
<link rel="stylesheet" href="../../common/style.css">
|
||||
<link rel="stylesheet" href="all-apps.css">
|
||||
</head>
|
||||
<body>
|
||||
<body class="loading">
|
||||
<div id="loading">
|
||||
<img src="../../common/assets/img/loading.gif" alt="loading">
|
||||
<p>Loading</p>
|
||||
</div>
|
||||
<!-- Add to AltStore banner & navigation bar -->
|
||||
<div id="top"></div>
|
||||
<div id="main">
|
||||
|
||||
@@ -15,7 +15,11 @@
|
||||
<link rel="stylesheet" href="../../common/style.css">
|
||||
<link rel="stylesheet" href="app.css">
|
||||
</head>
|
||||
<body>
|
||||
<body class="loading">
|
||||
<div id="loading">
|
||||
<img src="../../common/assets/img/loading.gif" alt="loading">
|
||||
<p>Loading</p>
|
||||
</div>
|
||||
<div id="top">
|
||||
<!-- Navigation bar -->
|
||||
<div id="nav-bar">
|
||||
|
||||
@@ -15,7 +15,11 @@
|
||||
<link rel="stylesheet" href="../../../common/style.css">
|
||||
<link rel="stylesheet" href="version-history.css">
|
||||
</head>
|
||||
<body>
|
||||
<body class="loading">
|
||||
<div id="loading">
|
||||
<img src="../../../common/assets/img/loading.gif" alt="loading">
|
||||
<p>Loading</p>
|
||||
</div>
|
||||
<!-- Add to AltStore banner & navigation bar -->
|
||||
<div id="top"></div>
|
||||
<div id="main">
|
||||
|
||||
@@ -14,7 +14,11 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" href="../common/style.css">
|
||||
</head>
|
||||
<body>
|
||||
<body class="loading">
|
||||
<div id="loading">
|
||||
<img src="../common/assets/img/loading.gif" alt="loading">
|
||||
<p>Loading</p>
|
||||
</div>
|
||||
<!-- Add to AltStore banner -->
|
||||
<div id="top">
|
||||
<div id="nav-bar" class="hide-border">
|
||||
|
||||
@@ -15,7 +15,11 @@
|
||||
<link rel="stylesheet" href="../../common/style.css">
|
||||
<link rel="stylesheet" href="news.css">
|
||||
</head>
|
||||
<body>
|
||||
<body class="loading">
|
||||
<div id="loading">
|
||||
<img src="../../common/assets/img/loading.gif" alt="loading">
|
||||
<p>Loading</p>
|
||||
</div>
|
||||
<!-- Add to AltStore banner & navigation bar -->
|
||||
<div id="top"></div>
|
||||
<div id="main">
|
||||
|
||||
Reference in New Issue
Block a user