1 type ProgressBarOptions = {
5 function calculatePercent(current: number, max: number): number {
6 return (current / max) * 100;
9 export function progressBar(current: number, max: number, options: ProgressBarOptions): string {
10 const percent = calculatePercent(current, max)
12 <div class="progress d-inline-block" title="${percent}%">
13 <div class="progress-bar bg-${options.color}" role="progressbar" style="width: ${percent}%;" aria-valuenow="${percent}" aria-valuemin="0" aria-valuemax="100">
20 export function actionLog(text: string, replace: boolean = true) {
21 const str = `<div class="log-item animated fadeIn" title="${Date.now()}">${text}</div>`;
23 replace ? $(`#action-log`).html(str): $(`#action-log`).append(str);