Adder Global Loading spiner for api calls

This commit is contained in:
2024-04-28 15:32:15 +05:30
parent 1d53333667
commit c1250b7649
11 changed files with 178 additions and 9 deletions
+3
View File
@@ -0,0 +1,3 @@
<div *ngIf="this.loader.getLoading()" class="cssload-container">
<div class="cssload-speeding-wheel"></div>
</div>
+65
View File
@@ -0,0 +1,65 @@
.cssload-container {
position: fixed;
width: 100%;
left: 0;
right: 0;
top: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.7);
z-index: 9999;
}
.cssload-speeding-wheel {
content: "";
display: block;
position: absolute;
left: 48%;
top: 40%;
width: 63px;
height: 63px;
margin: 0 auto;
border: 4px solid hsl(45, 54%, 58%);
border-radius: 50%;
border-left-color: transparent;
border-right-color: transparent;
animation: cssload-spin 500ms infinite linear;
-o-animation: cssload-spin 500ms infinite linear;
-ms-animation: cssload-spin 500ms infinite linear;
-webkit-animation: cssload-spin 500ms infinite linear;
-moz-animation: cssload-spin 500ms infinite linear;
}
@keyframes cssload-spin {
100% {
transform: rotate(360deg);
transform: rotate(360deg);
}
}
@-o-keyframes cssload-spin {
100% {
-o-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@-ms-keyframes cssload-spin {
100% {
-ms-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@-webkit-keyframes cssload-spin {
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@-moz-keyframes cssload-spin {
100% {
-moz-transform: rotate(360deg);
transform: rotate(360deg);
}
}
+23
View File
@@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { SpinnerComponent } from './spinner.component';
describe('SpinnerComponent', () => {
let component: SpinnerComponent;
let fixture: ComponentFixture<SpinnerComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [SpinnerComponent]
})
.compileComponents();
fixture = TestBed.createComponent(SpinnerComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
+14
View File
@@ -0,0 +1,14 @@
import { Component, ViewEncapsulation } from '@angular/core';
import { LoaderService } from '../services/loader.service';
@Component({
selector: 'app-spinner',
templateUrl: './spinner.component.html',
styleUrl: './spinner.component.scss',
encapsulation: ViewEncapsulation.ShadowDom
})
export class SpinnerComponent {
constructor(public loader: LoaderService) {
}
}