сделано наша команда и галерея на странице О нас

This commit is contained in:
xomimishka committed 2025-04-11 11:51:17 +03:00
1 parent 808d97eb4b
commit a86f51a8eb
16 files changed
+317 -8

No files matched your search

@@ -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;
}
}
}
+50
View File
@@ -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;
+1
View File
@@ -0,0 +1 @@
export { default } from './PhotoGallery';