+export interface ProgressBarOptions {
+ startingColor: string;
+ endingColor: string;
+}
+
+export function ProgressBar(current: number, max: number, id: string, opts: ProgressBarOptions) {
+ let percent = 0;
+ if(max > 0) {
+ percent = Math.floor((current / max) * 100);
+ }
+
+ return `<div class="progress-bar" id="${id}" style="background: linear-gradient(to right, ${opts.startingColor}, ${opts.endingColor} ${percent}%, transparent ${percent}%, transparent)"
+title="${percent}% - ${current}/${max}">${current}/${max} - ${percent}%</div>`;
+}