diff --git a/public/images/aboutCompany/roveHomeSlider/1.png b/public/images/aboutCompany/roveHomeSlider/1.png new file mode 100644 index 0000000..b025108 Binary files /dev/null and b/public/images/aboutCompany/roveHomeSlider/1.png differ diff --git a/public/images/aboutCompany/roveHomeSlider/2.png b/public/images/aboutCompany/roveHomeSlider/2.png new file mode 100644 index 0000000..8cf4653 Binary files /dev/null and b/public/images/aboutCompany/roveHomeSlider/2.png differ diff --git a/public/images/aboutCompany/roveHomeSlider/3.png b/public/images/aboutCompany/roveHomeSlider/3.png new file mode 100644 index 0000000..f035302 Binary files /dev/null and b/public/images/aboutCompany/roveHomeSlider/3.png differ diff --git a/public/images/aboutCompany/roveHomeSlider/4.png b/public/images/aboutCompany/roveHomeSlider/4.png new file mode 100644 index 0000000..50eeda5 Binary files /dev/null and b/public/images/aboutCompany/roveHomeSlider/4.png differ diff --git a/src/components/aboutComplex/LivingSolutionSlider.tsx b/src/components/aboutComplex/LivingSolutionSlider.tsx index c2183e8..9703b32 100644 --- a/src/components/aboutComplex/LivingSolutionSlider.tsx +++ b/src/components/aboutComplex/LivingSolutionSlider.tsx @@ -67,7 +67,7 @@ const LivingSolutionSlider = () => { }, [imageWidth, selectedImageIndex, window.innerWidth]); return ( -
+
{ + const [offset, setOffset] = useState(0); + const [imageWidth, setImageWidth] = useState(0); + const imageRef = useRef(null); + + const handlers = useSwipeable({ + onSwipedLeft: next, + onSwipedRight: prev, + trackMouse: true, + }); + + function next() { + if (offset > -1 * (rovehomeSlides.length - 1)) { + setOffset((prev) => prev - 1); + } + } + + function prev() { + if (offset < 0) { + setOffset((prev) => prev + 1); + } + } + + // const handleOnRightClick = () => { + // if (offset > -1 * (rovehomeSlides.length - 1)) { + // setOffset((prev) => prev - 1); + // } + // }; + + // const handleOnLeftClick = () => { + // if (offset < 0) { + // setOffset((prev) => prev + 1); + // } + // }; + + useEffect(() => { + if (!imageRef.current) return; + const width = imageRef.current.width; + setImageWidth(width); + }, [imageRef.current?.width]); + + return ( +
+ {/*
*/} +
+
+

+ {rovehomeSlides[offset * -1].title} +

+

+ {rovehomeSlides[offset * -1].desc1} +

+

+ {rovehomeSlides[offset * -1].desc2} +

+
+
+
+
+

+ {rovehomeSlides.length - rovehomeSlides.length + 1 - offset}/ + {rovehomeSlides.length} +

+
+
+
+
+ {rovehomeSlides.map((slide) => ( +
+ +
+

+ {slide.title} +

+

{slide.desc1}

+

{slide.desc2}

+
+
+ ))} +
+
+ {rovehomeSlides.map((_, index) => ( +
+ ))} +
+
+
+ ); +}; + +export default RoveHomeSlider; diff --git a/src/index.css b/src/index.css index 81d7b83..0eefd44 100644 --- a/src/index.css +++ b/src/index.css @@ -74,6 +74,14 @@ html { .text-button-m { } + .mobile-text-s { + font-family: "Usual", sans-serif; + line-height: 140%; + font-size: clamp(10px, 0.01rem + 0.93vw, 20px); + } + + .mobile-subheadline-m { + } .rubber-headline-indent { text-indent: clamp(209px, -0.4197rem + 16.8396vw, 842px); } diff --git a/src/pages/AboutComplex.tsx b/src/pages/AboutComplex.tsx index 88753ad..639a072 100644 --- a/src/pages/AboutComplex.tsx +++ b/src/pages/AboutComplex.tsx @@ -3,6 +3,7 @@ import Footer from "../components/Footer"; import Button from "../components/Button"; import LeftArrowIcon from "../components/icons/LeftArrowIcon"; import LivingSolutionSlider from "../components/aboutComplex/LivingSolutionSlider"; +import RoveHomeSlider from "../components/aboutComplex/RoveHomeSlider"; interface ICityItem { time: number; @@ -158,13 +159,7 @@ const AboutComplex = () => {
{/* RoveHome roof */} -
- -
+ {/* Rove around the city */}