mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-06 12:52:26 +00:00
refactor: centralize styling system usage
This commit is contained in:
1 parent
0df93ba204
commit
92794d47dc
15 files changed
+395
-80
No files matched your search
@@ -2,6 +2,10 @@
|
||||
|
||||
import { createModalAccessibility } from "./modalAccessibility.js";
|
||||
import { Nip71FormManager } from "./nip71FormManager.js";
|
||||
import {
|
||||
applyDynamicStyles,
|
||||
removeDynamicStyles,
|
||||
} from "../styleSystem.js";
|
||||
|
||||
export class UploadModal {
|
||||
constructor({
|
||||
@@ -761,7 +765,7 @@ export class UploadModal {
|
||||
if (!Number.isFinite(fraction) || fraction < 0) {
|
||||
this.cloudflareProgressBar.classList.add("hidden");
|
||||
this.cloudflareProgressBar.setAttribute("aria-hidden", "true");
|
||||
this.cloudflareProgressFill.style.width = "0%";
|
||||
removeDynamicStyles(this.cloudflareProgressFill, { slot: "r2-progress" });
|
||||
this.cloudflareProgressFill.setAttribute("aria-valuenow", "0");
|
||||
this.emit("upload:r2-progress", { fraction: null });
|
||||
return;
|
||||
@@ -772,7 +776,11 @@ export class UploadModal {
|
||||
|
||||
this.cloudflareProgressBar.classList.remove("hidden");
|
||||
this.cloudflareProgressBar.setAttribute("aria-hidden", "false");
|
||||
this.cloudflareProgressFill.style.width = `${percent}%`;
|
||||
applyDynamicStyles(
|
||||
this.cloudflareProgressFill,
|
||||
{ "--cloudflare-progress-width": `${percent}%` },
|
||||
{ slot: "r2-progress" },
|
||||
);
|
||||
this.cloudflareProgressFill.setAttribute("aria-valuenow", `${percent}`);
|
||||
this.emit("upload:r2-progress", { fraction: clamped });
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user