Skip to content

Commit

Permalink
Fix loading indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
aksylumoed committed Feb 7, 2024
1 parent 45bd8de commit a008f1a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 19 deletions.
14 changes: 6 additions & 8 deletions artworks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,14 @@ function displayInitialArtwork(index: number): void {
// Create a new Image object for loading
const newImage = new Image();
newImage.onload = () => {
setTimeout(() => {
// Image is fully loaded, and 3 seconds have passed, update src and display the image
initialArtworkElement.src = newImage.src;
initialArtworkElement.src = newImage.src;

if (loadingIndicator) {
loadingIndicator.style.display = 'none';
}
initialArtworkElement.style.display = "block"; // Show the image now that it's loaded and waited for 3 seconds

initialArtworkElement.style.display = "block"; // Show the image now that it's loaded and waited for 3 seconds
}, 1500);
// Hide the loading indicator
if (loadingIndicator) {
loadingIndicator.style.display = 'none';
}
};

// Start loading the new image
Expand Down
2 changes: 0 additions & 2 deletions dist/bundle.js

This file was deleted.

9 changes: 0 additions & 9 deletions dist/bundle.js.LICENSE.txt

This file was deleted.

0 comments on commit a008f1a

Please sign in to comment.