diff --git a/src/components/complexPage/SequenceSlider.tsx b/src/components/complexPage/SequenceSlider.tsx
index 9ccc323..d7c712e 100644
--- a/src/components/complexPage/SequenceSlider.tsx
+++ b/src/components/complexPage/SequenceSlider.tsx
@@ -10,6 +10,7 @@ import LeftArrowSliderIcon from "../icons/LeftArrowSliderIcon";
import RightArrowSliderIcon from "../icons/RightArrowSliderIcon";
import useCompass from "../../store/useCompass";
import SequenceHighlighting from "./SequenceHighlighting";
+import { laptopWidth, mobileWidht } from "../../consts/masterplan";
const arrayLength = 360;
const keyframes: number[] = [51, 178, 249, 339];
@@ -26,6 +27,7 @@ function SequenceSlider({ path }: SequenceSliderProps) {
const [isAnimate, setIsAnimate] = useState
(false);
const [loadedImages, setLoadedImages] = useState(0);
const [keyframeIndex, setKeyframeIndex] = useState(3);
+ const [left, setLeft] = useState(0);
const { setCurrentCompassRotate, currentCompassRotate } = useCompass();
const [width, setWidth] = useState();
const [top, setTop] = useState();
@@ -128,8 +130,26 @@ function SequenceSlider({ path }: SequenceSliderProps) {
}
function handleResize() {
- setWidth(window.innerWidth);
- setTop(window.innerWidth / 2 - window.innerHeight / 2);
+ const screenWidth = window.innerWidth;
+ const screenHeight = window.innerHeight;
+ if (screenWidth > laptopWidth) {
+ setWidth(screenWidth);
+ setTop(screenWidth / 2 - screenHeight / 2);
+ setLeft(0);
+ } else {
+ if (screenWidth > mobileWidht) {
+ const _top = screenHeight / 4;
+ setTop(_top);
+ } else {
+ const _top = screenHeight / 2.5;
+ setTop(_top);
+ }
+ const _left = laptopWidth - screenWidth;
+ const _width = screenWidth + _left * 2;
+
+ setWidth(_width);
+ setLeft(_left);
+ }
}
useEffect(() => {
@@ -149,7 +169,12 @@ function SequenceSlider({ path }: SequenceSliderProps) {
>
{
const [width, setWidth] = useState
(0);
const [top, setTop] = useState(0);
+ const [left, setLeft] = useState(0);
const leftWingRef = useRef(null);
const { isSidebar, setIsSidebar } = useWingSidebar();
const [mousePos, setMousePos] = useState<[number, number]>([0, 0]);
@@ -77,10 +30,29 @@ const SequenceWing = () => {
const [isWrapperHovered, setIsWrapperHovered] = useState(false);
const [isSkygardenSidebar, setIsSkygardenSidebar] = useState(false);
const [isFloorSidebar, setIsFloorSidebar] = useState(false);
+ const { setModal } = useModal();
function handleResize() {
- setWidth(window.innerWidth);
- setTop(window.innerWidth / 2 - window.innerHeight / 2);
+ const screenWidth = window.innerWidth;
+ const screenHeight = window.innerHeight;
+ if (screenWidth > laptopWidth) {
+ setWidth(screenWidth);
+ setTop(screenWidth / 2 - screenHeight / 2);
+ setLeft(0);
+ } else {
+ if (screenWidth > mobileWidht) {
+ const _top = screenHeight / 4;
+ setTop(_top);
+ } else {
+ const _top = screenHeight / 2.5;
+ setTop(_top);
+ }
+ const _left = laptopWidth - screenWidth;
+ const _width = screenWidth + _left * 2;
+
+ setWidth(_width);
+ setLeft(_left);
+ }
}
const handleOnFloorMouseEnter = (
@@ -107,16 +79,26 @@ const SequenceWing = () => {
const handleOnFloorClick = () => {
if (!currentHoveredFloor) return;
+ const screenWidth = window.innerWidth;
setCurrentFloor(currentHoveredFloor);
- setIsFloorSidebar(true);
- setIsSkygardenSidebar(false);
- setIsSidebar(true);
+ if (screenWidth < laptopWidth) {
+ setModal();
+ } else {
+ setIsFloorSidebar(true);
+ setIsSkygardenSidebar(false);
+ setIsSidebar(true);
+ }
};
const handleOnSkygardenClick = () => {
- setIsSkygardenSidebar(true);
- setIsFloorSidebar(false);
- setIsSidebar(true);
+ const screenWidth = window.innerWidth;
+ if (screenWidth < laptopWidth) {
+ setModal();
+ } else {
+ setIsSkygardenSidebar(true);
+ setIsFloorSidebar(false);
+ setIsSidebar(true);
+ }
};
function handleMouseMove(e: MouseEvent) {
@@ -171,11 +153,13 @@ const SequenceWing = () => {
width: `${width}px`,
height: `${width}px`,
top: `-${top}px`,
- left: `${isSkygardenSidebar || isFloorSidebar ? "-25%" : "0"}`,
+ left: `${
+ isSkygardenSidebar || isFloorSidebar ? "-25%" : `-${left}px`
+ }`,
}}
>
{
{
return (