Skip to content

Commit

Permalink
feat: adding loading images to make it more clear when the GIF is act…
Browse files Browse the repository at this point in the history
…ually finished loading
  • Loading branch information
dbirman committed Feb 29, 2024
1 parent 5ed92fa commit ce04186
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 0 deletions.
Binary file removed images/gif/neuron23.gif
Binary file not shown.
Binary file removed images/gif/neuron610.gif
Binary file not shown.
Binary file added images/loading_gif.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/loading_png.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed images/png/neuron23.png
Binary file not shown.
Binary file removed images/png/neuron610.png
Binary file not shown.
8 changes: 8 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,12 @@

let buttons = []

let pngLoading = new Image();
let gifLoading = new Image();

function setup() {
pngLoading.src = "./images/loading_png.png";
gifLoading.src = "./images/loading_gif.png";

setupButtons();

Expand Down Expand Up @@ -766,6 +771,9 @@
}

// Change the image lement sources
document.getElementById('gifImage').src = gifLoading.src;
document.getElementById('pngImage').src = pngLoading.src;

document.getElementById('gifImage').src = `https://data.virtualbrainlab.org/NPUltra/gif/neuron${idx}.gif`;
document.getElementById('pngImage').src = `https://data.virtualbrainlab.org/NPUltra/png/neuron${idx}.png`;
}
Expand Down

0 comments on commit ce04186

Please sign in to comment.