From 1d69e3f017ec15814e2c77fe85e9c75257f109d6 Mon Sep 17 00:00:00 2001 From: xomimishka Date: Sat, 5 Jul 2025 00:41:37 +0300 Subject: [PATCH 1/6] =?UTF-8?q?=D0=97=D0=B0=D0=BC=D0=B5=D0=BD=D0=B8=D0=BB?= =?UTF-8?q?=D0=B0=202=20=D1=80=D1=8F=D0=B4=20=D0=B4=D1=80=20=D0=B4=D0=B0?= =?UTF-8?q?=D0=BD=D0=BD=D1=8B=D0=BC=D0=B8=20=D0=B2=20=D1=86=D0=B8=D1=84?= =?UTF-8?q?=D1=80=D0=B0=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widgets/Numbers/Numbers.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/widgets/Numbers/Numbers.tsx b/src/widgets/Numbers/Numbers.tsx index 7ffebd4..03da71d 100644 --- a/src/widgets/Numbers/Numbers.tsx +++ b/src/widgets/Numbers/Numbers.tsx @@ -23,16 +23,16 @@ const Numbers = () => {
-

{yearsSince2015}

- +

50+

+
-

20+

- +

100+

+
-

30+

- +

500+

+
Illustration From bd3cf94ade92b58ce009cec2ef897fa70be85f4d Mon Sep 17 00:00:00 2001 From: xomimishka Date: Sat, 5 Jul 2025 00:43:15 +0300 Subject: [PATCH 2/6] =?UTF-8?q?=D0=97=D0=B0=D1=82=D0=B5=D0=BC=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D1=84=D0=BE=D0=BD=D0=B0=20=D0=BD=D0=B0=20?= =?UTF-8?q?50%=20=D0=B8=20=D0=B7=D0=B0=D0=BC=D0=B5=D0=BD=D0=B8=D0=BB=D0=B0?= =?UTF-8?q?=20=D0=B7=D0=B0=D0=B3=D0=BE=D0=BB=D0=BE=D0=B2=D0=BE=D0=BA=20?= =?UTF-8?q?=D1=81=D0=B0=D0=B9=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 2 +- src/app/styles/variables/_variables.scss | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index bf9ef1c..4885490 100644 --- a/index.html +++ b/index.html @@ -11,7 +11,7 @@ - Завод + СКБ "Компьютерное инновационное творчество" diff --git a/src/app/styles/variables/_variables.scss b/src/app/styles/variables/_variables.scss index 533a70f..50b34c2 100644 --- a/src/app/styles/variables/_variables.scss +++ b/src/app/styles/variables/_variables.scss @@ -4,7 +4,7 @@ $bg-secondary: #343434; $bg-footer: #222222; $bg-form: #f5f5f7; $bg-card-lab: black; -$bg-image: rgba(0, 0, 0, 0.75); +$bg-image: rgba(0, 0, 0, 0.50); $text-primary: black; $text-secondary: white; From 1a0d4072eaed5630bde38b32e128f89624672cf8 Mon Sep 17 00:00:00 2001 From: xomimishka Date: Sat, 5 Jul 2025 00:44:51 +0300 Subject: [PATCH 3/6] =?UTF-8?q?=D0=97=D0=B0=D0=B3=D0=BE=D0=BB=D0=BE=D0=B2?= =?UTF-8?q?=D0=BE=D0=BA=20=D0=B2=20=D0=BF=D1=80=D0=BE=D0=B5=D0=BA=D1=82?= =?UTF-8?q?=D0=B5=20=D0=BF=D1=80=D0=BE=D0=B3=D1=80=D0=B0=D0=BC=D0=BC=D0=BD?= =?UTF-8?q?=D0=BE-=D0=B0=D0=BF=D0=BF=D0=B0=D1=80=D0=B0=D1=82..=20=D0=BF?= =?UTF-8?q?=D0=BE=20=D1=86=D0=B5=D0=BD=D1=82=D1=80=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widgets/WpPost/Projects.scss | 3 +++ src/widgets/WpPost/WpPost.tsx | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/widgets/WpPost/Projects.scss b/src/widgets/WpPost/Projects.scss index aabbd83..260e184 100644 --- a/src/widgets/WpPost/Projects.scss +++ b/src/widgets/WpPost/Projects.scss @@ -22,6 +22,9 @@ $swiper-button-arrow-size: 20px; .header { //text-align: center; margin-bottom: 2em; + &.header--center { + text-align: center; + } } .wp-block-columns { diff --git a/src/widgets/WpPost/WpPost.tsx b/src/widgets/WpPost/WpPost.tsx index ee0d0bd..35ec0ee 100644 --- a/src/widgets/WpPost/WpPost.tsx +++ b/src/widgets/WpPost/WpPost.tsx @@ -32,7 +32,7 @@ export default function WpPost({ customComponent ) : ( <> - +

{title}

{Array.isArray(post.content) && From aaec846fc8933d42f8daf1edca20f807a9fe7704 Mon Sep 17 00:00:00 2001 From: xomimishka Date: Sat, 5 Jul 2025 00:46:00 +0300 Subject: [PATCH 4/6] =?UTF-8?q?=D0=9F=D1=80=D0=B8=20=D0=BF=D0=B5=D1=80?= =?UTF-8?q?=D0=B5=D1=85=D0=BE=D0=B4=D0=B5=20=D0=BD=D0=B0=20=D0=BF=D1=80?= =?UTF-8?q?=D0=BE=D0=B5=D0=BA=D1=82=20=D0=BE=D0=BA=D0=B0=D0=B7=D1=8B=D0=B2?= =?UTF-8?q?=D0=B0=D0=B5=D0=BC=D1=81=D1=8F=20=D1=81=D0=B2=D0=B5=D1=80=D1=85?= =?UTF-8?q?=D1=83=20=D1=81=D1=82=D1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/WpPostPage/WpPostPage.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/pages/WpPostPage/WpPostPage.tsx b/src/pages/WpPostPage/WpPostPage.tsx index 219aca4..858dab3 100644 --- a/src/pages/WpPostPage/WpPostPage.tsx +++ b/src/pages/WpPostPage/WpPostPage.tsx @@ -4,6 +4,7 @@ import { useParams } from "react-router-dom"; import { ProjectsList } from "@/widgets/CardList/CardList"; import { SkeletonPost } from "@/shared/Components/SkeletonPost/SkeletonPost"; import { Helmet } from "react-helmet"; +import { useEffect } from "react"; function WpPostPage() { const params = useParams(); @@ -11,6 +12,12 @@ function WpPostPage() { const { data: post, isLoading, isError } = usePostById(postId || -1); + useEffect(() => { + if (post) { + window.scrollTo({ top: 0, behavior: "auto" }); + } + }, [post]); + if (!postId) { return ( <> @@ -66,9 +73,8 @@ function WpPostPage() { /> From 644a96101ee2c7ea9ec3ed8598f4e37b545e4539 Mon Sep 17 00:00:00 2001 From: xomimishka Date: Mon, 7 Jul 2025 22:53:03 +0300 Subject: [PATCH 5/6] =?UTF-8?q?=D0=9F=D1=80=D0=B8=20=D0=BC=D0=B0=D0=BB?= =?UTF-8?q?=D0=BE=D0=BC=20=D0=BA=D0=BE=D0=BB.=20=D1=84=D0=BE=D1=82=D0=BE?= =?UTF-8?q?=20=D0=B1=D0=B5=D0=B7=20=D0=BF=D1=80=D0=BE=D0=BA=D1=80=D1=83?= =?UTF-8?q?=D1=82=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widgets/NewSlider/NewSlider.scss | 15 +++++- src/widgets/NewSlider/NewSlider.tsx | 73 ++++++++++++++++------------ 2 files changed, 55 insertions(+), 33 deletions(-) diff --git a/src/widgets/NewSlider/NewSlider.scss b/src/widgets/NewSlider/NewSlider.scss index 835a078..38e1577 100644 --- a/src/widgets/NewSlider/NewSlider.scss +++ b/src/widgets/NewSlider/NewSlider.scss @@ -17,7 +17,8 @@ } &__stage { - display: flex; + display: flex !important; + flex-wrap: nowrap; gap: 32px; padding: 0; margin: 0; @@ -25,7 +26,7 @@ &__stage-item { flex: 0 0 auto; - box-sizing: border-box; + width: auto !important; } } @@ -55,6 +56,8 @@ &__stage-item { padding: 0 5%; + box-sizing: border-box; + width: 100% !important; } } @@ -103,3 +106,11 @@ } } } +.sliderButton.disabled { + display: none; +} + +.slider.centered .alice-carousel__stage { + justify-content: center; + display: flex; +} diff --git a/src/widgets/NewSlider/NewSlider.tsx b/src/widgets/NewSlider/NewSlider.tsx index b780fb3..b8b2bed 100644 --- a/src/widgets/NewSlider/NewSlider.tsx +++ b/src/widgets/NewSlider/NewSlider.tsx @@ -1,4 +1,4 @@ -import { useRef, useState } from "react"; +import { useEffect, useRef, useState } from "react"; import AliceCarousel from "react-alice-carousel"; import "react-alice-carousel/lib/alice-carousel.css"; @@ -17,6 +17,7 @@ function NewSlider({ }: SliderProps) { const { data: mediaData, isLoading, isError } = useMedia(); const [slideNumber, setSlideNumber] = useState(0); + const [windowWidth, setWindowWidth] = useState(typeof window !== 'undefined' ? window.innerWidth : 1024); const carouselRef = useRef(null); @@ -24,16 +25,31 @@ function NewSlider({ ? images.map((src, id) => ({ id, src, category: "", name: "" })) : mediaData?.filter((m) => m.category === category) || []; + useEffect(() => { + const handleResize = () => setWindowWidth(window.innerWidth); + window.addEventListener("resize", handleResize); + return () => window.removeEventListener("resize", handleResize); + }, []); + + const shouldShowControls = windowWidth < 768 + ? filteredMedia.length >= 2 + : filteredMedia.length > 4; + const responsive = { 0: { items: 1 }, - 768: { items: 1 }, - 1024: { items: 5 }, + 768: { items: 2 }, + 1024: { items: shouldShowControls ? 5 : filteredMedia.length }, }; const items = filteredMedia.map((media, index) => (
; if (isError) return
Ошибка при загрузке медиа
; - if (filteredMedia.length === 0) return
Нет изображений для отображения
; + if (filteredMedia.length === 0) return
Нет изображений
; return ( - +
-
- - -
-
+ {shouldShowControls && ( +
+ + +
+ )} + +
From 122b63d53377ac7cac21d982f7c6c32bf69330d6 Mon Sep 17 00:00:00 2001 From: xomimishka Date: Tue, 8 Jul 2025 01:21:54 +0300 Subject: [PATCH 6/6] =?UTF-8?q?=D0=B0=D0=BD=D0=B8=D0=BC=D0=B0=D1=86=D0=B8?= =?UTF-8?q?=D1=8F=20=D1=81=D0=BA=D1=80=D0=BE=D0=BB=D0=BB=D0=B0=20=D0=B2?= =?UTF-8?q?=D0=B2=D0=B5=D1=80=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/Layout/Root.tsx | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/src/app/Layout/Root.tsx b/src/app/Layout/Root.tsx index 42ce703..87ad5f3 100644 --- a/src/app/Layout/Root.tsx +++ b/src/app/Layout/Root.tsx @@ -60,14 +60,28 @@ function Root() { }; }, [hasScrolled]); - // Ускоренный плавный скролл вверх + // скролл вверх const scrollToTop = () => { - window.scrollTo({ - top: 0, - behavior: "smooth", - }); + const duration = 900; + const start = window.scrollY; + const startTime = performance.now(); + + const animateScroll = (currentTime: number) => { + const timeElapsed = currentTime - startTime; + const progress = Math.min(timeElapsed / duration, 1); + const ease = 1 - Math.pow(1 - progress, 3); + + window.scrollTo(0, start * (1 - ease)); + + if (timeElapsed < duration) { + requestAnimationFrame(animateScroll); + } }; + requestAnimationFrame(animateScroll); +}; + + // Определяем, находимся ли мы на главной странице const isHomePage = location.pathname === "/";