upd presentation videos

This commit is contained in:
2025-07-14 17:29:49 +05:00
parent c54272780f
commit ade6679ecd
14 changed files with 59 additions and 59 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
+20 -20
View File
@@ -1,13 +1,13 @@
import LoaderIcon from '../../../public/icons/loader.svg'; import LoaderIcon from "../../../public/icons/loader.svg";
import { videos } from '@/consts/presentation/videos'; import { videos } from "@/consts/presentation/videos";
import { import {
motion, motion,
MotionValue, MotionValue,
useMotionValueEvent, useMotionValueEvent,
useTransform, useTransform,
} from 'framer-motion'; } from "framer-motion";
import { useTranslations } from 'next-intl'; import { useTranslations } from "next-intl";
import { createRef, Fragment, RefObject, useEffect, useState } from 'react'; import { createRef, Fragment, RefObject, useEffect, useState } from "react";
export function VideoLayerMain({ scroll }: { scroll: MotionValue<number> }) { export function VideoLayerMain({ scroll }: { scroll: MotionValue<number> }) {
const [slide, setSlide] = useState(0); const [slide, setSlide] = useState(0);
@@ -31,31 +31,31 @@ export function VideoLayerMain({ scroll }: { scroll: MotionValue<number> }) {
const x = useTransform( const x = useTransform(
scroll, scroll,
[0, 1 / 5, 2 / 5, 3 / 5, 4 / 5, 1], [0, 1 / 5, 2 / 5, 3 / 5, 4 / 5, 1],
['32.708vw', '32.708vw', '0vw', '0vw', '30vw', '30vw'] ["32.708vw", "32.708vw", "0vw", "0vw", "30vw", "30vw"]
); );
const width = useTransform( const width = useTransform(
scroll, scroll,
[0, 1 / 5, 2 / 5, 3 / 5, 4 / 5, 1], [0, 1 / 5, 2 / 5, 3 / 5, 4 / 5, 1],
['64.444vw', '61.667vw', '64.444vw', '64.444vw', '61.667vw', '65vw'] ["64.444vw", "61.667vw", "64.444vw", "64.444vw", "61.667vw", "65vw"]
); );
const backgroundSize = useTransform( const backgroundSize = useTransform(
scroll, scroll,
[0, 1 / 5, 2 / 5, 3 / 5, 4 / 5, 1], [0, 1 / 5, 2 / 5, 3 / 5, 4 / 5, 1],
['48.333vw', '53.962vw', '53.962vw', '62.946vw', '53.962vw', '47.813vw'] ["48.333vw", "53.962vw", "53.962vw", "62.946vw", "53.962vw", "47.813vw"]
); );
const videoWidth = useTransform( const videoWidth = useTransform(
scroll, scroll,
[0, 1 / 5, 2 / 5, 3 / 5, 4 / 5, 1], [0, 1 / 5, 2 / 5, 3 / 5, 4 / 5, 1],
['39.822vw', '44.46vw', '44.46vw', '51.861vw', '44.46vw', '39.392vw'] ["39.822vw", "44.46vw", "44.46vw", "51.861vw", "44.46vw", "39.392vw"]
); );
const videoHeight = useTransform( const videoHeight = useTransform(
scroll, scroll,
[0, 1 / 5, 2 / 5, 3 / 5, 4 / 5, 1], [0, 1 / 5, 2 / 5, 3 / 5, 4 / 5, 1],
['19vw', '21vw', '21vw', '24.5vw', '21vw', '18.5vw'] ["19vw", "21vw", "21vw", "24.5vw", "21vw", "18.5vw"]
); );
const opacity = useTransform(scroll, [4.5 / 5, 1], [0, 1]); const opacity = useTransform(scroll, [4.5 / 5, 1], [0, 1]);
@@ -63,16 +63,16 @@ export function VideoLayerMain({ scroll }: { scroll: MotionValue<number> }) {
const backgroundPositionY = useTransform( const backgroundPositionY = useTransform(
scroll, scroll,
[0, 1 / 5, 2 / 5, 3 / 5, 4 / 5, 1], [0, 1 / 5, 2 / 5, 3 / 5, 4 / 5, 1],
['0vw', '0vw', '0vw', '-2.569vw', '0vw', '7.292vw'] ["0vw", "0vw", "0vw", "-2.569vw", "0vw", "7.292vw"]
); );
const top = useTransform( const top = useTransform(
scroll, scroll,
[0, 1 / 5, 2 / 5, 3 / 5, 4 / 5, 1], [0, 1 / 5, 2 / 5, 3 / 5, 4 / 5, 1],
['3.602vw', '4.022vw', '4.022vw', '2.122vw', '4.022vw', '10.855vw'] ["3.602vw", "4.022vw", "4.022vw", "2.122vw", "4.022vw", "10.855vw"]
); );
useMotionValueEvent(scroll, 'change', (value) => useMotionValueEvent(scroll, "change", (value) =>
setSlide(Math.min(Math.trunc(value * videos.length), videos.length - 1)) setSlide(Math.min(Math.trunc(value * videos.length), videos.length - 1))
); );
@@ -80,8 +80,8 @@ export function VideoLayerMain({ scroll }: { scroll: MotionValue<number> }) {
useEffect(() => setCurrentBuffering(true), [slide]); useEffect(() => setCurrentBuffering(true), [slide]);
const t = useTranslations('integration_crm'); const t = useTranslations("integration_crm");
const tLoading = useTranslations('video_loading'); const tLoading = useTranslations("video_loading");
return ( return (
<motion.div <motion.div
@@ -94,7 +94,7 @@ export function VideoLayerMain({ scroll }: { scroll: MotionValue<number> }) {
}} }}
className="absolute h-full overflow-hidden bg-[url(/img/pages/home/presentation/touch_screen.png)] bg-cover bg-top bg-no-repeat" className="absolute h-full overflow-hidden bg-[url(/img/pages/home/presentation/touch_screen.png)] bg-cover bg-top bg-no-repeat"
onViewportEnter={handleOnViewportFeatureEnter} onViewportEnter={handleOnViewportFeatureEnter}
viewport={{ margin: '-10% 0% 0% 0%', once: true }} viewport={{ margin: "-10% 0% 0% 0%", once: true }}
> >
{!!videoRefs.length && {!!videoRefs.length &&
videos.map(({ src }, index) => ( videos.map(({ src }, index) => (
@@ -104,7 +104,7 @@ export function VideoLayerMain({ scroll }: { scroll: MotionValue<number> }) {
style={{ opacity }} style={{ opacity }}
className="absolute left-[1.667vw] top-[1.667vw] z-10 max-w-[34.097vw] heading2 font-medium" className="absolute left-[1.667vw] top-[1.667vw] z-10 max-w-[34.097vw] heading2 font-medium"
> >
{t('description3')} {t("description3")}
</motion.p> </motion.p>
)} )}
<motion.video <motion.video
@@ -114,7 +114,7 @@ export function VideoLayerMain({ scroll }: { scroll: MotionValue<number> }) {
src={ src={
isViewportEntered isViewportEntered
? `/videos/pages/home/presentation/${src}.mp4` ? `/videos/pages/home/presentation/${src}.mp4`
: '' : ""
} }
style={{ style={{
zIndex: videos.length - index, zIndex: videos.length - index,
@@ -127,7 +127,7 @@ export function VideoLayerMain({ scroll }: { scroll: MotionValue<number> }) {
muted muted
playsInline playsInline
className={`object-bottom object-cover origin-top absolute left-1/2 -translate-x-1/2 !rotate-x-[4deg] transition-[opacity,transform]${ className={`object-bottom object-cover origin-top absolute left-1/2 -translate-x-1/2 !rotate-x-[4deg] transition-[opacity,transform]${
slide > index ? ' opacity-0' : '' slide > index ? " opacity-0" : ""
}`} }`}
/> />
<motion.div <motion.div
@@ -143,7 +143,7 @@ export function VideoLayerMain({ scroll }: { scroll: MotionValue<number> }) {
}} }}
> >
<LoaderIcon className="animate-spin lg:w-[1.389vw] lg:h-[1.389vw] h-5 w-5" /> <LoaderIcon className="animate-spin lg:w-[1.389vw] lg:h-[1.389vw] h-5 w-5" />
<span className="text2 select-none">{tLoading('title')}</span> <span className="text2 select-none">{tLoading("title")}</span>
</motion.div> </motion.div>
<motion.div <motion.div
initial={{ opacity: 0 }} initial={{ opacity: 0 }}
+39 -39
View File
@@ -1,70 +1,70 @@
export const videos = [ export const videos = [
{ {
src: '1_search', src: "1_search_comp",
anchorImg: '/img/pages/prime/search-select.jpg', anchorImg: "/img/pages/prime/search-select.jpg",
title: 'search', title: "search",
}, },
{ {
src: '2_3dtour', src: "2_3dtour_comp",
anchorImg: '/img/pages/prime/3dtour.jpg', anchorImg: "/img/pages/prime/3dtour.jpg",
title: '3dtour', title: "3dtour",
}, },
{ {
src: '3_infrastructure', src: "3_infrastructure_comp",
anchorImg: '/img/pages/prime/infra.jpg', anchorImg: "/img/pages/prime/infra.jpg",
title: 'infrastructure', title: "infrastructure",
}, },
{ {
src: '4_insolation', src: "4_insolation_comp",
anchorImg: '/img/pages/prime/insolation.jpg', anchorImg: "/img/pages/prime/insolation.jpg",
title: 'insolation', title: "insolation",
}, },
{ {
src: '5_engine', src: "5_engine_comp",
anchorImg: '/img/pages/prime/engine.jpg', anchorImg: "/img/pages/prime/engine.jpg",
title: 'engine', title: "engine",
}, },
{ {
src: '6_reservation', src: "6_reservation_comp",
anchorImg: '/img/pages/prime/crm.jpg', anchorImg: "/img/pages/prime/crm.jpg",
title: 'crm', title: "crm",
}, },
]; ];
export const primeVideos = [ export const primeVideos = [
{ {
src: '2_3dtour', src: "2_3dtour_comp",
anchorImg: '/img/pages/prime/3dtour.jpg', anchorImg: "/img/pages/prime/3dtour.jpg",
title: '3D тур', title: "3D тур",
}, },
{ {
src: '1_search', src: "1_search_comp",
anchorImg: '/img/pages/prime/search-select.jpg', anchorImg: "/img/pages/prime/search-select.jpg",
title: 'Поиск', title: "Поиск",
}, },
{ {
src: '3_infrastructure', src: "3_infrastructure_comp",
anchorImg: '/img/pages/prime/infra.jpg', anchorImg: "/img/pages/prime/infra.jpg",
title: 'Инфраструктура', title: "Инфраструктура",
}, },
{ {
src: '7_favorites', src: "7_favorites",
anchorImg: '/img/pages/prime/favorites.jpg', anchorImg: "/img/pages/prime/favorites.jpg",
title: 'Избранное', title: "Избранное",
}, },
{ {
src: '8_integrationCRM', src: "8_integrationCRM",
anchorImg: '/img/pages/prime/crm.jpg', anchorImg: "/img/pages/prime/crm.jpg",
title: 'Интеграция с CRM', title: "Интеграция с CRM",
}, },
{ {
src: '4_insolation', src: "4_insolation_comp",
anchorImg: '/img/pages/prime/insolation.jpg', anchorImg: "/img/pages/prime/insolation.jpg",
title: 'Инсоляция', title: "Инсоляция",
}, },
{ {
src: '6_reservation', src: "6_reservation_comp",
anchorImg: '/img/pages/prime/cp.jpg', anchorImg: "/img/pages/prime/cp.jpg",
title: 'Отправка КП', title: "Отправка КП",
}, },
]; ];