I'm currently working on creating a progress bar component in Angular, and everything seems to be functioning well except for covering the parent element.
If you'd like to see the code in action, check it out here:
Code Demo: Current Angular Code
CSS Styles:
:host {
box-sizing: border-box;
border: 1px solid green;
display: flex;
justify-content: center;
align-items: center;
}
:host> .loader {
border: 3px solid rgba(126, 132, 138, 0.1);
border-radius: 50%;
border-top: 3px solid red;
width: 40px;
height: 40px;
-webkit-animation: spin 1s linear infinite; /* Safari */
animation: spin 1s linear infinite;
text-align: center;
display: inline-block;
z-index: 1010;
opacity: 1;
}
@-webkit-keyframes spin {
0% {
-webkit-transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
}
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
Basic HTML Structure:
<div class="loader" *ngIf="isLoading"></div>