diff --git a/src/assets/images/numbers/Illustration.png b/src/assets/images/numbers/Illustration.png new file mode 100644 index 0000000..50e17aa Binary files /dev/null and b/src/assets/images/numbers/Illustration.png differ diff --git a/src/assets/images/numbers/index.js b/src/assets/images/numbers/index.js new file mode 100644 index 0000000..985ed98 --- /dev/null +++ b/src/assets/images/numbers/index.js @@ -0,0 +1,4 @@ +export { default as ten } from './ten.svg'; +export { default as twenty } from './twenty.svg'; +export { default as thirty } from './thirty.svg'; +export { default as Illustration } from './Illustration.png'; \ No newline at end of file diff --git a/src/assets/images/numbers/ten.svg b/src/assets/images/numbers/ten.svg new file mode 100644 index 0000000..c82c113 --- /dev/null +++ b/src/assets/images/numbers/ten.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/assets/images/numbers/thirty.svg b/src/assets/images/numbers/thirty.svg new file mode 100644 index 0000000..54ac54f --- /dev/null +++ b/src/assets/images/numbers/thirty.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/assets/images/numbers/twenty.svg b/src/assets/images/numbers/twenty.svg new file mode 100644 index 0000000..569dd8b --- /dev/null +++ b/src/assets/images/numbers/twenty.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/components/Footer/Footer.jsx b/src/components/Footer/Footer.jsx new file mode 100755 index 0000000..e69de29 diff --git a/src/components/Footer/Footer.styles.scss b/src/components/Footer/Footer.styles.scss new file mode 100755 index 0000000..e69de29 diff --git a/src/components/Footer/FooterContacts.jsx b/src/components/Footer/FooterContacts.jsx new file mode 100755 index 0000000..e69de29 diff --git a/src/components/Labs/LabList.jsx b/src/components/Labs/LabList.jsx new file mode 100644 index 0000000..e69de29 diff --git a/src/components/Labs/LabList.styles.scss b/src/components/Labs/LabList.styles.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/components/News/News.styles.scss b/src/components/News/News.styles.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/components/News/NewsList.jsx b/src/components/News/NewsList.jsx new file mode 100644 index 0000000..e69de29 diff --git a/src/components/Projects/ProjectCard.styles.scss b/src/components/Projects/ProjectCard.styles.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/pages/CardListPages/CardList.module.scss b/src/pages/CardListPages/CardList.module.scss new file mode 100644 index 0000000..ffeb29c --- /dev/null +++ b/src/pages/CardListPages/CardList.module.scss @@ -0,0 +1,36 @@ +.mainContainer { + margin: 0 10%; + + @include mediaMax($mobile-xs-width) { + margin: 0 5%; + } +} + +.title { + font-size: 36px; + font-weight: 600; + line-height: 44px; + margin-top: 0; + margin-bottom: 8px; + + @include mediaMax($tablet-max-width) { + font-size: 24px; + 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/pages/CardListPages/CardListPages.tsx b/src/pages/CardListPages/CardListPages.tsx new file mode 100644 index 0000000..15f920c --- /dev/null +++ b/src/pages/CardListPages/CardListPages.tsx @@ -0,0 +1,109 @@ +// pages/MainPage/ui/MainPage/Lists.tsx +import { CardList } from "@/widgets/CardList/CardList"; +import { GridConfig } from "@/widgets/CardList/types"; +import { usePosts } from "@/modules/posts/hooks/usePosts"; +import styles from "./CardList.module.scss"; +import { useNews } from "@/modules"; +import { + transformNewsToCardData, + transformPostsToCardData, +} from "@/pages/CardListPages/CardListFunctions"; +import CardSkeleton from "./ui/CardSkeleton"; + +interface ListProps { + gridConfig?: GridConfig; +} + +const NewsList = ({ + gridConfig = { desktop: 3, tablet: 2, mobile: 1 }, +}: ListProps) => { + const { data: newsData, isLoading, isError } = useNews(); + console.log(newsData); + if (isLoading) + return ( +
+

Новости

+
+ {[...Array(3)].map((_, index) => ( + + ))} +
+ {/* анимация прогрузки */} +
+ ); + if (isError) return
Ошибка при загрузке данных
; + return ( +
+ {newsData && ( + + )} +
+ ); +}; + +const LabsList = ({ + gridConfig = { desktop: 3, tablet: 2, mobile: 1 }, +}: ListProps) => { + const { data: postsData, isLoading, isError } = usePosts(); + const labs = postsData?.labs ? Object.values(postsData.labs) : []; + if (isLoading) + return ( +
+

Лаборатории

+ {/* */} +
+ {[...Array(3)].map((_, index) => ( + + ))} +
+
+ ); + if (isError) return
Ошибка при загрузке данных
; + return ( +
+ +
+ ); +}; + +const ProjectsList = ({ + gridConfig = { desktop: 3, tablet: 2, mobile: 1 }, +}: ListProps) => { + const { data: postsData, isError, isLoading } = usePosts(); + const projects = postsData?.projects ? Object.values(postsData.projects) : []; + if (isLoading) + return ( +
+

Проекты

+ {/* */} +
+ {[...Array(3)].map((_, index) => ( + + ))} +
+
+ ); + if (isError) return
Ошибка при загрузке данных
; + return ( +
+ +
+ ); +}; + +export { NewsList, LabsList, ProjectsList }; diff --git a/src/pages/CardListPages/ui/CardSkeleton.module.scss b/src/pages/CardListPages/ui/CardSkeleton.module.scss new file mode 100644 index 0000000..afad60d --- /dev/null +++ b/src/pages/CardListPages/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/pages/CardListPages/ui/CardSkeleton.tsx b/src/pages/CardListPages/ui/CardSkeleton.tsx new file mode 100644 index 0000000..81ad754 --- /dev/null +++ b/src/pages/CardListPages/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; + diff --git a/src/pages/Main/Main.jsx b/src/pages/Main/Main.jsx new file mode 100755 index 0000000..e69de29 diff --git a/src/pages/Main/components/Numbers/Numbers.jsx b/src/pages/Main/components/Numbers/Numbers.jsx new file mode 100644 index 0000000..98500fa --- /dev/null +++ b/src/pages/Main/components/Numbers/Numbers.jsx @@ -0,0 +1,45 @@ +import BlockHeading from '../BlockHeading'; + +import './Numbers.styles.scss'; +import { ten, twenty, thirty, Illustration } from '../../../../assets/images/numbers'; + +function Numbers() { + return ( +
+ +
+
+
+ 10 + +
+
+ 20+ + +
+
+ 30+ + +
+
+
+
+ 10 + +
+
+ 20+ + +
+
+ 30+ + +
+
+ Illustration +
+
+ ); +} + +export default Numbers; \ No newline at end of file diff --git a/src/pages/Main/components/Numbers/Numbers.styles.scss b/src/pages/Main/components/Numbers/Numbers.styles.scss new file mode 100644 index 0000000..9c0afb4 --- /dev/null +++ b/src/pages/Main/components/Numbers/Numbers.styles.scss @@ -0,0 +1,49 @@ +@import "../../../../assets/styles/theme.scss"; + +#numbers { + + label { + font-size: 20px; + margin-top: 10px; + } + + .blocks { + padding: 24px; + background-color: #f7f5f5; + border-radius: 8px; + display: flex; + flex-direction: column; + align-items: center; + } + + .gap01 { + gap: 32px; + } + + .visible { + display: block !important; + } + + @media (max-width: 1200px) { + .visible { + display: none !important; + } + } + + @media (max-width: 500px) { + label { + font-size: 14px; + margin-top: 5px; + } + + .blocks { + padding: 10px; + background-color: transparent; + width: 100%; + } + + .gap01 { + gap: 10px; + } + } +} \ No newline at end of file