Skip to content

Commit

Permalink
Update loader screen style
Browse files Browse the repository at this point in the history
  • Loading branch information
DrA1ex committed Sep 21, 2023
1 parent 9b69906 commit 646eb69
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="loading-screen" [ngClass]="{visible}">
<div class="loading-screen-progress">
<h3 class="text-center">{{label}}</h3>
<div class="panel loading-screen-progress">
<h3 class="text-center">{{label}}<span class="spinner dots"></span></h3>
<div class="progress">
<div class="progress-bar progress-bar-striped progress-bar-animated"
role="progressbar" [style.width.%]="total > 0 ? (current / total) * 100 : 0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export type LoadingConverterFn = (value: number) => string;
styleUrls: ['./loading-screen.component.css']
})
export class LoadingScreenComponent {
@Input() label = "Loading...";
@Input() label = "Loading";
@Input() visible: boolean = false;

@Input() current: number = 0
Expand Down
2 changes: 1 addition & 1 deletion src/app/pages/demo3/demo3.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ <h2>Source image</h2>
<div class="col-md-6">
<h2>
Generated Image
<span class="spinner ms-2" *ngIf="isRendering"></span>
<span class="spinner circle ms-2" *ngIf="isRendering"></span>
</h2>
<binary-image-drawer class="border border-2" [canvasWidth]="400" [canvasHeight]="400"
#generatedImage></binary-image-drawer>
Expand Down
35 changes: 34 additions & 1 deletion src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,50 @@
cursor: not-allowed;
}

.panel {
padding: 1.5rem 1rem;
background: white;
border: 2px #888e92 solid;
border-radius: 0.3rem;
}

.spinner {
display: inline-block;
width: 1em;
height: 1em;

line-height: 1;
background-image: url('data:image/svg+xml,<%3Fxml version="1.0" encoding="UTF-8"%3F><svg display="block" style="background:transparent; margin:auto" preserveAspectRatio="xMidYMid" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="29" fill="none" stroke="%231d0e0b" stroke-dasharray="136.659280431156 47.553093477052" stroke-width="7"><animateTransform attributeName="transform" dur="1s" keyTimes="0;1" repeatCount="indefinite" type="rotate" values="0 50 50;360 50 50"/></circle></svg>');
}

.spinner::before {
content: " ";
box-sizing: border-box;
display: inline-block;
}

.spinner.circle {
background-image: url('data:image/svg+xml,<%3Fxml version="1.0" encoding="UTF-8"%3F><svg display="block" style="background:transparent; margin:auto" preserveAspectRatio="xMidYMid" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="29" fill="none" stroke="%231d0e0b" stroke-dasharray="136.659280431156 47.553093477052" stroke-width="7"><animateTransform attributeName="transform" dur="1s" keyTimes="0;1" repeatCount="indefinite" type="rotate" values="0 50 50;360 50 50"/></circle></svg>');
}

.spinner.dots {
text-align: left;
}

.spinner.dots::before {
content: ".";
animation: dot-animation infinite 1s linear;
}

@keyframes dot-animation {
0% {
content: ".";
}

20% {
content: "..";
}

40% {
content: "...";
}
}

0 comments on commit 646eb69

Please sign in to comment.