реализовала сшимер для новостей, проектов, лабораторий

This commit is contained in:
xomimishka authored and ifraimka1 committed 2025-04-23 13:43:39 +03:00
1 parent a1d09975b9
commit 28d09678aa
4 files changed
+220

No files matched your search

@@ -0,0 +1,51 @@
.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;
}
}
@@ -0,0 +1,24 @@
// shared/ui/CardSkeleton/CardSkeleton.tsx
import styles from "./CardSkeleton.module.scss";
interface CardSkeletonProps {
variant?: "default" | "lab";
}
const CardSkeleton = ({ variant = "default" }: CardSkeletonProps) => {
const cardClass =
variant === "lab"
? `${styles.card} ${styles.labsCard}`
: styles.card;
return (
<div className={cardClass}>
<div className={styles.pic}>
<div className={styles.shimmer}></div>
</div>
</div>
);
};
export default CardSkeleton;