mirror of
https://git.rdcenter.ru/RDCenter/skb-kit.git
synced 2026-12-05 03:29:45 +00:00
сделано наша команда и галерея на странице О нас
This commit is contained in:
1 parent
808d97eb4b
commit
a86f51a8eb
16 files changed
+317
-8
No files matched your search
@@ -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) => (
|
||||
<PagePost key={post.id} post={post}>
|
||||
<div className="btn">Показать еще</div>
|
||||
{/* <div className="btn">Показать еще</div> */}
|
||||
</PagePost>
|
||||
))}
|
||||
{category === "aboutus" && <>
|
||||
<Team />
|
||||
<PhotoGallery />
|
||||
</>
|
||||
}
|
||||
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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 (
|
||||
<div className="mainContainer">
|
||||
<span className="loader"></span>
|
||||
</div>
|
||||
);
|
||||
|
||||
if (isError) return <div>Ошибка при загрузке медиа</div>;
|
||||
|
||||
return (
|
||||
<div className="mainContainer">
|
||||
<h1 className="title">Фотогалерея</h1>
|
||||
<div className="images">
|
||||
{filteredMedia.slice(0, visibleCount).map((media) => (
|
||||
<div key={media.id} className="image-container">
|
||||
<img
|
||||
src={media.src}
|
||||
alt={`slide-${media.id}`}
|
||||
className="slide-image"
|
||||
/>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div className="btn">
|
||||
Показать еще
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default PhotoGallery;
|
||||
@@ -0,0 +1 @@
|
||||
export { default } from './PhotoGallery';
|
||||
@@ -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";
|
||||
}
|
||||
@@ -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 (
|
||||
<div className="mainContainer">
|
||||
<h2 className="title">Наша команда</h2>
|
||||
<div className="grid">
|
||||
{mockTeam.map((_, index) => (
|
||||
<div key={index} className="card">
|
||||
<img src={photo} alt={`Член команды ${index + 1}`} />
|
||||
<p className="caption">
|
||||
<span className="bold">Владимир Кутковой</span>
|
||||
<br />
|
||||
руководитель СКБ «КИТ»
|
||||
</p>
|
||||
</div>
|
||||
))}
|
||||
<HashLink smooth to="/contact" className="card">
|
||||
<div className="joinContent">
|
||||
<span className="joinText">Хочу в команду</span>
|
||||
</div>
|
||||
<p className="caption">
|
||||
<span className="bold"></span>
|
||||
<br /><br />
|
||||
</p>
|
||||
</HashLink>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default Team;
|
||||
@@ -0,0 +1 @@
|
||||
export { default } from './Team';
|
||||
Reference in new issue
Block a user