OperationCode/front-end

View on GitHub
components/Cards/ResourceCard/ResourceSkeletonCard.module.css

Summary

Maintainability
Test Coverage
@keyframes loadingAnimation {
  100% {
    transform: translateX(100%);
  }
}

.Skeleton {
  background: white;
  border-radius: 0.25rem;
  width: 100%;
  height: 5rem;
  box-shadow: 0 3px 6px 2px rgba(0, 0, 0, 0.12);
  margin: 1rem 0;
}

.loading {
  position: relative;
  background-color: var(--gray);
}

.loading::after {
  display: block;
  content: "";
  top: 0;
  position: absolute;
  overflow: overlay;
  width: 50%;
  height: 100%;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  animation: loadingAnimation 0.5s infinite;
}

.skeletonInner {
  height: 5rem;
}