Skip to content
Snippets Groups Projects
Commit c2435be6 authored by Hugo NOUTS's avatar Hugo NOUTS
Browse files

fix(splashScreen): loading bar hatched design

parent 5c21da8d
No related branches found
No related tags found
2 merge requests!1001fix: loading bar hatched design,!9702.6 Release
...@@ -8,10 +8,9 @@ import './splashScreen.scss' ...@@ -8,10 +8,9 @@ import './splashScreen.scss'
const SplashScreen = ({ initStep }: { initStep: InitSteps }) => { const SplashScreen = ({ initStep }: { initStep: InitSteps }) => {
const { t } = useI18n() const { t } = useI18n()
const getProgress = () => { const getProgress = () => {
const total: number = Object.values(InitSteps).length / 2 const total = Object.values(InitSteps).length / 2
const progress: number = const progress = initStep === 0 ? 10 : Math.round((initStep / total) * 100)
initStep === 0 ? 10 : Math.round((initStep / total) * 100) return progress - 90 /* hack to make the progress bar start way left */
return progress
} }
return ( return (
<> <>
...@@ -23,7 +22,7 @@ const SplashScreen = ({ initStep }: { initStep: InitSteps }) => { ...@@ -23,7 +22,7 @@ const SplashScreen = ({ initStep }: { initStep: InitSteps }) => {
<div className="splash-progress-bar-container"> <div className="splash-progress-bar-container">
<div <div
className="splash-progress-bar-content" className="splash-progress-bar-content"
style={{ width: `${getProgress()}%` }} style={{ left: `${getProgress()}%` }}
/> />
</div> </div>
</div> </div>
......
...@@ -48,7 +48,7 @@ exports[`SplashRoot component should be rendered correctly 1`] = ` ...@@ -48,7 +48,7 @@ exports[`SplashRoot component should be rendered correctly 1`] = `
className="splash-progress-bar-content" className="splash-progress-bar-content"
style={ style={
Object { Object {
"width": "17%", "left": "-73%",
} }
} }
/> />
......
...@@ -27,7 +27,7 @@ exports[`SplashScreen component should be rendered correctly 1`] = ` ...@@ -27,7 +27,7 @@ exports[`SplashScreen component should be rendered correctly 1`] = `
className="splash-progress-bar-content" className="splash-progress-bar-content"
style={ style={
Object { Object {
"width": "17%", "left": "-73%",
} }
} }
/> />
......
...@@ -72,7 +72,6 @@ ...@@ -72,7 +72,6 @@
border-radius: 12px; border-radius: 12px;
box-sizing: border-box; box-sizing: border-box;
max-width: 350px; max-width: 350px;
.splash-progress-bar-container { .splash-progress-bar-container {
flex: 1; flex: 1;
height: 12px; height: 12px;
...@@ -90,29 +89,16 @@ ...@@ -90,29 +89,16 @@
background-size: 9px 9px; background-size: 9px 9px;
border: solid 1px $gold-shadow; border: solid 1px $gold-shadow;
border-radius: 12px; border-radius: 12px;
overflow: hidden;
position: relative;
.splash-progress-bar-content { .splash-progress-bar-content {
height: 12px;
box-sizing: border-box;
background-color: $gold-shadow; background-color: $gold-shadow;
border: solid 1px $gold-shadow; position: absolute;
border-radius: 12px 4px 0 12px; bottom: -150px;
border-right: none; left: -100%;
transition: all 300ms ease; height: 300px;
position: relative; width: 100%;
overflow: hidden; transform: rotate(45deg);
top: -1px;
left: -1px;
&:after {
content: '';
position: absolute;
display: block;
transform: rotate(45deg);
background-color: $dark-2;
width: 15px;
height: 15px;
right: -9px;
top: -8px;
}
} }
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment