diff --git a/src/shared/Components/Card/Card.module.scss b/src/shared/Components/Card/Card.module.scss index 4ca4b33..9a6bd99 100644 --- a/src/shared/Components/Card/Card.module.scss +++ b/src/shared/Components/Card/Card.module.scss @@ -48,27 +48,29 @@ overflow: hidden; transition: max-height 0.3s ease, opacity 0.3s ease; } - + .link { opacity: 0; transform: translateY(10px); transition: opacity 0.3s ease, transform 0.3s ease; } - + &:hover { .description { max-height: 200px; opacity: 1; margin-top: 10px; } - + .link { opacity: 1; transform: translateY(0); } + .image { filter: brightness(0.7); } + .content { bottom: 20px; } @@ -218,3 +220,15 @@ font-size: 18px; } } + +.placeholder { + position: absolute; + width: 100%; + height: 100%; + background-color: #2A3451; + background-image: url("/src/shared/assets/images/kit.svg"); + background-repeat: no-repeat; + background-position: center center; + background-size: 70%; + z-index: 0; +} \ No newline at end of file diff --git a/src/shared/Components/Card/Card.tsx b/src/shared/Components/Card/Card.tsx index 1b74db8..9d10af8 100644 --- a/src/shared/Components/Card/Card.tsx +++ b/src/shared/Components/Card/Card.tsx @@ -16,7 +16,11 @@ export const Card = ({ data }: CardProps) => { className={classNames(styles.card, {}, [styles[`card__${variant}`]])} to={link || `/${id || name}`} > - {name} + {preview ? ( + {name} + ) : ( +
+ )}

{name}

@@ -35,4 +39,4 @@ export const Card = ({ data }: CardProps) => {
); -}; +}; \ No newline at end of file diff --git a/src/widgets/CardList/CardList.tsx b/src/widgets/CardList/CardList.tsx index 20e0726..199556c 100644 --- a/src/widgets/CardList/CardList.tsx +++ b/src/widgets/CardList/CardList.tsx @@ -11,16 +11,6 @@ import { } from "@/widgets/CardList/CardListFunctions"; import { usePostProjects } from "@/modules/posts/hooks/usePostProjects"; import { Link } from "react-router-dom"; -import { useEffect } from "react"; - -// Компонент для прокрутки вверх при переходе -const ScrollToTopOnMount = () => { - useEffect(() => { - window.scrollTo(0, 0); - }, []); - - return null; -}; interface ListProps { gridConfig?: GridConfig; @@ -34,7 +24,6 @@ const NewsList = ({ return ( <> - window.scrollTo(0, 0)}> + Новости } @@ -68,7 +57,6 @@ const LabsList = ({ return ( <> - window.scrollTo(0, 0)}> + Наши лаборатории } @@ -100,7 +88,6 @@ const ProjectsList = ({ return ( <> - window.scrollTo(0, 0)}> + Наши проекты }