mirror of
https://github.com/netbymatt/ws4kp.git
synced 2026-04-17 00:59:29 -07:00
cute progress bar animations
This commit is contained in:
@@ -75,13 +75,13 @@ class Progress extends WeatherDisplay {
|
||||
// calculate loaded percent
|
||||
const loadedPercent = (loadedCount / displays.length);
|
||||
|
||||
this.progressCover.style.width = `${(1.0 - loadedPercent) * 100}%`;
|
||||
if (loadedPercent < 1.0) {
|
||||
// show the progress bar and set width
|
||||
this.progressCover.parentNode.classList.add('show');
|
||||
this.progressCover.style.width = `${(1.0 - loadedPercent) * 100}%`;
|
||||
} else {
|
||||
// hide the progressbar
|
||||
this.progressCover.parentNode.classList.remove('show');
|
||||
// hide the progressbar after 1 second (lines up with with width transition animation)
|
||||
setTimeout(() => this.progressCover.parentNode.classList.remove('show'), 1000);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user