diff --git a/public/images/L_Hata/0.jpg b/public/images/L_Hata/0.jpg new file mode 100644 index 0000000..e86a296 Binary files /dev/null and b/public/images/L_Hata/0.jpg differ diff --git a/public/images/L_Hata/1.jpg b/public/images/L_Hata/1.jpg new file mode 100644 index 0000000..f160fa9 Binary files /dev/null and b/public/images/L_Hata/1.jpg differ diff --git a/public/images/L_Hata/10.jpg b/public/images/L_Hata/10.jpg new file mode 100644 index 0000000..6199be0 Binary files /dev/null and b/public/images/L_Hata/10.jpg differ diff --git a/public/images/L_Hata/11.jpg b/public/images/L_Hata/11.jpg new file mode 100644 index 0000000..f1ebb3d Binary files /dev/null and b/public/images/L_Hata/11.jpg differ diff --git a/public/images/L_Hata/12.jpg b/public/images/L_Hata/12.jpg new file mode 100644 index 0000000..bb3d788 Binary files /dev/null and b/public/images/L_Hata/12.jpg differ diff --git a/public/images/L_Hata/13.jpg b/public/images/L_Hata/13.jpg new file mode 100644 index 0000000..263b714 Binary files /dev/null and b/public/images/L_Hata/13.jpg differ diff --git a/public/images/L_Hata/14.jpg b/public/images/L_Hata/14.jpg new file mode 100644 index 0000000..bb8e2a2 Binary files /dev/null and b/public/images/L_Hata/14.jpg differ diff --git a/public/images/L_Hata/15.jpg b/public/images/L_Hata/15.jpg new file mode 100644 index 0000000..5331883 Binary files /dev/null and b/public/images/L_Hata/15.jpg differ diff --git a/public/images/L_Hata/16.jpg b/public/images/L_Hata/16.jpg new file mode 100644 index 0000000..8cc5c46 Binary files /dev/null and b/public/images/L_Hata/16.jpg differ diff --git a/public/images/L_Hata/17.jpg b/public/images/L_Hata/17.jpg new file mode 100644 index 0000000..95cd4ae Binary files /dev/null and b/public/images/L_Hata/17.jpg differ diff --git a/public/images/L_Hata/18.jpg b/public/images/L_Hata/18.jpg new file mode 100644 index 0000000..b6814b1 Binary files /dev/null and b/public/images/L_Hata/18.jpg differ diff --git a/public/images/L_Hata/19.jpg b/public/images/L_Hata/19.jpg new file mode 100644 index 0000000..90da5c6 Binary files /dev/null and b/public/images/L_Hata/19.jpg differ diff --git a/public/images/L_Hata/2.jpg b/public/images/L_Hata/2.jpg new file mode 100644 index 0000000..867ef8c Binary files /dev/null and b/public/images/L_Hata/2.jpg differ diff --git a/public/images/L_Hata/20.jpg b/public/images/L_Hata/20.jpg new file mode 100644 index 0000000..db857d8 Binary files /dev/null and b/public/images/L_Hata/20.jpg differ diff --git a/public/images/L_Hata/21.jpg b/public/images/L_Hata/21.jpg new file mode 100644 index 0000000..623478b Binary files /dev/null and b/public/images/L_Hata/21.jpg differ diff --git a/public/images/L_Hata/22.jpg b/public/images/L_Hata/22.jpg new file mode 100644 index 0000000..e60da61 Binary files /dev/null and b/public/images/L_Hata/22.jpg differ diff --git a/public/images/L_Hata/23.jpg b/public/images/L_Hata/23.jpg new file mode 100644 index 0000000..b2b3093 Binary files /dev/null and b/public/images/L_Hata/23.jpg differ diff --git a/public/images/L_Hata/24.jpg b/public/images/L_Hata/24.jpg new file mode 100644 index 0000000..b4c7e44 Binary files /dev/null and b/public/images/L_Hata/24.jpg differ diff --git a/public/images/L_Hata/25.jpg b/public/images/L_Hata/25.jpg new file mode 100644 index 0000000..7a869ed Binary files /dev/null and b/public/images/L_Hata/25.jpg differ diff --git a/public/images/L_Hata/3.jpg b/public/images/L_Hata/3.jpg new file mode 100644 index 0000000..752e133 Binary files /dev/null and b/public/images/L_Hata/3.jpg differ diff --git a/public/images/L_Hata/4.jpg b/public/images/L_Hata/4.jpg new file mode 100644 index 0000000..e7e69c7 Binary files /dev/null and b/public/images/L_Hata/4.jpg differ diff --git a/public/images/L_Hata/5.jpg b/public/images/L_Hata/5.jpg new file mode 100644 index 0000000..9f22779 Binary files /dev/null and b/public/images/L_Hata/5.jpg differ diff --git a/public/images/L_Hata/6.jpg b/public/images/L_Hata/6.jpg new file mode 100644 index 0000000..57481e0 Binary files /dev/null and b/public/images/L_Hata/6.jpg differ diff --git a/public/images/L_Hata/7.jpg b/public/images/L_Hata/7.jpg new file mode 100644 index 0000000..5f0237f Binary files /dev/null and b/public/images/L_Hata/7.jpg differ diff --git a/public/images/L_Hata/8.jpg b/public/images/L_Hata/8.jpg new file mode 100644 index 0000000..9a663a3 Binary files /dev/null and b/public/images/L_Hata/8.jpg differ diff --git a/public/images/L_Hata/9.jpg b/public/images/L_Hata/9.jpg new file mode 100644 index 0000000..51ca824 Binary files /dev/null and b/public/images/L_Hata/9.jpg differ diff --git a/public/images/L_Hata/L_Hata_0.webp b/public/images/L_Hata/L_Hata_0.webp deleted file mode 100644 index 28f2792..0000000 Binary files a/public/images/L_Hata/L_Hata_0.webp and /dev/null differ diff --git a/public/images/L_Hata/L_Hata_1.webp b/public/images/L_Hata/L_Hata_1.webp deleted file mode 100644 index 584e184..0000000 Binary files a/public/images/L_Hata/L_Hata_1.webp and /dev/null differ diff --git a/public/images/L_Hata/L_Hata_10.webp b/public/images/L_Hata/L_Hata_10.webp deleted file mode 100644 index 2ae9b98..0000000 Binary files a/public/images/L_Hata/L_Hata_10.webp and /dev/null differ diff --git a/public/images/L_Hata/L_Hata_11.webp b/public/images/L_Hata/L_Hata_11.webp deleted file mode 100644 index 541160e..0000000 Binary files a/public/images/L_Hata/L_Hata_11.webp and /dev/null differ diff --git a/public/images/L_Hata/L_Hata_12.webp b/public/images/L_Hata/L_Hata_12.webp deleted file mode 100644 index 9be156a..0000000 Binary files a/public/images/L_Hata/L_Hata_12.webp and /dev/null differ diff --git a/public/images/L_Hata/L_Hata_13.webp b/public/images/L_Hata/L_Hata_13.webp deleted file mode 100644 index 79bb2f6..0000000 Binary files a/public/images/L_Hata/L_Hata_13.webp and /dev/null differ diff --git a/public/images/L_Hata/L_Hata_2.webp b/public/images/L_Hata/L_Hata_2.webp deleted file mode 100644 index a6f3ae2..0000000 Binary files a/public/images/L_Hata/L_Hata_2.webp and /dev/null differ diff --git a/public/images/L_Hata/L_Hata_3.webp b/public/images/L_Hata/L_Hata_3.webp deleted file mode 100644 index 61cceba..0000000 Binary files a/public/images/L_Hata/L_Hata_3.webp and /dev/null differ diff --git a/public/images/L_Hata/L_Hata_4.webp b/public/images/L_Hata/L_Hata_4.webp deleted file mode 100644 index 64840a2..0000000 Binary files a/public/images/L_Hata/L_Hata_4.webp and /dev/null differ diff --git a/public/images/L_Hata/L_Hata_5.webp b/public/images/L_Hata/L_Hata_5.webp deleted file mode 100644 index 40641c5..0000000 Binary files a/public/images/L_Hata/L_Hata_5.webp and /dev/null differ diff --git a/public/images/L_Hata/L_Hata_6.webp b/public/images/L_Hata/L_Hata_6.webp deleted file mode 100644 index b38444d..0000000 Binary files a/public/images/L_Hata/L_Hata_6.webp and /dev/null differ diff --git a/public/images/L_Hata/L_Hata_7.webp b/public/images/L_Hata/L_Hata_7.webp deleted file mode 100644 index 6744ebe..0000000 Binary files a/public/images/L_Hata/L_Hata_7.webp and /dev/null differ diff --git a/public/images/L_Hata/L_Hata_8.webp b/public/images/L_Hata/L_Hata_8.webp deleted file mode 100644 index 19dca7d..0000000 Binary files a/public/images/L_Hata/L_Hata_8.webp and /dev/null differ diff --git a/public/images/L_Hata/L_Hata_9.webp b/public/images/L_Hata/L_Hata_9.webp deleted file mode 100644 index 5dd729e..0000000 Binary files a/public/images/L_Hata/L_Hata_9.webp and /dev/null differ diff --git a/public/images/R_Hata/0.jpg b/public/images/R_Hata/0.jpg index f555331..a571bcd 100644 Binary files a/public/images/R_Hata/0.jpg and b/public/images/R_Hata/0.jpg differ diff --git a/public/images/R_Hata/1.jpg b/public/images/R_Hata/1.jpg index f164206..fdfb2d9 100644 Binary files a/public/images/R_Hata/1.jpg and b/public/images/R_Hata/1.jpg differ diff --git a/public/images/R_Hata/10.jpg b/public/images/R_Hata/10.jpg index d63cafe..6e2fbd3 100644 Binary files a/public/images/R_Hata/10.jpg and b/public/images/R_Hata/10.jpg differ diff --git a/public/images/R_Hata/11.jpg b/public/images/R_Hata/11.jpg index 5832e26..4caa922 100644 Binary files a/public/images/R_Hata/11.jpg and b/public/images/R_Hata/11.jpg differ diff --git a/public/images/R_Hata/12.jpg b/public/images/R_Hata/12.jpg index 12d07aa..88e3699 100644 Binary files a/public/images/R_Hata/12.jpg and b/public/images/R_Hata/12.jpg differ diff --git a/public/images/R_Hata/13.jpg b/public/images/R_Hata/13.jpg index c08ce76..c16c3f1 100644 Binary files a/public/images/R_Hata/13.jpg and b/public/images/R_Hata/13.jpg differ diff --git a/public/images/R_Hata/14.jpg b/public/images/R_Hata/14.jpg index c0f3b3b..7bce8e8 100644 Binary files a/public/images/R_Hata/14.jpg and b/public/images/R_Hata/14.jpg differ diff --git a/public/images/R_Hata/15.jpg b/public/images/R_Hata/15.jpg index dae4874..04c98db 100644 Binary files a/public/images/R_Hata/15.jpg and b/public/images/R_Hata/15.jpg differ diff --git a/public/images/R_Hata/16.jpg b/public/images/R_Hata/16.jpg index ac6eb42..13a31c2 100644 Binary files a/public/images/R_Hata/16.jpg and b/public/images/R_Hata/16.jpg differ diff --git a/public/images/R_Hata/17.jpg b/public/images/R_Hata/17.jpg index c3a635e..5439f0e 100644 Binary files a/public/images/R_Hata/17.jpg and b/public/images/R_Hata/17.jpg differ diff --git a/public/images/R_Hata/18.jpg b/public/images/R_Hata/18.jpg index 01b944d..c4ba471 100644 Binary files a/public/images/R_Hata/18.jpg and b/public/images/R_Hata/18.jpg differ diff --git a/public/images/R_Hata/19.jpg b/public/images/R_Hata/19.jpg index 6d2d24d..a175441 100644 Binary files a/public/images/R_Hata/19.jpg and b/public/images/R_Hata/19.jpg differ diff --git a/public/images/R_Hata/2.jpg b/public/images/R_Hata/2.jpg index 9176f04..462d238 100644 Binary files a/public/images/R_Hata/2.jpg and b/public/images/R_Hata/2.jpg differ diff --git a/public/images/R_Hata/20.jpg b/public/images/R_Hata/20.jpg index 79435b6..b925b6e 100644 Binary files a/public/images/R_Hata/20.jpg and b/public/images/R_Hata/20.jpg differ diff --git a/public/images/R_Hata/21.jpg b/public/images/R_Hata/21.jpg index ab1ab3e..cf450e8 100644 Binary files a/public/images/R_Hata/21.jpg and b/public/images/R_Hata/21.jpg differ diff --git a/public/images/R_Hata/22.jpg b/public/images/R_Hata/22.jpg index b13c7d5..9935d2d 100644 Binary files a/public/images/R_Hata/22.jpg and b/public/images/R_Hata/22.jpg differ diff --git a/public/images/R_Hata/3.jpg b/public/images/R_Hata/3.jpg index cd78f4d..8fe0207 100644 Binary files a/public/images/R_Hata/3.jpg and b/public/images/R_Hata/3.jpg differ diff --git a/public/images/R_Hata/4.jpg b/public/images/R_Hata/4.jpg index 9d068ab..db11c81 100644 Binary files a/public/images/R_Hata/4.jpg and b/public/images/R_Hata/4.jpg differ diff --git a/public/images/R_Hata/5.jpg b/public/images/R_Hata/5.jpg index 2285fe7..94e57c8 100644 Binary files a/public/images/R_Hata/5.jpg and b/public/images/R_Hata/5.jpg differ diff --git a/public/images/R_Hata/6.jpg b/public/images/R_Hata/6.jpg index 0aaf52e..7d7bfbd 100644 Binary files a/public/images/R_Hata/6.jpg and b/public/images/R_Hata/6.jpg differ diff --git a/public/images/R_Hata/7.jpg b/public/images/R_Hata/7.jpg index 8f6ae79..83114b0 100644 Binary files a/public/images/R_Hata/7.jpg and b/public/images/R_Hata/7.jpg differ diff --git a/public/images/R_Hata/8.jpg b/public/images/R_Hata/8.jpg index 8d6c4c1..51a71de 100644 Binary files a/public/images/R_Hata/8.jpg and b/public/images/R_Hata/8.jpg differ diff --git a/public/images/R_Hata/9.jpg b/public/images/R_Hata/9.jpg index d3c9ce9..35ec3ab 100644 Binary files a/public/images/R_Hata/9.jpg and b/public/images/R_Hata/9.jpg differ diff --git a/public/images/Tower1.jpg b/public/images/Tower1.jpg index 9b5360f..445d38b 100644 Binary files a/public/images/Tower1.jpg and b/public/images/Tower1.jpg differ diff --git a/public/images/Tower2.jpg b/public/images/Tower2.jpg index f6553ed..a39aee9 100644 Binary files a/public/images/Tower2.jpg and b/public/images/Tower2.jpg differ diff --git a/public/images/seq/seq.rar b/public/images/seq/seq.rar new file mode 100644 index 0000000..cc54d8a Binary files /dev/null and b/public/images/seq/seq.rar differ diff --git a/src/components/PointButton.tsx b/src/components/PointButton.tsx index 6f5f821..3fa09a3 100644 --- a/src/components/PointButton.tsx +++ b/src/components/PointButton.tsx @@ -16,8 +16,6 @@ function PointButton({ icon, label, onClick }: PointButtonProps) { {label} )} - {/*
*/} - {/*
*/} ); } diff --git a/src/components/Tower1FloorPlan.tsx b/src/components/Tower1FloorPlan.tsx new file mode 100644 index 0000000..4f696f1 --- /dev/null +++ b/src/components/Tower1FloorPlan.tsx @@ -0,0 +1,1081 @@ +interface Props { + x: number; + y: number; + onClick: (floor: number) => void; +} + +const SVGComponent = ({ x, y, onClick }: Props) => ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + onClick(27)}> + + + + + + {"27 этаж"} + + + + + onClick(26)}> + + + + + + {"26 этаж"} + + + + + onClick(25)}> + + + + + + {"25 этаж"} + + + + + onClick(24)}> + + + + + + {"24 этаж"} + + + + + onClick(23)}> + + + + + + {"23 этаж"} + + + + + onClick(22)}> + + + + + + {"22 этаж"} + + + + + onClick(21)}> + + + + + + {"21 этаж"} + + + + + onClick(20)}> + + + + + + {"20 этаж"} + + + + + onClick(19)}> + + + + onClick(18)}> + + + + + + {"18 этаж"} + + + + + onClick(17)}> + + + + + + {"17 этаж"} + + + + + onClick(16)}> + + + + + + {"16 этаж"} + + + + + onClick(15)}> + + + + + + {"15 этаж"} + + + + + onClick(14)}> + + + + + + {"14 этаж"} + + + + + onClick(13)}> + + + + + + {"13 этаж"} + + + + + onClick(12)}> + + + + + + {"12 этаж"} + + + + + onClick(11)}> + + + + + + {"11 этаж"} + + + + + onClick(10)}> + + + + + + {"10 этаж"} + + + + + onClick(9)}> + + + + + + {"9 этаж"} + + + + + onClick(8)}> + + + + + + {"8 этаж"} + + + + + onClick(7)}> + + + + + + {"7 этаж"} + + + + + onClick(6)}> + + + + + + {"6 этаж"} + + + + + + +); +export default SVGComponent; diff --git a/src/components/Tower2FloorPlan.tsx b/src/components/Tower2FloorPlan.tsx new file mode 100644 index 0000000..615d814 --- /dev/null +++ b/src/components/Tower2FloorPlan.tsx @@ -0,0 +1,1113 @@ +interface Props { + x: number; + y: number; + onClick: (floor: number) => void; +} + +const SVGComponent = ({ x, y, onClick }: Props) => ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + onClick(28)}> + + + + + + {"28 этаж"} + + + + + onClick(27)}> + + + + + + {"27 этаж"} + + + + + onClick(26)}> + + + + + + {"26 этаж"} + + + + + onClick(25)}> + + + + + + {"25 этаж"} + + + + + onClick(24)}> + + + + onClick(23)}> + + + + + + {"23 этаж"} + + + + + onClick(22)}> + + + + + + {"22 этаж"} + + + + + onClick(21)}> + + + + + + {"21 этаж"} + + + + + onClick(20)}> + + + + + + {"20 этаж"} + + + + + onClick(19)}> + + + + + + {"19 этаж"} + + + + + onClick(18)}> + + + + + + {"18 этаж"} + + + + + onClick(17)}> + + + + + + {"17 этаж"} + + + + + onClick(16)}> + + + + + + {"16 этаж"} + + + + + onClick(15)}> + + + + + + {"15 этаж"} + + + + + onClick(14)}> + + + + + + {"14 этаж"} + + + + + onClick(13)}> + + + + + + {"13 этаж"} + + + + + onClick(12)}> + + + + + + {"12 этаж"} + + + + + onClick(11)}> + + + + + + {"11 этаж"} + + + + + onClick(10)}> + + + + + + {"10 этаж"} + + + + + onClick(9)}> + + + + + + {"9 этаж"} + + + + + onClick(8)}> + + + + + + {"8 этаж"} + + + + + onClick(7)}> + + + + + + {"7 этаж"} + + + + + onClick(6)}> + + + + + + {"6 этаж"} + + + + + + +); +export default SVGComponent; diff --git a/src/components/icons/marks/MarkApartArea1.tsx b/src/components/icons/marks/MarkApartArea2.tsx similarity index 95% rename from src/components/icons/marks/MarkApartArea1.tsx rename to src/components/icons/marks/MarkApartArea2.tsx index 492e884..93cd72f 100644 --- a/src/components/icons/marks/MarkApartArea1.tsx +++ b/src/components/icons/marks/MarkApartArea2.tsx @@ -6,7 +6,7 @@ interface Props { onMouseLeave?: () => void; } -function MarkApartArea1({ x, y, onClick, onMouseEnter, onMouseLeave }: Props) { +function MarkApartArea2({ x, y, onClick, onMouseEnter, onMouseLeave }: Props) { return ( Floor23; -} - -export default Floor23; diff --git a/src/components/icons/marks/Tower2/Floor24.tsx b/src/components/icons/marks/Tower2/Floor24.tsx deleted file mode 100644 index 90deb12..0000000 --- a/src/components/icons/marks/Tower2/Floor24.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import React from "react"; - -function Floor24() { - return
Floor24
; -} - -export default Floor24; diff --git a/src/components/icons/marks/Tower2/Floor25.tsx b/src/components/icons/marks/Tower2/Floor25.tsx deleted file mode 100644 index d05f95e..0000000 --- a/src/components/icons/marks/Tower2/Floor25.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import React from "react"; - -function Floor25() { - return
Floor25
; -} - -export default Floor25; diff --git a/src/components/icons/marks/Tower2/Floor26.tsx b/src/components/icons/marks/Tower2/Floor26.tsx deleted file mode 100644 index baffa4b..0000000 --- a/src/components/icons/marks/Tower2/Floor26.tsx +++ /dev/null @@ -1,54 +0,0 @@ -interface Props { - x: number; - y: number; - onClick: () => void; -} -function Floor26({ x, y, onClick }: Props) { - return ( - - - - - - - {"26 этаж"} - - - - - ); -} - -export default Floor26; diff --git a/src/components/icons/marks/Tower2/Floor27.tsx b/src/components/icons/marks/Tower2/Floor27.tsx deleted file mode 100644 index 13f2659..0000000 --- a/src/components/icons/marks/Tower2/Floor27.tsx +++ /dev/null @@ -1,54 +0,0 @@ -interface Props { - x: number; - y: number; - onClick: () => void; -} - -function Floor27({ x, y, onClick }: Props) { - return ( - - - - - - {"27 этаж"} - - - - ); -} - -export default Floor27; diff --git a/src/components/icons/marks/Tower2/Floor28.tsx b/src/components/icons/marks/Tower2/Floor28.tsx deleted file mode 100644 index 7d3ad8a..0000000 --- a/src/components/icons/marks/Tower2/Floor28.tsx +++ /dev/null @@ -1,53 +0,0 @@ -interface Props { - x: number; - y: number; - onClick: () => void; -} - -function Floor28({ x, y, onClick }: Props) { - return ( - - - - - - {"28 этаж"} - - - - ); -} - -export default Floor28; diff --git a/src/components/maps/DvorMap.tsx b/src/components/maps/DvorMap.tsx index b882996..d113f12 100644 --- a/src/components/maps/DvorMap.tsx +++ b/src/components/maps/DvorMap.tsx @@ -1,15 +1,15 @@ interface Point { - id: string; + id: string | number; mapPosition: [number, number]; } -interface DvorMapProps { +interface Props { points: Point[]; - selectedPointId?: string; - onClick: (pointId: string) => void; + selectedPointId?: string | number; + onClick: (pointId: string | number) => void; } -function DvorMap({ points, selectedPointId, onClick }: DvorMapProps) { +function DvorMap({ points, selectedPointId, onClick }: Props) { return ( {points.map((point) => ( void; +} + +const SVGComponent = ({ points, selectedPointId, onClick }: Props) => ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {points && + points.map((point) => ( + onClick && onClick(point.id)} + > + {point.mapLabel && ( + + + + + {point.mapLabel} + + + + )} + + + + + ))} + + + +); +export default SVGComponent; diff --git a/src/components/maps/OuterDvorMap.tsx b/src/components/maps/OuterDvorMap.tsx index 81cb6ad..4ba0e0f 100644 --- a/src/components/maps/OuterDvorMap.tsx +++ b/src/components/maps/OuterDvorMap.tsx @@ -1,12 +1,12 @@ interface Point { - id: string; + id: string | number; mapPosition: [number, number]; } interface DvorMapProps { points: Point[]; - selectedPointId?: string; - onClick: (pointId: string) => void; + selectedPointId?: string | number; + onClick: (pointId: string | number) => void; } function OuterDvorMap({ points, selectedPointId, onClick }: DvorMapProps) { @@ -34,7 +34,6 @@ function OuterDvorMap({ points, selectedPointId, onClick }: DvorMapProps) { {points.map((point) => ( void; +} + +function RHataMap({ points, selectedPointId, onClick }: Props) { + return
RHataMap
; +} + +export default RHataMap; diff --git a/src/images3.json b/src/images3.json index 2c17f9b..6e4b691 100644 --- a/src/images3.json +++ b/src/images3.json @@ -1,140 +1,168 @@ [ { - "id": "R_Hata_0", + "id": 0, "src": "/images/R_Hata/0.jpg", "position": [62.6, 0, 61.3], - "links": [] + "mapPosition": [0, 0], + "links": [{ "toId": 9 }] }, { - "id": "R_Hata_1", + "id": 1, "src": "/images/R_Hata/1.jpg", "position": [97.6, 0, 31.6], - "links": [] + "mapPosition": [0, 0], + "links": [ + { "toId": 9 }, + { "toId": 8 }, + { "toId": 12 }, + { "toId": 6 }, + { "toId": 10 } + ] }, { - "id": "R_Hata_2", + "id": 2, "src": "/images/R_Hata/2.jpg", "position": [68.4, 0, 10.5], - "links": [] + "mapPosition": [0, 0], + "links": [{ "toId": 8 }, { "toId": 3 }] }, { - "id": "R_Hata_3", + "id": 3, "src": "/images/R_Hata/3.jpg", "position": [58.3, 0, 5.9], - "links": [] + "mapPosition": [0, 0], + "links": [{ "toId": 2 }, { "toId": 5 }] }, { - "id": "R_Hata_4", + "id": 4, "src": "/images/R_Hata/4.jpg", "position": [133.1, 0, 30.8], - "links": [] + "mapPosition": [0, 0], + "links": [{ "toId": 6 }, { "toId": 13 }] }, { - "id": "R_Hata_5", + "id": 5, "src": "/images/R_Hata/5.jpg", "position": [48.6, 0, -22.1], - "links": [] + "mapPosition": [0, 0], + "links": [{ "toId": 3 }] }, { - "id": "R_Hata_6", + "id": 6, "src": "/images/R_Hata/6.jpg", "position": [115.1, 0, 28.1], - "links": [] + "mapPosition": [0, 0], + "links": [{ "toId": 1 }, { "toId": 10 }, { "toId": 12 }, { "toId": 4 }] }, { - "id": "R_Hata_7", + "id": 7, "src": "/images/R_Hata/7.jpg", "position": [57.2, 0, 41], - "links": [] + "mapPosition": [0, 0], + "links": [{ "toId": 8 }] }, { - "id": "R_Hata_8", + "id": 8, "src": "/images/R_Hata/8.jpg", "position": [74.9, 0, 30.5], - "links": [] + "mapPosition": [0, 0], + "links": [{ "toId": 1 }, { "toId": 7 }, { "toId": 2 }] }, { - "id": "R_Hata_9", + "id": 9, "src": "/images/R_Hata/9.jpg", "position": [84.3, 0, 50.6], - "links": [] + "mapPosition": [0, 0], + "links": [{ "toId": 0 }, { "toId": 1 }] }, { - "id": "R_Hata_10", + "id": 10, "src": "/images/R_Hata/10.jpg", "position": [111, 0, 42.2], - "links": [] + "mapPosition": [0, 0], + "links": [{ "toId": 11 }, { "toId": 1 }, { "toId": 6 }] }, { - "id": "R_Hata_11", + "id": 11, "src": "/images/R_Hata/11.jpg", "position": [117.9, 0, 57.1], - "links": [] + "mapPosition": [0, 0], + "links": [{ "toId": 10 }] }, { - "id": "R_Hata_12", + "id": 12, "src": "/images/R_Hata/12.jpg", "position": [103.9, 0, 11.5], - "links": [] + "links": [{ "toId": 6 }, { "toId": 1 }, { "toId": 15 }] }, { - "id": "R_Hata_13", + "id": 13, "src": "/images/R_Hata/13.jpg", "position": [149.7, 0, 38.3], - "links": [] + "mapPosition": [0, 0], + "links": [{ "toId": 4 }, { "toId": 14 }] }, { - "id": "R_Hata_14", + "id": 14, "src": "/images/R_Hata/14.jpg", "position": [156.4, 0, 21], - "links": [] + "mapPosition": [0, 0], + "links": [{ "toId": 13 }] }, { - "id": "R_Hata_15", + "id": 15, "src": "/images/R_Hata/15.jpg", "position": [89.4, 0, -2.5], - "links": [] + "mapPosition": [0, 0], + "links": [{ "toId": 12 }, { "toId": 16 }] }, { - "id": "R_Hata_16", + "id": 16, "src": "/images/R_Hata/16.jpg", "position": [85.6, 0, -22.1], - "links": [] + "mapPosition": [0, 0], + "links": [{ "toId": 15 }, { "toId": 17 }] }, { - "id": "R_Hata_17", + "id": 17, "src": "/images/R_Hata/17.jpg", "position": [106.4, 0, -26.3], - "links": [] + "mapPosition": [0, 0], + "links": [{ "toId": 16 }, { "toId": 18 }] }, { - "id": "R_Hata_18", + "id": 18, "src": "/images/R_Hata/18.jpg", "position": [127.3, 0, -30.2], - "links": [] + "mapPosition": [0, 0], + "links": [{ "toId": 17 }, { "toId": 19 }] }, { - "id": "R_Hata_19", + "id": 19, "src": "/images/R_Hata/19.jpg", "position": [138.9, 0, -16.2], - "links": [] + "mapPosition": [0, 0], + "links": [{ "toId": 18 }] }, { - "id": "R_Hata_20", + "id": 20, "src": "/images/R_Hata/20.jpg", "position": [118.1, 0, -10.2], + "mapPosition": [0, 0], "links": [] }, { - "id": "R_Hata_21", + "id": 21, "src": "/images/R_Hata/21.jpg", "position": [124.5, 0, 7.5], + "mapPosition": [0, 0], "links": [] }, { - "id": "R_Hata_22", + "id": 22, "src": "/images/R_Hata/22.jpg", "position": [143.2, 0, 0.9], + "mapPosition": [0, 0], "links": [] } ] diff --git a/src/images4.json b/src/images4.json index 00a90f5..7829943 100644 --- a/src/images4.json +++ b/src/images4.json @@ -1,111 +1,201 @@ [ { - "id": "L_Hata_0", - "src": "/images/L_Hata/L_Hata_0.webp", - "position": [-103.69, 0, -44.75], - "links": [{ "toId": "L_Hata_9", "label": "Коридор" }] + "id": 0, + "src": "/images/L_Hata/0.jpg", + "position": [-949.8, 0, -455], + "mapPosition": [-4.4, 269.3], + "links": [{ "toId": 9 }] }, { - "id": "L_Hata_1", - "src": "/images/L_Hata/L_Hata_1.webp", - "position": [-100.25, 0, -42.89], + "id": 1, + "src": "/images/L_Hata/1.jpg", + "position": [-986.7, 0, -441.8], + "mapPosition": [61.6, 257], + "links": [{ "toId": 2 }, { "toId": 9 }] + }, + { + "id": 2, + "src": "/images/L_Hata/2.jpg", + "position": [-1003.8, 0, -431.1], + "mapPosition": [93.5, 243.2], + "mapLabel": "Коридор", "links": [ - { "toId": "L_Hata_9", "label": "Коридор" }, - { "toId": "L_Hata_8", "label": "Санузел" }, - { "toId": "L_Hata_7", "label": "Комната" }, - { "toId": "L_Hata_2", "label": "Коридор" }, - { "toId": "L_Hata_6", "label": "Комната" }, - { "toId": "L_Hata_11", "label": "Комната" } + { "toId": 11 }, + { "toId": 13 }, + { "toId": 10 }, + { "toId": 1 }, + { "toId": 8 }, + { "toId": 4 }, + { "toId": 3 } ] }, { - "id": "L_Hata_2", - "src": "/images/L_Hata/L_Hata_2.webp", - "position": [-98.79, 0, -40.85], - "links": [ - { "toId": "L_Hata_1", "label": "Коридор" }, - { "toId": "L_Hata_3", "label": "Кухня" } - ] + "id": 3, + "src": "/images/L_Hata/3.jpg", + "position": [-986.4, 0, -421.6], + "mapPosition": [67.2, 221.7], + "links": [{ "toId": 2 }, { "toId": 7 }] }, { - "id": "L_Hata_3", - "src": "/images/L_Hata/L_Hata_3.webp", - "position": [-95.06, 0, -38.66], - "links": [ - { "toId": "L_Hata_2", "label": "Коридор" }, - { "toId": "L_Hata_4", "label": "Кухня" } - ] + "id": 4, + "src": "/images/L_Hata/4.jpg", + "position": [-993.1, 0, -413.9], + "mapPosition": [80.5, 210.3], + "links": [{ "toId": 2 }, { "toId": 6 }] }, { - "id": "L_Hata_4", - "src": "/images/L_Hata/L_Hata_4.webp", - "position": [-95.07, 0, -35.38], - "links": [ - { "toId": "L_Hata_3", "label": "Кухня" }, - { "toId": "L_Hata_5", "label": "Балкон" } - ] + "id": 5, + "src": "/images/L_Hata/5.jpg", + "position": [-959.7, 0, -391.5], + "mapPosition": [30.7, 162.2], + "links": [{ "toId": 6 }, { "toId": 15 }] }, { - "id": "L_Hata_5", - "src": "/images/L_Hata/L_Hata_5.webp", - "position": [-92.78, 0, -31.67], - "links": [{ "toId": "L_Hata_4", "label": "Комната" }] + "id": 6, + "src": "/images/L_Hata/6.jpg", + "position": [-977.2, 0, -401.5], + "mapPosition": [57.3, 184.7], + "links": [{ "toId": 5 }, { "toId": 4 }] }, { - "id": "L_Hata_6", - "src": "/images/L_Hata/L_Hata_6.webp", - "position": [-95.91, 0, -42], - "links": [{ "toId": "L_Hata_1", "label": "Коридор" }] + "id": 7, + "src": "/images/L_Hata/7.jpg", + "position": [-966.3, 0, -421.8], + "mapPosition": [33.4, 216.5], + "mapLabel": "Спальня", + "links": [{ "toId": 3 }, { "toId": 14 }] }, { - "id": "L_Hata_7", - "src": "/images/L_Hata/L_Hata_7.webp", - "position": [-97.47, 0, -44.71], - "links": [{ "toId": "L_Hata_1", "label": "Коридор" }] + "id": 8, + "src": "/images/L_Hata/8.jpg", + "position": [-1011.5, 0, -412.3], + "mapPosition": [110.8, 212.8], + "links": [{ "toId": 2 }, { "toId": 22 }] }, { - "id": "L_Hata_8", - "src": "/images/L_Hata/L_Hata_8.webp", - "position": [-100.68, 0, -45.16], - "links": [{ "toId": "L_Hata_1", "label": "Коридор" }] + "id": 9, + "src": "/images/L_Hata/9.jpg", + "position": [-966.6, 0, -443.7], + "mapPosition": [26.2, 253.8], + "mapLabel": "Спальня", + "links": [{ "toId": 1 }, { "toId": 0 }] }, { - "id": "L_Hata_9", - "src": "/images/L_Hata/L_Hata_9.webp", - "position": [-102.13, 0, -43.45], - "links": [ - { "toId": "L_Hata_0", "label": "Прихожая" }, - { "toId": "L_Hata_1", "label": "Коридор" } - ] + "id": 10, + "src": "/images/L_Hata/10.jpg", + "position": [-1004.7, 0, -451.1], + "mapPosition": [89.2, 277.9], + "mapLabel": "Санузел", + "links": [{ "toId": 2 }] }, { - "id": "L_Hata_10", - "src": "/images/L_Hata/L_Hata_10.webp", - "position": [-102.73, 0, -42.12], - "links": [] + "id": 11, + "src": "/images/L_Hata/11.jpg", + "position": [-1025.2, 0, -439.3], + "mapPosition": [127.2, 263.3], + "links": [{ "toId": 12 }, { "toId": 2 }, { "toId": 13 }] }, { - "id": "L_Hata_11", - "src": "/images/L_Hata/L_Hata_11.webp", - "position": [-101.47, 0, -39.36], - "links": [ - { "toId": "L_Hata_1", "label": "Коридор" }, - { "toId": "L_Hata_12", "label": "Комната" } - ] + "id": 12, + "src": "/images/L_Hata/12.jpg", + "position": [-1044.1, 0, -454.4], + "mapPosition": [154.6, 295], + "links": [{ "toId": 11 }] }, { - "id": "L_Hata_12", - "src": "/images/L_Hata/L_Hata_12.webp", - "position": [-101.25, 0, -36.96], - "links": [ - { "toId": "L_Hata_11", "label": "Комната" }, - { "toId": "L_Hata_13", "label": "Санузел" } - ] + "id": 13, + "src": "/images/L_Hata/13.jpg", + "position": [-1027.7, 0, -422.2], + "mapPosition": [136.3, 234.7], + "links": [{ "toId": 11 }, { "toId": 2 }] }, { - "id": "L_Hata_13", - "src": "/images/L_Hata/L_Hata_13.webp", - "position": [-98.86, 0, -37.99], - "links": [{ "toId": "L_Hata_12", "label": "Комната" }] + "id": 14, + "src": "/images/L_Hata/14.jpg", + "position": [-946.4, 0, -423.2], + "mapPosition": [-0.9, 213.3], + "links": [{ "toId": 7 }] + }, + { + "id": 15, + "src": "/images/L_Hata/15.jpg", + "position": [-952.5, 0, -372.7], + "mapPosition": [23.8, 128], + "mapLabel": "Гостиная", + "links": [{ "toId": 5 }, { "toId": 19 }, { "toId": 16 }] + }, + { + "id": 16, + "src": "/images/L_Hata/16.jpg", + "position": [-943.4, 0, -355.6], + "mapPosition": [13.5, 95.9], + "links": [{ "toId": 15 }, { "toId": 19 }, { "toId": 20 }, { "toId": 17 }] + }, + { + "id": 17, + "src": "/images/L_Hata/17.jpg", + "position": [-933.1, 0, -339], + "mapPosition": [1, 64.3], + "links": [{ "toId": 16 }, { "toId": 20 }, { "toId": 18 }] + }, + { + "id": 18, + "src": "/images/L_Hata/18.jpg", + "position": [-927.7, 0, -316.3], + "mapPosition": [-1.4, 23.7], + "mapLabel": "Лоджия", + "links": [{ "toId": 17 }] + }, + { + "id": 19, + "src": "/images/L_Hata/19.jpg", + "position": [-963.6, 0, -355.8], + "mapPosition": [47.5, 101.9], + "links": [{ "toId": 15 }, { "toId": 16 }, { "toId": 21 }, { "toId": 20 }] + }, + { + "id": 20, + "src": "/images/L_Hata/20.jpg", + "position": [-952.4, 0, -334.2], + "mapPosition": [34.9, 61.5], + "mapLabel": "Кухня", + "links": [{ "toId": 21 }, { "toId": 19 }, { "toId": 16 }, { "toId": 17 }] + }, + { + "id": 21, + "src": "/images/L_Hata/21.jpg", + "position": [-977.9, 0, -342], + "mapPosition": [75.7, 82.1], + "links": [{ "toId": 19 }, { "toId": 20 }] + }, + { + "id": 22, + "src": "/images/L_Hata/22.jpg", + "position": [-1016.7, 0, -391.4], + "mapPosition": [126.9, 178.4], + "mapLabel": "Спальня", + "links": [{ "toId": 8 }, { "toId": 23 }] + }, + { + "id": 23, + "src": "/images/L_Hata/23.jpg", + "position": [-1015, 0, -369.6], + "mapPosition": [130.2, 140.4], + "links": [{ "toId": 22 }, { "toId": 24 }] + }, + { + "id": 24, + "src": "/images/L_Hata/24.jpg", + "position": [-994.2, 0, -373], + "mapPosition": [94.2, 140.3], + "links": [{ "toId": 23 }, { "toId": 25 }] + }, + { + "id": 25, + "src": "/images/L_Hata/25.jpg", + "position": [-985.6, 0, -384.3], + "mapPosition": [76.3, 157.3], + "mapLabel": "Санузел", + "links": [{ "toId": 24 }] } ] diff --git a/src/pages/MainPage.tsx b/src/pages/MainPage.tsx index eee3ebe..a03b86e 100644 --- a/src/pages/MainPage.tsx +++ b/src/pages/MainPage.tsx @@ -1,12 +1,19 @@ import { useNavigate } from "react-router-dom"; import Button from "../components/Button"; import SequenceSlider from "../components/SequenceSlider"; +import { useFullscreen } from "ahooks"; +import InfrastructureIcon from "../components/icons/InfrastructureIcon"; +import { useRef } from "react"; +import FullscreenIcon from "../components/icons/FullscreenIcon"; +import WindowModeIcon from "../components/icons/WindowModeIcon"; function MainPage() { + const fullscreenRef = useRef(null); + const [isFullscreen, { toggleFullscreen }] = useFullscreen(fullscreenRef); const navigate = useNavigate(); return ( -
+
@@ -14,13 +21,18 @@ function MainPage() { } /> -
+
diff --git a/src/pages/Tower1Page.tsx b/src/pages/Tower1Page.tsx index 71614ac..498adf1 100644 --- a/src/pages/Tower1Page.tsx +++ b/src/pages/Tower1Page.tsx @@ -3,6 +3,7 @@ import { useEffect, useState } from "react"; import ArrowLeftIcon from "../components/icons/ArrowLeftIcon"; import Button from "../components/Button"; import { Transition } from "react-transition-group"; +import Tower1FloorPlan from "../components/Tower1FloorPlan"; function Tower1Page() { const [width, setWidth] = useState(); @@ -40,6 +41,22 @@ function Tower1Page() { className={`absolute select-none pointer-events-none`} onLoad={() => setIsLoaded(true)} /> + + + console.log("floor", floor)} + onClick={() => navigate("select")} + /> +
diff --git a/src/pages/Tower1SelectPage.tsx b/src/pages/Tower1SelectPage.tsx index c71204d..d311bc0 100644 --- a/src/pages/Tower1SelectPage.tsx +++ b/src/pages/Tower1SelectPage.tsx @@ -142,28 +142,48 @@ function Tower1SelectPage() { xmlns="http://www.w3.org/2000/svg" className="absolute z-50 top-0 left-0 w-full h-full" > - {marks.map((mark) => { - switch (mark.type) { - case "lock": - return ( - - ); - case "apart": - return ( - navigate(mark.url!)} - /> - ); - - default: - break; - } - })} + navigate("1")} + onMouseEnter={() => setSelectedArea(1)} + onMouseLeave={() => setSelectedArea(null)} + /> + + + + + + + + + + +
+

+ 3-комнатные апартаменты +

+

+ Площадь + 116.8 м² +

+
+
+

Стоимость

+

+ {/* {(7500600).toLocaleString("ru")} руб. */}- руб. +

+
+
-
-
)} - + ); } diff --git a/src/pages/Tower2Page.tsx b/src/pages/Tower2Page.tsx index 77772b4..a267176 100644 --- a/src/pages/Tower2Page.tsx +++ b/src/pages/Tower2Page.tsx @@ -4,20 +4,7 @@ import { useEffect, useState } from "react"; import ArrowLeftIcon from "../components/icons/ArrowLeftIcon"; import Button from "../components/Button"; import { Transition } from "react-transition-group"; -import Floor28 from "../components/icons/marks/Tower2/Floor28"; -import Floor27 from "../components/icons/marks/Tower2/Floor27"; -import Floor26 from "../components/icons/marks/Tower2/Floor26"; - -// const marks: Mark[] = [ -// { -// id: "1", -// label: "Перейти к планировке", -// icon: "layout", -// x: 1000, -// y: 800, -// url: "/tower2/select", -// }, -// ]; +import Tower2FloorPlan from "../components/Tower2FloorPlan"; function Tower2Page() { const [width, setWidth] = useState(); @@ -64,9 +51,12 @@ function Tower2Page() { xmlns="http://www.w3.org/2000/svg" className="absolute z-50 top-0 left-0 w-full h-full" > - navigate("select")} /> - navigate("select")} /> - navigate("select")} /> + console.log("floor", floor)} + onClick={() => navigate("select")} + /> diff --git a/src/pages/Tower2SelectPage.tsx b/src/pages/Tower2SelectPage.tsx index f2d4714..1e3aaf5 100644 --- a/src/pages/Tower2SelectPage.tsx +++ b/src/pages/Tower2SelectPage.tsx @@ -4,7 +4,7 @@ import ArrowLeftIcon from "../components/icons/ArrowLeftIcon"; import Button from "../components/Button"; import { Transition } from "react-transition-group"; import MarkLockIcon from "../components/icons/marks/MarkLockIcon"; -import MarkApartArea1 from "../components/icons/marks/MarkApartArea1"; +import MarkApartArea2 from "../components/icons/marks/MarkApartArea2"; function Tower2SelectPage() { const [width, setWidth] = useState(0); @@ -38,97 +38,95 @@ function Tower2SelectPage() { } return ( -
-
+
+
+ + + + navigate("1")} + onMouseEnter={() => setSelectedArea(1)} + onMouseLeave={() => setSelectedArea(null)} + /> + + + + + + + + + + +
- - - - navigate("1")} - onMouseEnter={() => setSelectedArea(1)} - onMouseLeave={() => setSelectedArea(null)} - /> - - - - - - - - - - - -
-

- 2-комнатные апартаменты -

-

- Площадь - 80 м² +

+ 3-комнатные апартаменты +

+

+ Площадь + 116.8 м² +

+
+
+

Стоимость

+

+ {/* {(7500600).toLocaleString("ru")} руб. */}- руб.

-
-
-

Стоимость

-

- {(7500600).toLocaleString("ru")} руб. -

-
-
-
+
+
+
- - {(state) => ( -
- {/*

+ + {(state) => ( +
+ {/*

Загрузка...

*/} -
- )} -
-

+
+ )} +
); } diff --git a/src/pages/VirtualTour2Page.tsx b/src/pages/VirtualTour2Page.tsx index 102b9a9..4359aa2 100644 --- a/src/pages/VirtualTour2Page.tsx +++ b/src/pages/VirtualTour2Page.tsx @@ -21,14 +21,14 @@ import OuterDvorMap from "../components/maps/OuterDvorMap"; const images = _images as Image[]; function VirtualTour2Page() { - const [selectedImageId, setSelectedImageId] = useState(images[0].id); + const [selectedImageId, setSelectedImageId] = useState(images[0].id); const orbitRef = useRef(null); const fullscreenRef = useRef(null); const [isFullscreen, { toggleFullscreen }] = useFullscreen(fullscreenRef); const navigate = useNavigate(); - const [selectedPointId, setSelectedPointId] = useState(images[0].id); + const [selectedPointId, setSelectedPointId] = useState(selectedImageId); - function handleSelectImageId(toId: string) { + function handleSelectImageId(toId: string | number) { setSelectedImageId(toId); setSelectedPointId(toId); console.log(toId); diff --git a/src/pages/VirtualTour3Page.tsx b/src/pages/VirtualTour3Page.tsx index efbc2d7..5d6d9aa 100644 --- a/src/pages/VirtualTour3Page.tsx +++ b/src/pages/VirtualTour3Page.tsx @@ -1,6 +1,6 @@ import { Canvas } from "@react-three/fiber"; import { Html, OrbitControls } from "@react-three/drei"; -import { Suspense, useEffect, useRef, useState } from "react"; +import { Suspense, useRef, useState } from "react"; import { OrbitControls as OrbitControlsImpl } from "three-stdlib"; import { useFullscreen } from "ahooks"; import SphereTour from "../components/SphereTour"; @@ -14,32 +14,54 @@ import _images from "../images3.json"; import Image from "../types/Image"; import ElevatorIcon from "../components/icons/ElevatorIcon"; import Loader from "../components/Loader"; -import { useNavigate } from "react-router-dom"; +import { useLocation, useNavigate } from "react-router-dom"; import { isIOS } from "react-device-detect"; +import RHataMap from "../components/maps/RHataMap"; const images = _images as unknown as Image[]; function VirtualTour3Page() { - const [selectedImageId, setSelectedImageId] = useState(images[19].id); + const { search } = useLocation(); + const [selectedImageId, setSelectedImageId] = useState( + Number(new URLSearchParams(search).get("id")) || 9 + ); const orbitRef = useRef(null); const fullscreenRef = useRef(null); const [isFullscreen, { toggleFullscreen }] = useFullscreen(fullscreenRef); const navigate = useNavigate(); + const [selectedPointId, setSelectedPointId] = useState( + selectedImageId + ); - function handleSelectImageId(toId: string) { + function handleSelectImageId(toId: string | number) { setSelectedImageId(toId); + setSelectedPointId(toId); console.log(toId); } - useEffect(() => { - setTimeout(() => { - orbitRef.current?.setAzimuthalAngle(-0.7); - }, 200); - }, [orbitRef]); + // useEffect(() => { + // setTimeout(() => { + // orbitRef.current?.setAzimuthalAngle(-0.7); + // }, 200); + // }, [orbitRef]); return (
-
+
+
+

2-комнатные апартаменты

+
+ ({ + id: image.id, + mapPosition: image.mapPosition, + }))} + selectedPointId={selectedPointId} + onClick={(pointId) => handleSelectImageId(pointId)} + /> +
+
+
@@ -59,7 +100,7 @@ function VirtualTour4Page() {
)} - + }> diff --git a/src/pages/VirtualTourPage.tsx b/src/pages/VirtualTourPage.tsx index d67f39a..62fa926 100644 --- a/src/pages/VirtualTourPage.tsx +++ b/src/pages/VirtualTourPage.tsx @@ -21,14 +21,18 @@ import DvorMap from "../components/maps/DvorMap"; const images = _images as Image[]; function VirtualTourPage() { - const [selectedImageId, setSelectedImageId] = useState(images[0].id); + const [selectedImageId, setSelectedImageId] = useState( + images[0].id + ); const orbitRef = useRef(null); const fullscreenRef = useRef(null); const [isFullscreen, { toggleFullscreen }] = useFullscreen(fullscreenRef); const navigate = useNavigate(); - const [selectedPointId, setSelectedPointId] = useState(images[0].id); + const [selectedPointId, setSelectedPointId] = useState( + selectedImageId + ); - function handleSelectImageId(toId: string) { + function handleSelectImageId(toId: string | number) { setSelectedImageId(toId); setSelectedPointId(toId); console.log(toId); @@ -44,6 +48,7 @@ function VirtualTourPage() { points={images.map((image) => ({ id: image.id, mapPosition: image.mapPosition, + mapLabel: image.mapLabel, }))} selectedPointId={selectedPointId} onClick={(pointId) => handleSelectImageId(pointId)} diff --git a/src/types/Image.ts b/src/types/Image.ts index 20f5128..7c2484f 100644 --- a/src/types/Image.ts +++ b/src/types/Image.ts @@ -2,10 +2,11 @@ import { Vector3 } from "@react-three/fiber"; import Link from "./Link"; interface Image { - id: string; + id: string | number; src: string; position: Vector3; mapPosition: [number, number]; + mapLabel?: string; icon?: string; links?: Link[]; }