This commit is contained in:
Batyr 2025-06-13 16:12:49 +05:00
parent ee03e03e52
commit 878fd860c2
7 changed files with 73 additions and 61 deletions

1
dist/assets/index-B4zWz087.css vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

4
dist/index.html vendored
View File

@ -66,10 +66,10 @@
})(window, document, "script", "dataLayer", "GTM-NK394LVK"); })(window, document, "script", "dataLayer", "GTM-NK394LVK");
</script> </script>
<title>Turkmen Textile</title> <title>Turkmen Textile</title>
<script type="module" crossorigin src="/assets/index-B96Mtra6.js"></script> <script type="module" crossorigin src="/assets/index-DneGHC-R.js"></script>
<link rel="modulepreload" crossorigin href="/assets/react-vendor-CE_Ks92h.js"> <link rel="modulepreload" crossorigin href="/assets/react-vendor-CE_Ks92h.js">
<link rel="modulepreload" crossorigin href="/assets/ui-library-_5RJ9fWZ.js"> <link rel="modulepreload" crossorigin href="/assets/ui-library-_5RJ9fWZ.js">
<link rel="stylesheet" crossorigin href="/assets/index-DszKizJh.css"> <link rel="stylesheet" crossorigin href="/assets/index-B4zWz087.css">
</head> </head>
<body> <body>
<div id="root"></div> <div id="root"></div>

View File

@ -1,10 +1,23 @@
import { Container } from "@/components/layout"; import { Container } from "@/components/layout";
import { useVideos } from "@/hooks/tanstack/use-videos";
import { useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { useLocation } from "react-router-dom"; import { useLocation } from "react-router-dom";
const Videos = () => { const Videos = () => {
const { t } = useTranslation("main"); const { t } = useTranslation("main");
const { pathname } = useLocation(); const { pathname } = useLocation();
const [activeVideo, setActiveVideo] = useState(1);
const { data } = useVideos(1);
const fashionData = data?.videos.filter(
(item) => item.sections[0] === "fashion_shows"
);
const filteredData = [...(fashionData ?? [])].sort(
(a, b) => a?.fashion_shows_order_id + b?.fashion_shows_order_id
);
const { videosTitle, videosTitle2 } = t("impressions", { const { videosTitle, videosTitle2 } = t("impressions", {
returnObjects: true, returnObjects: true,
@ -19,12 +32,12 @@ const Videos = () => {
{filter() ? videosTitle : videosTitle2} {filter() ? videosTitle : videosTitle2}
</h2> </h2>
<div className="grid grid-cols-1 md:grid-cols-1 mx-0 lg:mx-48 gap-4 text-white overflow-hidden h-auto md:h-[497px]"> <div className="flex flex-col lg:flex-row lg:mx-20 gap-4 text-white overflow-hidden h-fit lg:h-[490px]">
{/* FIRST BLOCK */} {/* FIRST BLOCK */}
<div className="bg-gray_10 p-2 rounded-[8px] border border-gray_09 flex flex-col h-full"> <div className="bg-gray_10 flex-auto p-2 rounded-[8px] border border-gray_09 flex flex-col justify-center h-full">
<div className="maxh-[453px]"> <div className="max-h-[450px]">
<video <video
src="https://turkmentextile.turkmenexpo.com/app/storage/app/media/video/Textile2025.mp4" src={data?.videos?.[activeVideo]?.video?.path}
muted muted
controls controls
autoPlay autoPlay
@ -32,42 +45,37 @@ const Videos = () => {
className="w-full size-full mb-2 rounded" className="w-full size-full mb-2 rounded"
/> />
</div> </div>
{/* <div className="flex items-center justify-between mt-auto"> <div className="flex items-center justify-between mt-auto">
<h3 className="text-sm"> {/* <h3 className="text-sm">
Алена Ахмадуллина | 'Царевна-Лебедь' (74 симв.) Алена Ахмадуллина | 'Царевна-Лебедь' (74 симв.)
</h3> </h3> */}
<span className="text-xs normal">1/10</span> {/* <span className="text-xs normal">1/10</span> */}
</div> */} </div>
</div> </div>
{/* SECOND BLOCK */} {/* SECOND BLOCK */}
{/* <div className="bg-gray_10 px-2 pt-2 rounded-[8px] border border-gray_09 flex flex-col h-full min-h-0"> <div className="bg-gray_10 flex-[0_0_20%] px-2 pt-2 rounded-[8px] border border-gray_09 flex flex-col h-full">
<div className="flex items-center justify-between mb-2"> {/* <div className="flex items-center justify-between mb-2">
<h3 className="text-sm">Смотрите также</h3> <h3 className="text-sm">Смотрите также</h3>
<span className="text-xs normal">1/10</span> <span className="text-xs normal">1/10</span>
</div> </div> */}
<div className="flex flex-col gap-2 overflow-y-auto flex-grow"> <div className="flex flex-col gap-2 w-full overflow-y-auto overflow-x-hidden h-full">
{[...Array(10)].map((_, i) => ( {filteredData?.map((item, i) => (
<div <div
key={i} key={i}
className="h-[59px] w-full flex items-center gap-2" onClick={() => setActiveVideo(i + 1)}
className="basis-[80px] cursor-pointer hover:scale-105 transition-transform overflow-hidden"
> >
<div className="flex-[0_0_27%]"> <img
<img src={item?.video_photo?.path}
src="/impressions/test.png" alt=""
alt="" className="object-contain size-full rounded-tl rounded-bl"
className="object-contain rounded-tl rounded-bl" />
/>
</div>
<h3 className="text-sm">
Алена Ахмадуллина | 'Царевна-Лебедь' 'Царевна-Лебедь' |
Алена Ахмадуллина
</h3>
</div> </div>
))} ))}
</div> </div>
</div> */} </div>
{/* SECOND BLOCK */} {/* SECOND BLOCK */}
</div> </div>
</Container> </Container>

View File

@ -13,8 +13,8 @@ import { PartnersType } from "@/hooks/tanstack/use-partners";
import { NewsInnerType, NewsType } from "./types/news.type"; import { NewsInnerType, NewsType } from "./types/news.type";
import { ParticipantsType } from "./types/participants.type"; import { ParticipantsType } from "./types/participants.type";
import { PhotoTypes } from "./types/photo.type"; import { PhotoTypes } from "./types/photo.type";
import { VideoTypes } from "./types/videos.type";
import { DesignersType } from "./types/designers.type"; import { DesignersType } from "./types/designers.type";
import { VideoTypes } from "./types/videos.type";
const axios_url = axios.create({ const axios_url = axios.create({
baseURL: "https://turkmentextile.turkmenexpo.com/app/api/v1/", baseURL: "https://turkmentextile.turkmenexpo.com/app/api/v1/",

View File

@ -1,38 +1,42 @@
export interface VideoTypes { type VideoFile = {
status: string;
data: Data;
}
export interface Data {
id: number;
name: string;
created_at: Date;
updated_at: Date;
videos: VideoElement[];
}
export interface VideoElement {
id: number;
name: string;
category_video_media_id: number;
created_at: Date;
updated_at: Date;
video: VideoPhotoClass;
video_photo: VideoPhotoClass;
}
export interface VideoPhotoClass {
id: number; id: number;
disk_name: string; disk_name: string;
file_name: string; file_name: string;
file_size: number; file_size: number;
content_type: string; content_type: string;
title: null; title: string | null;
description: null; description: string | null;
field: string; field: string;
sort_order: number; sort_order: number;
created_at: Date; created_at: string;
updated_at: Date; updated_at: string;
path: string; path: string;
extension: string; extension: string;
} };
type VideoItem = {
id: number;
category_video_media_id: number;
name: string;
created_at: string;
updated_at: string;
sections: string[] | string; // может быть строкой или массивом строк
fashion_shows_order_id: number;
title: string;
text: string;
video: VideoFile;
video_photo: VideoFile;
};
type TurkmentextileData = {
id: number;
name: string;
created_at: string;
updated_at: string;
videos: VideoItem[];
};
export type VideoTypes = {
status: "success" | "error";
data: TurkmentextileData;
};