diff --git a/src/widgets/CardList/CardList.module.scss b/src/widgets/CardList/CardList.module.scss
index 778cba5..110b88c 100644
--- a/src/widgets/CardList/CardList.module.scss
+++ b/src/widgets/CardList/CardList.module.scss
@@ -15,3 +15,19 @@
margin-top: 0;
}
}
+
+.skeletonGrid {
+ display: grid;
+ grid-template-columns: repeat(3, 1fr);
+ gap: 32px;
+ width: 100%;
+ margin: 0 auto;
+
+ @media (max-width: 768px) {
+ grid-template-columns: repeat(1, 1fr);
+ }
+
+ @media (min-width: 769px) and (max-width: 1024px) {
+ grid-template-columns: repeat(2, 1fr);
+ }
+}
\ No newline at end of file
diff --git a/src/widgets/CardList/CardList.tsx b/src/widgets/CardList/CardList.tsx
index 809ee2a..e372230 100644
--- a/src/widgets/CardList/CardList.tsx
+++ b/src/widgets/CardList/CardList.tsx
@@ -9,6 +9,7 @@ import {
transformPostsToCardData,
} from "@/widgets/CardList/CardListFunctions";
import { usePostProjects } from "@/modules/posts/hooks/usePostProjects";
+import CardSkeleton from "./ui/CardSkeleton";
interface ListProps {
gridConfig?: GridConfig;
@@ -24,11 +25,16 @@ const NewsList = ({
return (
Новости
-
+
+ {[...Array(3)].map((_, index) => (
+
+ ))}
+
+ {/*
анимация прогрузки */}
);
- if (isError) return Ошибка при загрузке данных
;
+ if (isError) return Ошибка при загрузке данных;
return (
@@ -43,7 +49,7 @@ const NewsList = ({
);
};
-
+// TODO: вынести array cardSkeleton Отдельно
const LabsList = ({
gridConfig = { desktop: 3, tablet: 2, mobile: 1 },
}: ListProps) => {
@@ -54,7 +60,11 @@ const LabsList = ({
return (
Лаборатории
-
+
+ {[...Array(3)].map((_, index) => (
+
+ ))}
+
);
@@ -83,7 +93,11 @@ const ProjectsList = ({
return (
Наши проекты
-
+
+ {[...Array(3)].map((_, index) => (
+
+ ))}
+
);
diff --git a/src/widgets/CardList/ui/CardSkeleton.module.scss b/src/widgets/CardList/ui/CardSkeleton.module.scss
new file mode 100644
index 0000000..afad60d
--- /dev/null
+++ b/src/widgets/CardList/ui/CardSkeleton.module.scss
@@ -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;
+ }
+}
\ No newline at end of file
diff --git a/src/widgets/CardList/ui/CardSkeleton.tsx b/src/widgets/CardList/ui/CardSkeleton.tsx
new file mode 100644
index 0000000..81ad754
--- /dev/null
+++ b/src/widgets/CardList/ui/CardSkeleton.tsx
@@ -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 (
+
+ );
+};
+
+export default CardSkeleton;
+