ssb: Make the progress bar more indefinite-looking.
Some checks failed
Build Tilde Friends / Build-All (push) Has been cancelled

This commit is contained in:
2025-07-30 20:04:34 -04:00
parent 3c5c1756d1
commit f1d0151d71
2 changed files with 14 additions and 11 deletions

View File

@@ -1,5 +1,5 @@
{ {
"type": "tildefriends-app", "type": "tildefriends-app",
"emoji": "🦀", "emoji": "🦀",
"previous": "&Sxc7sz+X6FHHJiaLQU+E9Q0guS5yvqKyrZjF3ZyFStc=.sha256" "previous": "&JRzG7VkGOP1IzLdknli36Gr4PddIvkOEKt7L6IMw/lk=.sha256"
} }

View File

@@ -453,9 +453,9 @@ class TfElement extends LitElement {
reset_progress() { reset_progress() {
if (this.progress === undefined) { if (this.progress === undefined) {
this._progress_start = new Date();
requestAnimationFrame(this.update_progress.bind(this)); requestAnimationFrame(this.update_progress.bind(this));
} }
this.progress = 0;
} }
update_progress() { update_progress() {
@@ -463,8 +463,7 @@ class TfElement extends LitElement {
this.progress = undefined; this.progress = undefined;
return; return;
} }
const factor = 0.75; this.progress = (new Date() - this._progress_start).valueOf();
this.progress = (this.progress * factor) + (100.0 * (1.0 - factor));
requestAnimationFrame(this.update_progress.bind(this)); requestAnimationFrame(this.update_progress.bind(this));
} }
@@ -772,13 +771,17 @@ class TfElement extends LitElement {
Loading... Loading...
</div>` </div>`
: this.render_tab(); : this.render_tab();
let progress = this.progress !== undefined ? let progress =
html` this.progress !== undefined
? html`
<div style="position: absolute; width: 100%" id="progress"> <div style="position: absolute; width: 100%" id="progress">
<div class="w3-theme-l2" style=${`height: 4px; width: ${this.progress}%`}></div> <div
class="w3-theme-l2"
style=${`height: 4px; position: absolute; right: ${Math.cos(this.progress / 250) > 0 ? 'auto' : '0'}; width: ${50 * Math.sin(this.progress / 250) + 50}%`}
></div>
</div> </div>
` : `
undefined; : undefined;
return html` return html`
<div <div
style="width: 100vw; min-height: 100vh; height: 100vh; display: flex; flex-direction: column" style="width: 100vw; min-height: 100vh; height: 100vh; display: flex; flex-direction: column"