diff --git a/src/shared/Components/Skeleton/SkeletonCard.module.scss b/src/shared/Components/Skeleton/SkeletonCard.module.scss new file mode 100644 index 0000000..e894101 --- /dev/null +++ b/src/shared/Components/Skeleton/SkeletonCard.module.scss @@ -0,0 +1,87 @@ +.card { + position: relative; + width: 100%; + height: 250px; + border-radius: 8px; + background-color: #e0e0e0; + overflow: hidden; + + @media (max-width: 768px) { + height: 215px !important; + } +} + +.pic { + width: 100%; + height: 100%; + border-radius: 8px; + background-color: #ddd; + position: relative; +} + +.shimmer { + position: absolute; + top: 0; + left: -150%; + width: 100%; + height: 100%; + background: linear-gradient(90deg, + rgba(255, 255, 255, 0) 0%, + rgba(255, 255, 255, 0.6) 50%, + rgba(255, 255, 255, 0) 100%); + animation: shimmer 1.5s infinite; +} + +@keyframes shimmer { + 0% { + left: -150%; + } + + 100% { + left: 150%; + } +} + +.labsCard { + height: 300px; + + @media (max-width: 768px) { + height: 215px !important; + } +} + +.titleSkeleton { + margin: 0 10%; + + @include mediaMax($mobile-xs-width) { + margin: 0 5%; + } + height: 40px; + width: 25.5%; + border-radius: 4px; + background-color: #e0e0e0; + position: relative; + overflow: hidden; + margin-bottom: 16px; + + @media (max-width: 768px) { + height: 32px; + width: 70%; + } +} + +.titleSkeleton::after { + content: ""; + position: absolute; + top: 0; + left: -150%; + width: 100%; + height: 100%; + background: linear-gradient( + 90deg, + rgba(255, 255, 255, 0) 0%, + rgba(255, 255, 255, 0.6) 50%, + rgba(255, 255, 255, 0) 100% + ); + animation: shimmer 1.5s infinite; +} \ No newline at end of file diff --git a/src/shared/Components/Skeleton/SkeletonCard.tsx b/src/shared/Components/Skeleton/SkeletonCard.tsx new file mode 100644 index 0000000..9336a68 --- /dev/null +++ b/src/shared/Components/Skeleton/SkeletonCard.tsx @@ -0,0 +1,23 @@ +// shared/Components/SkeletonCard/SkeletonCard.tsx +import styles from "./SkeletonCard.module.scss"; + +interface SkeletonCardProps { + variant?: "default" | "lab"; +} + +const SkeletonCard = ({ variant = "default" }: SkeletonCardProps) => { + const cardClass = + variant === "lab" + ? `${styles.card} ${styles.labsCard}` + : styles.card; + + return ( +