From f400c1a4dd398f3552c112761bf7d0f3896bb033 Mon Sep 17 00:00:00 2001 From: xomimishka Date: Fri, 11 Jul 2025 11:32:07 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B7=D0=B0=D0=B3=D0=BB=D1=83=D1=88=D0=BA?= =?UTF-8?q?=D0=B0=20=D0=B4=D0=BB=D1=8F=20=D0=BA=D0=B0=D1=80=D1=82=D0=BE?= =?UTF-8?q?=D1=87=D0=BA=D0=B8=20=D0=B8=20=D1=83=D0=B1=D1=80=D0=B0=D0=BB?= =?UTF-8?q?=D0=B0=20=D0=BB=D0=B8=D1=88=D0=B5=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/shared/Components/Card/Card.module.scss | 20 +++++++++++++++++--- src/shared/Components/Card/Card.tsx | 8 ++++++-- src/widgets/CardList/CardList.tsx | 19 +++---------------- 3 files changed, 26 insertions(+), 21 deletions(-) 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)}> + Наши проекты }