feat: Add loading spinner on card initialization (#1549)
* feat: Add loading spinner on card initialization * Minor doc fix.
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
border-radius: var(--ha-card-border-radius, 4px);
|
||||
|
||||
height: var(--frigate-card-height);
|
||||
min-height: 100px;
|
||||
|
||||
// Ensure all clicks at the top level work.
|
||||
pointer-events: all;
|
||||
@@ -29,6 +30,12 @@
|
||||
--frigate-card-height: auto;
|
||||
}
|
||||
|
||||
frigate-card-loading {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
:host([dark]) {
|
||||
filter: brightness(75%);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
:host {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
pointer-events: none;
|
||||
|
||||
transition: opacity 1s;
|
||||
}
|
||||
|
||||
:host([show]) {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
:host(:not([show])) {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
img {
|
||||
width: 40%;
|
||||
height: 40%;
|
||||
|
||||
opacity: 0.2;
|
||||
|
||||
filter: invert(100%);
|
||||
|
||||
animation: rotate 8s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes rotate {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user