Unverified Commit 36d99a2d authored by Marcos Iglesias's avatar Marcos Iglesias Committed by GitHub

Animation mimics LPL animation for shimmering loader (#452)

* Animation mimics LPL animation for shimmering loader

* Adds Daniel comments
parent 4be8d3de
...@@ -5,16 +5,16 @@ import "./styles.scss"; ...@@ -5,16 +5,16 @@ import "./styles.scss";
const ShimmeringDashboardLoader: React.FC = () => { const ShimmeringDashboardLoader: React.FC = () => {
return (<div className="shimmer-loader"> return (<div className="shimmer-loader">
<div className="shimmer-loader-row"> <div className="shimmer-loader-row">
<div className="shimmer-loader-cell double animate" /> <div className="shimmer-loader-cell double is-shimmer-animated" />
<div className="shimmer-loader-cell simple animate" /> <div className="shimmer-loader-cell simple is-shimmer-animated" />
</div> </div>
<div className="shimmer-loader-row"> <div className="shimmer-loader-row">
<div className="shimmer-loader-cell simple animate" /> <div className="shimmer-loader-cell simple is-shimmer-animated" />
<div className="shimmer-loader-cell double animate" /> <div className="shimmer-loader-cell double is-shimmer-animated" />
</div> </div>
<div className="shimmer-loader-row"> <div className="shimmer-loader-row">
<div className="shimmer-loader-cell double animate" /> <div className="shimmer-loader-cell double is-shimmer-animated" />
<div className="shimmer-loader-cell simple animate" /> <div className="shimmer-loader-cell simple is-shimmer-animated" />
</div> </div>
</div>); </div>);
}; };
......
@import 'variables'; @import "variables";
$loading-duration: 1s; $loading-duration: 1s;
$gradient-start-color: $gray5; $loading-curve: cubic-bezier(0.45, 0, 0.15, 1);
$gradient-end-color: $gray15;
$shimmer-border-radius: 4px;
$shimmer-border-color: $gray20; $shimmer-border-color: $gray20;
$shimmer-height: 22vh; $shimmer-height: 22vh;
$shimmer-block-spacing: 16px; $shimmer-block-spacing: 16px;
@keyframes shimmer { @keyframes shimmer {
0% { 0% {
background-position: -1000px 0; background-position: 100% 0;
} }
100% { 100% {
background-position: 1000px 0; background-position: 0 0;
} }
} }
.animate { .is-shimmer-animated {
animation : shimmer $loading-duration infinite; animation: $loading-duration shimmer $loading-curve infinite;
background: linear-gradient(to right, $gradient-start-color 4%, $gradient-end-color 25%, $gradient-start-color 36%); background-image: linear-gradient(
background-size: 1000px 100%; to right,
$gray10 0%,
$gray10 33%,
$gray5 50%,
$gray10 67%,
$gray10 100%
);
background-repeat: no-repeat;
background-size: 300% 100%;
} }
.shimmer-loader { .shimmer-loader {
width: 100%; width: 100%;
border: 1px solid $shimmer-border-color; border: 1px solid $shimmer-border-color;
border-radius: $shimmer-border-radius;
height: $shimmer-height; height: $shimmer-height;
display: flex; display: flex;
justify-content: space-around; justify-content: space-around;
...@@ -44,7 +49,6 @@ $shimmer-block-spacing: 16px; ...@@ -44,7 +49,6 @@ $shimmer-block-spacing: 16px;
} }
} }
.shimmer-loader-cell { .shimmer-loader-cell {
border-radius: $shimmer-border-radius;
margin-bottom: $shimmer-block-spacing; margin-bottom: $shimmer-block-spacing;
&:last-child { &:last-child {
...@@ -57,4 +61,3 @@ $shimmer-block-spacing: 16px; ...@@ -57,4 +61,3 @@ $shimmer-block-spacing: 16px;
height: 60%; height: 60%;
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment