refactor to use html5 progress tag

This commit is contained in:
Zamitto 2024-05-21 13:11:48 -03:00
parent a5dc101e6b
commit d20d3d0b77
2 changed files with 16 additions and 10 deletions

View File

@ -34,17 +34,22 @@ export const progressBarContainer = style({
alignItems: "center", alignItems: "center",
position: "relative", position: "relative",
justifyContent: "center", justifyContent: "center",
backgroundColor: vars.color.darkBackground,
border: `solid 1px ${vars.color.border}`, border: `solid 1px ${vars.color.border}`,
overflow: "hidden", overflow: "hidden",
}); });
export const progressBarFill = style({ export const progressBar = style({
WebkitAppearance: "none",
appearance: "none",
position: "absolute", position: "absolute",
transition: "width 0.1s", width: "100%",
height: "100%", "::-webkit-progress-value": {
left: 0, backgroundColor: vars.color.background,
background: vars.color.background, transition: "width 0.2s",
},
"::-webkit-progress-bar": {
backgroundColor: vars.color.darkBackground,
},
}); });
export const progressBarText = style({ export const progressBarText = style({

View File

@ -54,10 +54,11 @@ export default function Splash() {
<> <>
<p>{t("downloading_version", { version: newVersion })}</p> <p>{t("downloading_version", { version: newVersion })}</p>
<div className={styles.progressBarContainer}> <div className={styles.progressBarContainer}>
<div <progress
className={styles.progressBarFill} className={styles.progressBar}
style={{ width: `${status.info.percent}%` }} max="100"
></div> value={status.info.percent}
/>
<span className={styles.progressBarText}> <span className={styles.progressBarText}>
{status.info.percent.toFixed(2)} % {status.info.percent.toFixed(2)} %
</span> </span>