Add loading placeholder animation and add it to custom software icons loading state (#33064)
This commit is contained in:
@@ -58,7 +58,7 @@ const SoftwareIcon = ({
|
||||
if (isApiUrl) {
|
||||
if (isLoading) {
|
||||
// Return empty div while loading custom icon so component size doesn't jump
|
||||
return <div className={classNames} />;
|
||||
return <div className={classNames.concat(" loading-placeholder")} />;
|
||||
}
|
||||
if (currentCustomIconBlob) {
|
||||
// Uses custom icon blob from API if fetch succeeded
|
||||
|
||||
@@ -37,4 +37,25 @@
|
||||
opacity: 1;
|
||||
transform: translateX(0);
|
||||
}
|
||||
}
|
||||
|
||||
.loading-placeholder {
|
||||
$from: #f5f5f5;
|
||||
$to: scale-color($from, $lightness: -10%);
|
||||
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
background: linear-gradient(-90deg, #efefef 0%, #fcfcfc 50%, #efefef 100%);
|
||||
background-size: 400% 400%;
|
||||
animation: pulse 1s ease-in-out infinite;
|
||||
|
||||
@keyframes pulse {
|
||||
0% {
|
||||
background-position: 0% 0%
|
||||
}
|
||||
|
||||
100% {
|
||||
background-position: -135% 0%
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user