mirror of
https://github.com/flectar/mail.git
synced 2026-11-11 17:57:54 +00:00
27 lines
936 B
Plaintext
27 lines
936 B
Plaintext
// Shared loading placeholder used by workspace lists and the retained message
|
|
// renderer. The shimmer only ticks while active, so settled screens do not
|
|
// keep requesting animation frames.
|
|
export component LoadingSkeletonBlock inherits Rectangle {
|
|
in property <bool> active: true;
|
|
in property <color> base-color;
|
|
in property <color> highlight-color;
|
|
in property <length> radius: 6px;
|
|
|
|
background: root.base-color;
|
|
border-radius: root.radius;
|
|
clip: true;
|
|
|
|
if root.active : Rectangle {
|
|
private property <float> phase: mod(animation-tick(), 1400ms) / 1400ms;
|
|
x: -self.width + self.phase * (parent.width + self.width);
|
|
width: max(64px, parent.width * 0.42);
|
|
height: parent.height;
|
|
background: @linear-gradient(
|
|
90deg,
|
|
transparent 0%,
|
|
root.highlight-color.transparentize(0.52) 50%,
|
|
transparent 100%
|
|
);
|
|
}
|
|
}
|