3 ? '456' : '')}
- initial={{ minWidth: '31.6vw', minHeight: '31.8vw' }}
- transition={{ duration: 0.5, type: 'just', delay: 0.5 }}
- animate={!!ref && { minWidth: '48vw', minHeight: '48vw' }}
- // exit={{ minWidth: '31.6vw', minHeight: '31.8vw' }}
- className={'flex flex-col relative transition-all pointer-events-none'}
- // style={{
- // transition: 'all 0.5s ease-out',
- // ...transitionStyles.get(state),
- // }}
- >
+ <>
+
-
-
-
{title}
- {year}
-
-
{company}
+
+
+
+
{title}
+ {year}
-
-
- // )}
- //
+
{company}
+
+ >
);
-});
-
-IntegrationItem.displayName = 'IntegrationItem';
+}
diff --git a/src/components/pages/MainPage/Integrations/IntegrationsSlider.tsx b/src/components/pages/MainPage/Integrations/IntegrationsSlider.tsx
index 18e9374a..e52fbe77 100644
--- a/src/components/pages/MainPage/Integrations/IntegrationsSlider.tsx
+++ b/src/components/pages/MainPage/Integrations/IntegrationsSlider.tsx
@@ -13,8 +13,9 @@ export function IntegrationsSlider({
slides={integrations}
SlideElement={IntegrationItem}
title="Интеграции в офисы продаж"
- className="pt-[120px] pb-14 border-b border-[#3D425C] min-h-[calc(48vw+248px)] "
- slideBaseSizes={['31.6vw', '31.8vw']}
+ className="pt-[120px] pb-14 border-b border-[#3D425C] min-h-[calc(48vw+250px)]"
+ childClassName="flex flex-col"
+ slideSizes={['31.6vw', '31.8vw', '48vw', '48vw']}
controlsPosition="bottom"
/>
);
diff --git a/src/components/pages/MainPage/Showreel.tsx b/src/components/pages/MainPage/Showreel.tsx
index d6853c51..8a47da37 100644
--- a/src/components/pages/MainPage/Showreel.tsx
+++ b/src/components/pages/MainPage/Showreel.tsx
@@ -1,13 +1,12 @@
'use client';
-import { LoadingIcon } from '@/components/icons/LoadingIcon';
import { PlayIcon } from '@/components/icons/PlayIcon';
import { VideoModal } from '@/components/Layout/VideoModal';
import { ClassNameWrapper } from '@/hocs/ClassNameWrapper';
import { useModalStore } from '@/stores/useModalStore';
export function Showreel() {
- const { modal, setModal } = useModalStore();
+ const { setModal } = useModalStore();
return (
@@ -15,23 +14,15 @@ export function Showreel() {
-
-
-
- }
- />
-
- Загружаем шоурил...
-
-
);
}
diff --git a/src/components/pages/MainPage/Technology.tsx b/src/components/pages/MainPage/Technology.tsx
index 605ea509..20287bed 100644
--- a/src/components/pages/MainPage/Technology.tsx
+++ b/src/components/pages/MainPage/Technology.tsx
@@ -32,7 +32,7 @@ export function Technology() {
презентовать объект покупателю из любой точки мира
-
+
diff --git a/src/stores/useModalStore.ts b/src/stores/useModalStore.ts
index 2a730792..6fe63e08 100644
--- a/src/stores/useModalStore.ts
+++ b/src/stores/useModalStore.ts
@@ -3,10 +3,12 @@ import { create } from 'zustand';
interface IModalState {
modal: ReactNode | null;
- setModal: (modal: ReactNode) => void;
+ setModal: (modal: ReactNode, modalName: string) => void;
+ name: string;
}
export const useModalStore = create(set => ({
modal: null,
- setModal: modal => set({ modal }),
+ name: '',
+ setModal: (modal: ReactNode, name: string) => set({ modal, name }),
}));
diff --git a/src/ui/SliderWithScaling.tsx b/src/ui/SliderWithScaling.tsx
index 0da267ba..caadb606 100644
--- a/src/ui/SliderWithScaling.tsx
+++ b/src/ui/SliderWithScaling.tsx
@@ -1,44 +1,40 @@
'use client';
import { useWindowWidth } from '@/hooks/useWindowWidth';
-import {
- ForwardRefExoticComponent,
- RefAttributes,
- useEffect,
- useReducer,
- useRef,
- useState,
-} from 'react';
+import { motion } from 'framer-motion';
+import { ReactNode, useEffect, useReducer, useState } from 'react';
import { useSwipeable } from 'react-swipeable';
import { SliderControls } from './SliderControls';
-export function SliderWithScaling({
+export function SliderWithScaling({
slides,
SlideElement,
className = '',
+ childClassName = '',
alignItems = 'start',
title,
- slideBaseSizes: [minWidth, minHeight],
+ slideSizes: [minWidth, minHeight, minWidthScaled, minHeightScaled],
controlsPosition,
}: {
slides: T[];
- SlideElement: ForwardRefExoticComponent<
- T & { index: number } & RefAttributes
- >;
+ SlideElement: (_: T) => ReactNode;
className?: string;
+ childClassName?: string;
alignItems?: 'start' | 'center' | 'end';
title: string;
- slideBaseSizes: [string, string];
+ slideSizes: [string, string, string, string];
controlsPosition: 'top' | 'bottom';
}) {
const width = useWindowWidth();
const baseoffset = (-width / 1600) * 507 + 8;
- const itemRef = useRef(null);
-
const [slide, setSlide] = useState(0);
const [sliderOffset, setSliderOffset] = useState(baseoffset);
+ const [currentSliding, setCurrentSliding] = useState<
+ 'prev' | 'next' | null
+ >();
+
const [order, dispatch] = useReducer(
(state: typeof slides, action: 'prev' | 'next') => {
switch (action) {
@@ -58,17 +54,19 @@ export function SliderWithScaling({
);
const nextSlide = () => {
+ setCurrentSliding('next');
dispatch('next');
};
+ const prevSlide = () => {
+ setCurrentSliding('prev');
+ dispatch('prev');
+ };
+
useEffect(() => {
setSliderOffset(baseoffset);
}, [baseoffset, order, slide]);
- const prevSlide = () => {
- dispatch('prev');
- };
-
const handlers = useSwipeable({
onSwipedLeft: nextSlide,
onSwipedRight: prevSlide,
@@ -89,19 +87,36 @@ export function SliderWithScaling({
style={{
transform: `translateX(${sliderOffset}px)`,
transitionDuration: `${sliderOffset !== 0 && sliderOffset !== 2 * baseoffset ? 1 : 0}s`,
- // transitionDelay: `${sliderOffset !== 0 && sliderOffset !== 2 * baseoffset ? 1 : 0}s`,
}}
>
- {order.map((slide, index) => {
- return (
-
- );
- })}
+ {order.map((slide, index) => (
+ 3 ? '456' : '')}
+ initial={
+ currentSliding === 'next' && index === 0
+ ? { minWidth: minWidthScaled, minHeight: minHeightScaled }
+ : index === 3
+ ? { minWidth, minHeight }
+ : {}
+ }
+ transition={{ duration: 1, type: 'just' }}
+ animate={
+ index === 1
+ ? {
+ minWidth: minWidthScaled,
+ minHeight: minHeightScaled,
+ }
+ : {
+ minWidth,
+ minHeight,
+ transition: { duration: index === 3 ? 0.0001 : 1 },
+ }
+ }
+ className={'pointer-events-none ' + childClassName}
+ >
+
+
+ ))}