Skip to content

Commit

Permalink
add spinner to generator
Browse files Browse the repository at this point in the history
  • Loading branch information
grunenwald committed Jun 10, 2021
1 parent 2900758 commit 230d7f1
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
19 changes: 19 additions & 0 deletions css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,22 @@ form .col {
#section-about {
font-size: 1.3em;
}

#loading {
display: none;
justify-content: center;
align-items: center;
position: fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
opacity: 0.7;
background-color: #ddd;
z-index: 99;
}

#loading-image {
display: block;
z-index: 100;
}
Binary file added images/loading.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@

</head>
<body class="blue-grey darken-4 white-text">

<div id="loading">
<img id="loading-image" src="images/loading.gif" alt="Loading..." />
</div>

<div class="container">
<div class="center">
<h1>PWA Playlist Generator</h1>
Expand Down
2 changes: 2 additions & 0 deletions js/generator-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ function generatePWAZip(dataHtml, dataManifest)
.then((blob) =>
{
// Triggers the download
document.getElementById("loading").style.display = "none";
triggerDownload(title, blob);
});
})
Expand Down Expand Up @@ -275,6 +276,7 @@ document.querySelector('#input-icon512').addEventListener('change', (evt) =>
document.querySelector('#btn-pwa-generate').addEventListener('click', (evt) =>
{
evt.preventDefault();
document.getElementById("loading").style.display = "flex";

// Builds the HTML tree based on the tree structure
audioFileID = 1;
Expand Down

0 comments on commit 230d7f1

Please sign in to comment.