mobile mode

This commit is contained in:
ari committed 2022-05-16 21:50:05 -04:00
1 parent b342088b96
commit f50f22190e
4 files changed
+110 -15

No files matched your search

@@ -0,0 +1,69 @@
/* none-hidden */
.automation-list--root.mobile {
flex-direction: column;
}
.automation-list--root.mobile>.automation-list--list {
max-width: 100vw;
min-height: 100vh;
}
.automation-list--root.mobile .automation-editor {
flex-direction: column;
}
.automation-list--root.mobile .automation-list--list-hide {
transform: rotate(90deg);
left: 1.25em;
}
.automation-list--root.mobile .automation-editor--info-box {
min-width: 100vw;
min-height: 100vh;
max-width: 100vw;
max-height: 100vh;
padding: 0;
}
.automation-list--root.mobile .automation-editor--info-box-inner {
margin-top: 1.75em;
padding: 0.5em;
direction: rtl;
}
.automation-list--root.mobile .automation-editor--info-box--icon {
left: 1.25em;
bottom: 1em;
background-color: var(--primary);
transform: rotate(90deg);
}
/* list hide */
.automation-list--root.mobile .automation-list--list.hide {
width: 100vw;
min-height: 0;
max-height: 0;
}
.automation-list--root.mobile .automation-list--list.hide .automation-list--list-hide {
transform: rotate(270deg);
position: fixed;
top: 0.75em;
z-index: 20;
}
/* info box hide */
.automation-list--root.mobile .automation-editor--info-box.hide {
width: 100vw;
min-height: 0;
max-height: 0;
}
.automation-list--root.mobile .automation-editor--info-box.hide .automation-editor--info-box--icon {
transform: rotate(270deg);
position: fixed;
top: 0.75em;
background-color: var(--green-opaque);
z-index: 30;
}
+10 -3
View File
@@ -1,4 +1,5 @@
import "./index.css";
import "./index.mobile.css";
import { AutomationEditor } from "components/AutomationEditor";
import { FC, useState } from "react";
import { AutomationData } from "types/automations";
@@ -8,6 +9,7 @@ import { ButtonIcon } from "components/Icons/ButtonIcons";
import { ApiService } from "apiService/core";
import { AutomationListBox } from "./AutomationListBox";
import { DAGAutomationFlowDims } from 'components/DAGFlow/types';
import useWindowSize from "utils/useWindowSize";
interface AutomationListParams {
@@ -29,12 +31,17 @@ export const AutomationList: FC<AutomationListParams> = ({
// state
const [hideList, setHideList] = useState(false);
const [current, setCurrent] = useState(0);
const { isMobile } = useWindowSize();
// alias
const currentAuto = automations.length > 0 ? automations[current] : null;
const automationListListCls = "automation-list--list" + (hideList ? " hide" : " show")
const automationListListCls = [
"automation-list--list",
hideList ? "hide" : "show",
isMobile ? 'mobile' : ''
].join(' ')
// render
return <div className="automation-list--root">
<div className={automationListListCls}>
return <div className={["automation-list--root", isMobile ? 'mobile' : ''].join(' ')}>
<div className={["automation-list--list", hideList ? "hide" : "show"].join(' ')}>
<AutomationListBox
automations={automations}
onAdd={() => {
+15
View File
@@ -0,0 +1,15 @@
import { FC } from "react";
import useWindowSize from "utils/useWindowSize";
export const SizeModal: FC = () => {
const size = useWindowSize();
return <span style={{
position: 'absolute',
top: 0,
left: 0,
background: 'white',
zIndex: 10,
}}>{size.width}/{size.height}={size.ratioWbh} ({size.isMobile ? 'm' : 'd'})</span>
}