diff --git a/package-lock.json b/package-lock.json index 15c4e38..409cc9e 100755 --- a/package-lock.json +++ b/package-lock.json @@ -68,7 +68,7 @@ "i": "^0.3.7", "npm": "^11.2.0", "typescript": "^5.5.3", - "vite": "^5.3.1" + "vite": "^5.4.16" } }, "node_modules/@ampproject/remapping": { @@ -8199,10 +8199,11 @@ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" }, "node_modules/vite": { - "version": "5.4.14", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.14.tgz", - "integrity": "sha512-EK5cY7Q1D8JNhSaPKVK4pwBFvaTmZxEnoKXLG/U9gmdDcihQGNzFlgIvaxezFR4glP1LsuiedwMBqCXH3wZccA==", + "version": "5.4.16", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.16.tgz", + "integrity": "sha512-Y5gnfp4NemVfgOTDQAunSD4346fal44L9mszGGY/e+qxsRT5y1sMlS/8tiQ8AFAp+MFgYNSINdfEchJiPm41vQ==", "dev": true, + "license": "MIT", "dependencies": { "esbuild": "^0.21.3", "postcss": "^8.4.43", diff --git a/package.json b/package.json index 7528721..0ce3910 100755 --- a/package.json +++ b/package.json @@ -70,6 +70,6 @@ "i": "^0.3.7", "npm": "^11.2.0", "typescript": "^5.5.3", - "vite": "^5.3.1" + "vite": "^5.4.16" } } diff --git a/src/app/styles/global.scss b/src/app/styles/global.scss index 31624c6..3ac2860 100644 --- a/src/app/styles/global.scss +++ b/src/app/styles/global.scss @@ -49,6 +49,7 @@ a { .btn:hover { background-position: 100%; + color: $btn-primary-text; } .btn[disabled] { diff --git a/src/pages/AboutUs/AboutUs.tsx b/src/pages/AboutUs/AboutUs.tsx index 75f2f4e..7095566 100644 --- a/src/pages/AboutUs/AboutUs.tsx +++ b/src/pages/AboutUs/AboutUs.tsx @@ -1,5 +1,6 @@ import { CategoryPage } from "@/widgets/CategoryPage/CategoryPage"; + export default function AboutUs() { return ; } diff --git a/src/pages/MainPage/ui/MainPage/MainPage.tsx b/src/pages/MainPage/ui/MainPage/MainPage.tsx index a95f634..2f937a5 100644 --- a/src/pages/MainPage/ui/MainPage/MainPage.tsx +++ b/src/pages/MainPage/ui/MainPage/MainPage.tsx @@ -5,6 +5,7 @@ import { RootContext } from "@/app/Layout/Root"; import Partners from "@/widgets/Partners"; import Gallery from "@/pages/MainPage/ui/components/Gallery"; import ContactUs from "@/widgets/ContactUs"; + import { LabsList, NewsList, diff --git a/src/shared/api/wp-client.ts b/src/shared/api/wp-client.ts index 674c0a7..b0c2562 100644 --- a/src/shared/api/wp-client.ts +++ b/src/shared/api/wp-client.ts @@ -1,7 +1,7 @@ import WPAPI from "wpapi"; export const wp = new WPAPI({ - endpoint: "https://test.skbkit.ru/wp-json/", + endpoint: "http://skb-site.local/wp-json/", username: "admin", password: "admin", }); diff --git a/src/shared/assets/images/I_want.svg b/src/shared/assets/images/I_want.svg new file mode 100644 index 0000000..3615b21 --- /dev/null +++ b/src/shared/assets/images/I_want.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/shared/assets/images/index.js b/src/shared/assets/images/index.js index 132ca0f..be0cc29 100644 --- a/src/shared/assets/images/index.js +++ b/src/shared/assets/images/index.js @@ -19,4 +19,6 @@ export { default as bg_news_block } from './backround/bg_news_block.svg'; export { default as bg_projects_block } from './backround/bg_projects_block.svg'; export { default as scb } from './scb.svg'; -export { default as scb_blue } from './sсb_blue.svg'; \ No newline at end of file +export { default as scb_blue } from './sсb_blue.svg'; + +export { default as photo} from './photo.jpg'; \ No newline at end of file diff --git a/src/shared/assets/images/photo.png b/src/shared/assets/images/photo.png new file mode 100644 index 0000000..753db18 Binary files /dev/null and b/src/shared/assets/images/photo.png differ diff --git a/src/widgets/CategoryPage/CategoryPage.tsx b/src/widgets/CategoryPage/CategoryPage.tsx index 5905ea8..ff027c7 100644 --- a/src/widgets/CategoryPage/CategoryPage.tsx +++ b/src/widgets/CategoryPage/CategoryPage.tsx @@ -1,5 +1,8 @@ import { usePosts } from "@/modules/posts/hooks/usePosts"; import { PagePost } from "@/widgets/PostPage"; +import Team from "../Team"; +import PhotoGallery from "../PhotoGallery"; + interface CategoryPageProps { category: string; @@ -23,9 +26,15 @@ export function CategoryPage({ category }: CategoryPageProps) { <> {categoryPosts.map((post) => ( -
Показать еще
+ {/*
Показать еще
*/}
))} + {category === "aboutus" && <> + + + + } + ); } diff --git a/src/widgets/PhotoGallery/PhotoGallery.style.scss b/src/widgets/PhotoGallery/PhotoGallery.style.scss new file mode 100644 index 0000000..215b772 --- /dev/null +++ b/src/widgets/PhotoGallery/PhotoGallery.style.scss @@ -0,0 +1,92 @@ +.mainContainer { + margin: 0 10%; + text-align: left; + display: block; + + @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; + } +} + +.btn { + margin: 32px auto 0; + display: block; + text-align: center; +} + +.images { + display: grid; + grid-template-columns: repeat(6, 1fr); + gap: 32px; + + @include mediaMax($tablet-max-width) { + grid-template-columns: repeat(2, 1fr); + } + + @include mediaMax($mobile-xs-width) { + grid-template-columns: 1fr; + } +} + +.image-container { + height: 352px; + overflow: hidden; + border-radius: 8px; + + img { + width: 100%; + height: 100%; + object-fit: cover; + pointer-events: none; + } +} + +$tablet-min-width: 768px; + +@for $i from 0 through 100 { + @include mediaMin($tablet-min-width) { + @if $i % 2==0 { + + // Первый случай: широкая слева + .image-container:nth-child(5n + #{1 + $i * 5}) { + grid-column: span 4; + } + + .image-container:nth-child(5n + #{2 + $i * 5}) { + grid-column: span 2; + } + } + + @else { + + // Второй случай: широкая справа + .image-container:nth-child(5n + #{2 + $i * 5}) { + grid-column: span 4; + } + + .image-container:nth-child(5n + #{1 + $i * 5}) { + grid-column: span 2; + } + } + + // чётная строка + .image-container:nth-child(5n + #{3 + $i * 5}), + .image-container:nth-child(5n + #{4 + $i * 5}), + .image-container:nth-child(5n + #{5 + $i * 5}) { + grid-column: span 2; + } + + } +} \ No newline at end of file diff --git a/src/widgets/PhotoGallery/PhotoGallery.tsx b/src/widgets/PhotoGallery/PhotoGallery.tsx new file mode 100644 index 0000000..bc235d1 --- /dev/null +++ b/src/widgets/PhotoGallery/PhotoGallery.tsx @@ -0,0 +1,50 @@ +import { useEffect, useState } from "react"; +import { useMedia } from "@/modules/media/hooks/useMedia"; + +import "./PhotoGallery.style.scss" + +interface PhotoGalleryProps { + images?: string[]; + category?: string; +} + +const PhotoGallery = ({ images, category = "галерея" }: PhotoGalleryProps) => { + const { data: mediaData, isLoading, isError } = useMedia(); + const [visibleCount, setVisibleCount] = useState(10); + + const filteredMedia = images + ? images.map((src, id) => ({ id, src })) + : mediaData || []; // без фильтра + + if (isLoading) + return ( +
+ +
+ ); + + if (isError) return
Ошибка при загрузке медиа
; + + return ( +
+

Фотогалерея

+
+ {filteredMedia.slice(0, visibleCount).map((media) => ( +
+ {`slide-${media.id}`} +
+ ))} +
+ +
+ Показать еще +
+
+ ); +}; + +export default PhotoGallery; diff --git a/src/widgets/PhotoGallery/index.ts b/src/widgets/PhotoGallery/index.ts new file mode 100644 index 0000000..577ed54 --- /dev/null +++ b/src/widgets/PhotoGallery/index.ts @@ -0,0 +1 @@ +export { default } from './PhotoGallery'; \ No newline at end of file diff --git a/src/widgets/Team/Team.style.scss b/src/widgets/Team/Team.style.scss new file mode 100644 index 0000000..2d88bd1 --- /dev/null +++ b/src/widgets/Team/Team.style.scss @@ -0,0 +1,104 @@ +$btn-primary-text: white; +$btn-primary-bg: linear-gradient( + 93.25deg, + #4942e4 0%, + #11009e 50%, + #4942e4 100% + ); + +.mainContainer { + margin: 0 10%; + text-align: left; + display: block; + + @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; + } +} + +.grid { + display: grid; + grid-template-columns: repeat(4, 1fr); + gap: 32px; + + @include mediaMax($tablet-max-width) { + grid-template-columns: repeat(2, 1fr); + } + + @include mediaMax($mobile-xs-width) { + grid-template-columns: 1fr; + } +} + +.card { + display: flex; + flex-direction: column; + justify-content: space-between; + align-items: flex-start; + text-align: left; + border: 0; + text-decoration: none; + + img { + width: 100%; + height: auto; + border-radius: 8px; + object-fit: cover; + pointer-events: none; + } + + .caption { + padding-top: 10px; + text-align: left; + font-size: 18px; + color: #000; + font-family: "Montserrat"; + font-style: normal; + font-display: swap; + src: url("../fonts/Montserrat/Montserrat-VariableFont_wght.ttf") format("truetype"); + } + + .bold { + font-size: 22px; + font-weight: 500; + } +} + +.joinContent { + width: 100%; + height: 100%; + display: flex; + align-items: center; + justify-content: center; + background: $btn-primary-bg; + border-radius: 8px; + transition: 0.5s;background: $btn-primary-bg; + background-size: 200% 100%; + background-position: 0% 0%; + cursor: pointer; + + &:hover { + background-size: 200%; + background-position: 100%; + } +} + +.joinText { + color: white; + font-size: 20px; + font-weight: 600; + text-align: center; + font-family: "Montserrat"; +} \ No newline at end of file diff --git a/src/widgets/Team/Team.tsx b/src/widgets/Team/Team.tsx new file mode 100644 index 0000000..e537e76 --- /dev/null +++ b/src/widgets/Team/Team.tsx @@ -0,0 +1,36 @@ +import "./Team.style.scss"; +import photo from "@/shared/assets/images/photo.png"; +import { HashLink } from "react-router-hash-link"; + +const Team = () => { + const mockTeam = Array.from({ length: 7 }); // 7 обычных участников + + return ( +
+

Наша команда

+
+ {mockTeam.map((_, index) => ( +
+ {`Член +

+ Владимир Кутковой +
+ руководитель СКБ «КИТ» +

+
+ ))} + +
+ Хочу в команду +
+

+ +

+

+
+
+
+ ); +}; + +export default Team; \ No newline at end of file diff --git a/src/widgets/Team/index.ts b/src/widgets/Team/index.ts new file mode 100644 index 0000000..8523158 --- /dev/null +++ b/src/widgets/Team/index.ts @@ -0,0 +1 @@ +export { default } from './Team'; \ No newline at end of file