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",
position: "relative",
justifyContent: "center",
backgroundColor: vars.color.darkBackground,
border: `solid 1px ${vars.color.border}`,
overflow: "hidden",
});
export const progressBarFill = style({
export const progressBar = style({
WebkitAppearance: "none",
appearance: "none",
position: "absolute",
transition: "width 0.1s",
height: "100%",
left: 0,
background: vars.color.background,
width: "100%",
"::-webkit-progress-value": {
backgroundColor: vars.color.background,
transition: "width 0.2s",
},
"::-webkit-progress-bar": {
backgroundColor: vars.color.darkBackground,
},
});
export const progressBarText = style({

View File

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