kopia lustrzana https://github.com/bugout-dev/moonstream
kinda works with pictures
rodzic
7e2ffd8499
commit
b75634d00c
|
@ -780,7 +780,6 @@ const Homepage = () => {
|
||||||
</Flex>
|
</Flex>
|
||||||
<Button
|
<Button
|
||||||
placeSelf="center"
|
placeSelf="center"
|
||||||
isExternal
|
|
||||||
w={["100%", "100%", "fit-content", null]}
|
w={["100%", "100%", "fit-content", null]}
|
||||||
maxW={["250px", null, "fit-content"]}
|
maxW={["250px", null, "fit-content"]}
|
||||||
onClick={() => toggleModal({ type: MODAL_TYPES.SIGNUP })}
|
onClick={() => toggleModal({ type: MODAL_TYPES.SIGNUP })}
|
||||||
|
|
|
@ -26,8 +26,11 @@ const DragOnGrid = React.forwardRef((props, ref) => {
|
||||||
setPosition({ x: position.x + eData.deltaX, y: position.y + eData.deltaY });
|
setPosition({ x: position.x + eData.deltaX, y: position.y + eData.deltaY });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
console.log("position:", position);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Draggable
|
<Draggable
|
||||||
|
// offsetParent={}
|
||||||
nodeRef={ref}
|
nodeRef={ref}
|
||||||
axis="both"
|
axis="both"
|
||||||
handle=".handle"
|
handle=".handle"
|
||||||
|
@ -36,6 +39,7 @@ const DragOnGrid = React.forwardRef((props, ref) => {
|
||||||
scale={1}
|
scale={1}
|
||||||
onDrag={handleDrag}
|
onDrag={handleDrag}
|
||||||
>
|
>
|
||||||
|
{/* <div ref={ref}>Example Target</div> */}
|
||||||
{props.children}
|
{props.children}
|
||||||
</Draggable>
|
</Draggable>
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import React, { useRef } from "react";
|
import React, { useRef } from "react";
|
||||||
import { Box, Button, useBreakpointValue } from "@chakra-ui/react";
|
import { Box, useBreakpointValue, Image } from "@chakra-ui/react";
|
||||||
import DragOnGrid from "./DragOnGrid";
|
import DragOnGrid from "./DragOnGrid";
|
||||||
import Xarrow from "react-xarrows";
|
import Xarrow from "react-xarrows";
|
||||||
|
|
||||||
const SchematicPlayground = () => {
|
const SchematicPlayground = () => {
|
||||||
|
// create an instance of the engine with all the defaults
|
||||||
const gridCellSize = useBreakpointValue({
|
const gridCellSize = useBreakpointValue({
|
||||||
base: 24,
|
base: 24,
|
||||||
sm: 32,
|
sm: 32,
|
||||||
|
@ -17,11 +17,9 @@ const SchematicPlayground = () => {
|
||||||
const ref3 = useRef(null);
|
const ref3 = useRef(null);
|
||||||
const ref4 = useRef(null);
|
const ref4 = useRef(null);
|
||||||
const ref5 = useRef(null);
|
const ref5 = useRef(null);
|
||||||
const ref6 = useRef(null);
|
|
||||||
const ref7 = useRef(null);
|
|
||||||
const ref8 = useRef(null);
|
|
||||||
if (!gridCellSize) return "";
|
if (!gridCellSize) return "";
|
||||||
return (
|
return (
|
||||||
|
// <CanvasWidget engine={engine} />
|
||||||
<>
|
<>
|
||||||
<Box
|
<Box
|
||||||
h={`${(gridCellSize * 5 + 1).toString()}` + `px`}
|
h={`${(gridCellSize * 5 + 1).toString()}` + `px`}
|
||||||
|
@ -41,36 +39,50 @@ const SchematicPlayground = () => {
|
||||||
linear-gradient(to bottom, #dee3ea 1px, transparent 1px)`}
|
linear-gradient(to bottom, #dee3ea 1px, transparent 1px)`}
|
||||||
maxW={`${(gridCellSize * 11 + 1).toString()}` + `px`}
|
maxW={`${(gridCellSize * 11 + 1).toString()}` + `px`}
|
||||||
placeSelf="center"
|
placeSelf="center"
|
||||||
|
display="block"
|
||||||
>
|
>
|
||||||
<DragOnGrid
|
<DragOnGrid
|
||||||
ref={ref4}
|
ref={ref1}
|
||||||
gridStep={gridCellSize}
|
gridStep={gridCellSize}
|
||||||
defaultPosition={{ x: 5, y: 2 }}
|
defaultPosition={{ x: 5, y: 2 }}
|
||||||
>
|
>
|
||||||
<Button
|
<Box
|
||||||
m={0}
|
m={0}
|
||||||
|
ref={ref1}
|
||||||
p={0}
|
p={0}
|
||||||
borderRadius="sm"
|
borderRadius="sm"
|
||||||
ref={ref4}
|
|
||||||
className="handle"
|
className="handle"
|
||||||
minW={`${gridCellSize.toString}` + `px`}
|
minW={`${gridCellSize.toString}` + `px`}
|
||||||
|
minH={`${gridCellSize.toString}` + `px`}
|
||||||
fontSize={(gridCellSize / 4).toString() + `px`}
|
fontSize={(gridCellSize / 4).toString() + `px`}
|
||||||
boxSize={`${gridCellSize.toString()}` + "px"}
|
boxSize={`${gridCellSize.toString()}` + "px"}
|
||||||
borderStyle="inset"
|
bg="transparent"
|
||||||
bg="green.900"
|
|
||||||
color="white"
|
|
||||||
textAlign="center"
|
|
||||||
zIndex={10}
|
zIndex={10}
|
||||||
>
|
>
|
||||||
MSTR
|
<Image
|
||||||
</Button>
|
m={0}
|
||||||
|
ref={ref1}
|
||||||
|
p={0}
|
||||||
|
pointerEvents="none"
|
||||||
|
borderRadius="sm"
|
||||||
|
minW={`${gridCellSize.toString}` + `px`}
|
||||||
|
minH={`${gridCellSize.toString}` + `px`}
|
||||||
|
fontSize={(gridCellSize / 4).toString() + `px`}
|
||||||
|
boxSize={`${gridCellSize.toString()}` + "px"}
|
||||||
|
bg="blue.900"
|
||||||
|
color="white"
|
||||||
|
textAlign="center"
|
||||||
|
// zIndex={10}
|
||||||
|
src={`https://s3.amazonaws.com/static.simiotics.com/moonstream/assets/Logo.png`}
|
||||||
|
></Image>
|
||||||
|
</Box>
|
||||||
</DragOnGrid>
|
</DragOnGrid>
|
||||||
<DragOnGrid
|
<DragOnGrid
|
||||||
ref={ref2}
|
ref={ref2}
|
||||||
gridStep={gridCellSize}
|
gridStep={gridCellSize}
|
||||||
defaultPosition={{ x: 4, y: 0 }}
|
defaultPosition={{ x: 0, y: -1 }}
|
||||||
>
|
>
|
||||||
<Button
|
<Box
|
||||||
m={0}
|
m={0}
|
||||||
ref={ref2}
|
ref={ref2}
|
||||||
p={0}
|
p={0}
|
||||||
|
@ -80,161 +92,140 @@ const SchematicPlayground = () => {
|
||||||
minH={`${gridCellSize.toString}` + `px`}
|
minH={`${gridCellSize.toString}` + `px`}
|
||||||
fontSize={(gridCellSize / 4).toString() + `px`}
|
fontSize={(gridCellSize / 4).toString() + `px`}
|
||||||
boxSize={`${gridCellSize.toString()}` + "px"}
|
boxSize={`${gridCellSize.toString()}` + "px"}
|
||||||
bg="blue.900"
|
bg="transparent"
|
||||||
color="white"
|
|
||||||
textAlign="center"
|
|
||||||
zIndex={10}
|
zIndex={10}
|
||||||
|
bgColor="red.900"
|
||||||
>
|
>
|
||||||
DEX
|
<Image
|
||||||
</Button>
|
|
||||||
</DragOnGrid>
|
|
||||||
<DragOnGrid
|
|
||||||
ref={ref3}
|
|
||||||
gridStep={gridCellSize}
|
|
||||||
defaultPosition={{ x: 3, y: 4 }}
|
|
||||||
>
|
|
||||||
<Button
|
|
||||||
m={0}
|
m={0}
|
||||||
ref={ref3}
|
ref={ref2}
|
||||||
p={0}
|
p={0}
|
||||||
|
pointerEvents="none"
|
||||||
borderRadius="sm"
|
borderRadius="sm"
|
||||||
className="handle"
|
|
||||||
minW={`${gridCellSize.toString}` + `px`}
|
|
||||||
fontSize={(gridCellSize / 4).toString() + `px`}
|
|
||||||
boxSize={`${gridCellSize.toString()}` + "px"}
|
|
||||||
bg="orange.900"
|
|
||||||
color="white"
|
|
||||||
textAlign="center"
|
|
||||||
zIndex={10}
|
|
||||||
>
|
|
||||||
NFT
|
|
||||||
</Button>
|
|
||||||
</DragOnGrid>
|
|
||||||
<DragOnGrid
|
|
||||||
ref={ref1}
|
|
||||||
gridStep={gridCellSize}
|
|
||||||
defaultPosition={{ x: -2, y: 1 }}
|
|
||||||
>
|
|
||||||
<Button
|
|
||||||
m={0}
|
|
||||||
ref={ref1}
|
|
||||||
p={0}
|
|
||||||
borderRadius="sm"
|
|
||||||
className="handle"
|
|
||||||
minW={`${gridCellSize.toString}` + `px`}
|
minW={`${gridCellSize.toString}` + `px`}
|
||||||
|
minH={`${gridCellSize.toString}` + `px`}
|
||||||
fontSize={(gridCellSize / 4).toString() + `px`}
|
fontSize={(gridCellSize / 4).toString() + `px`}
|
||||||
boxSize={`${gridCellSize.toString()}` + "px"}
|
boxSize={`${gridCellSize.toString()}` + "px"}
|
||||||
bg="red.900"
|
bg="red.900"
|
||||||
color="white"
|
color="white"
|
||||||
textAlign="center"
|
textAlign="center"
|
||||||
zIndex={10}
|
// zIndex={10}
|
||||||
|
src={`https://s3.amazonaws.com/static.simiotics.com/moonstream/assets/NFT.png`}
|
||||||
|
></Image>
|
||||||
|
</Box>
|
||||||
|
</DragOnGrid>
|
||||||
|
<DragOnGrid
|
||||||
|
ref={ref3}
|
||||||
|
gridStep={gridCellSize}
|
||||||
|
defaultPosition={{ x: 8, y: -1 }}
|
||||||
>
|
>
|
||||||
ERC20
|
<Box
|
||||||
</Button>
|
m={0}
|
||||||
|
ref={ref3}
|
||||||
|
p={0}
|
||||||
|
borderRadius="sm"
|
||||||
|
className="handle"
|
||||||
|
minW={`${gridCellSize.toString}` + `px`}
|
||||||
|
minH={`${gridCellSize.toString}` + `px`}
|
||||||
|
fontSize={(gridCellSize / 4).toString() + `px`}
|
||||||
|
boxSize={`${gridCellSize.toString()}` + "px"}
|
||||||
|
bg="transparent"
|
||||||
|
zIndex={10}
|
||||||
|
bgColor="red.900"
|
||||||
|
>
|
||||||
|
<Image
|
||||||
|
m={0}
|
||||||
|
ref={ref3}
|
||||||
|
p={0}
|
||||||
|
pointerEvents="none"
|
||||||
|
borderRadius="sm"
|
||||||
|
minW={`${gridCellSize.toString}` + `px`}
|
||||||
|
minH={`${gridCellSize.toString}` + `px`}
|
||||||
|
fontSize={(gridCellSize / 4).toString() + `px`}
|
||||||
|
boxSize={`${gridCellSize.toString()}` + "px"}
|
||||||
|
bg="orange.900"
|
||||||
|
color="white"
|
||||||
|
textAlign="center"
|
||||||
|
// zIndex={10}
|
||||||
|
src={`https://s3.amazonaws.com/static.simiotics.com/moonstream/assets/DAO .png`}
|
||||||
|
></Image>
|
||||||
|
</Box>
|
||||||
</DragOnGrid>
|
</DragOnGrid>
|
||||||
<DragOnGrid
|
<DragOnGrid
|
||||||
ref={ref4}
|
ref={ref4}
|
||||||
gridStep={gridCellSize}
|
gridStep={gridCellSize}
|
||||||
defaultPosition={{ x: -3, y: 4 }}
|
defaultPosition={{ x: 3, y: -1 }}
|
||||||
>
|
>
|
||||||
<Button
|
<Box
|
||||||
|
m={0}
|
||||||
|
ref={ref4}
|
||||||
|
p={0}
|
||||||
|
borderRadius="sm"
|
||||||
|
className="handle"
|
||||||
|
minW={`${gridCellSize.toString}` + `px`}
|
||||||
|
minH={`${gridCellSize.toString}` + `px`}
|
||||||
|
fontSize={(gridCellSize / 4).toString() + `px`}
|
||||||
|
boxSize={`${gridCellSize.toString()}` + "px"}
|
||||||
|
bg="transparent"
|
||||||
|
zIndex={10}
|
||||||
|
bgColor="red.900"
|
||||||
|
>
|
||||||
|
<Image
|
||||||
|
m={0}
|
||||||
|
ref={ref4}
|
||||||
|
p={0}
|
||||||
|
pointerEvents="none"
|
||||||
|
borderRadius="sm"
|
||||||
|
minW={`${gridCellSize.toString}` + `px`}
|
||||||
|
minH={`${gridCellSize.toString}` + `px`}
|
||||||
|
fontSize={(gridCellSize / 4).toString() + `px`}
|
||||||
|
boxSize={`${gridCellSize.toString()}` + "px"}
|
||||||
|
bg="green.900"
|
||||||
|
color="white"
|
||||||
|
textAlign="center"
|
||||||
|
// zIndex={10}
|
||||||
|
src={`https://s3.amazonaws.com/static.simiotics.com/moonstream/assets/ERC 20.png`}
|
||||||
|
></Image>
|
||||||
|
</Box>
|
||||||
|
</DragOnGrid>
|
||||||
|
<DragOnGrid
|
||||||
|
ref={ref4}
|
||||||
|
gridStep={gridCellSize}
|
||||||
|
defaultPosition={{ x: 9, y: 0 }}
|
||||||
|
>
|
||||||
|
<Box
|
||||||
m={0}
|
m={0}
|
||||||
ref={ref5}
|
ref={ref5}
|
||||||
p={0}
|
p={0}
|
||||||
borderRadius="sm"
|
borderRadius="sm"
|
||||||
className="handle"
|
className="handle"
|
||||||
minW={`${gridCellSize.toString}` + `px`}
|
minW={`${gridCellSize.toString}` + `px`}
|
||||||
|
minH={`${gridCellSize.toString}` + `px`}
|
||||||
fontSize={(gridCellSize / 4).toString() + `px`}
|
fontSize={(gridCellSize / 4).toString() + `px`}
|
||||||
boxSize={`${gridCellSize.toString()}` + "px"}
|
boxSize={`${gridCellSize.toString()}` + "px"}
|
||||||
bg="red.900"
|
bg="transparent"
|
||||||
color="white"
|
|
||||||
textAlign="center"
|
|
||||||
zIndex={10}
|
zIndex={10}
|
||||||
|
bgColor="red.900"
|
||||||
>
|
>
|
||||||
EIP1155
|
<Image
|
||||||
</Button>
|
|
||||||
</DragOnGrid>
|
|
||||||
<DragOnGrid
|
|
||||||
ref={ref4}
|
|
||||||
gridStep={gridCellSize}
|
|
||||||
defaultPosition={{ x: 3, y: 3 }}
|
|
||||||
>
|
|
||||||
<Button
|
|
||||||
m={0}
|
m={0}
|
||||||
ref={ref6}
|
ref={ref5}
|
||||||
p={0}
|
p={0}
|
||||||
|
pointerEvents="none"
|
||||||
borderRadius="sm"
|
borderRadius="sm"
|
||||||
className="handle"
|
|
||||||
minW={`${gridCellSize.toString}` + `px`}
|
minW={`${gridCellSize.toString}` + `px`}
|
||||||
|
minH={`${gridCellSize.toString}` + `px`}
|
||||||
fontSize={(gridCellSize / 4).toString() + `px`}
|
fontSize={(gridCellSize / 4).toString() + `px`}
|
||||||
boxSize={`${gridCellSize.toString()}` + "px"}
|
boxSize={`${gridCellSize.toString()}` + "px"}
|
||||||
bg="blue.900"
|
bg="gray.900"
|
||||||
color="white"
|
color="white"
|
||||||
textAlign="center"
|
textAlign="center"
|
||||||
zIndex={10}
|
// zIndex={10}
|
||||||
>
|
src={`https://s3.amazonaws.com/static.simiotics.com/moonstream/assets/crypto+traders.png`}
|
||||||
ERC721
|
></Image>
|
||||||
</Button>
|
</Box>
|
||||||
</DragOnGrid>
|
|
||||||
<DragOnGrid
|
|
||||||
ref={ref4}
|
|
||||||
gridStep={gridCellSize}
|
|
||||||
defaultPosition={{ x: 4, y: 4 }}
|
|
||||||
>
|
|
||||||
<Button
|
|
||||||
m={0}
|
|
||||||
ref={ref7}
|
|
||||||
p={0}
|
|
||||||
borderRadius="sm"
|
|
||||||
className="handle"
|
|
||||||
minW={`${gridCellSize.toString}` + `px`}
|
|
||||||
fontSize={(gridCellSize / 4).toString() + `px`}
|
|
||||||
boxSize={`${gridCellSize.toString()}` + "px"}
|
|
||||||
bg="green.900"
|
|
||||||
color="white"
|
|
||||||
textAlign="center"
|
|
||||||
zIndex={10}
|
|
||||||
>
|
|
||||||
DAO
|
|
||||||
</Button>
|
|
||||||
</DragOnGrid>
|
|
||||||
<DragOnGrid
|
|
||||||
ref={ref4}
|
|
||||||
gridStep={gridCellSize}
|
|
||||||
defaultPosition={{ x: 2, y: 0 }}
|
|
||||||
>
|
|
||||||
<Button
|
|
||||||
m={0}
|
|
||||||
ref={ref8}
|
|
||||||
p={0}
|
|
||||||
borderRadius="sm"
|
|
||||||
className="handle"
|
|
||||||
minW={`${gridCellSize.toString}` + `px`}
|
|
||||||
fontSize={(gridCellSize / 4).toString() + `px`}
|
|
||||||
boxSize={`${gridCellSize.toString()}` + "px"}
|
|
||||||
bg="orange.900"
|
|
||||||
color="white"
|
|
||||||
textAlign="center"
|
|
||||||
zIndex={10}
|
|
||||||
>
|
|
||||||
Oracle
|
|
||||||
</Button>
|
|
||||||
</DragOnGrid>
|
</DragOnGrid>
|
||||||
</Box>
|
</Box>
|
||||||
<Xarrow
|
|
||||||
dashness={{
|
|
||||||
strokeLen: 10,
|
|
||||||
nonStrokeLen: 15,
|
|
||||||
animation: 1 * 1,
|
|
||||||
}}
|
|
||||||
color="#920050"
|
|
||||||
path="grid"
|
|
||||||
gridBreak={(gridCellSize * 0.5).toString() + "px"}
|
|
||||||
// startAnchor={"top"}
|
|
||||||
showHead={false}
|
|
||||||
start={ref3} //can be react ref
|
|
||||||
end={ref4} //or an id
|
|
||||||
/>
|
|
||||||
<Xarrow
|
<Xarrow
|
||||||
dashness={{
|
dashness={{
|
||||||
strokeLen: 10,
|
strokeLen: 10,
|
||||||
|
@ -245,8 +236,21 @@ const SchematicPlayground = () => {
|
||||||
path="grid"
|
path="grid"
|
||||||
gridBreak={(gridCellSize * 0.5).toString() + "px"}
|
gridBreak={(gridCellSize * 0.5).toString() + "px"}
|
||||||
showHead={false}
|
showHead={false}
|
||||||
start={ref2} //can be react ref
|
start={ref1} //can be react ref
|
||||||
end={ref4} //or an id
|
end={ref2} //or an id
|
||||||
|
/>
|
||||||
|
<Xarrow
|
||||||
|
dashness={{
|
||||||
|
strokeLen: 10,
|
||||||
|
nonStrokeLen: 15,
|
||||||
|
animation: 1 * 1,
|
||||||
|
}}
|
||||||
|
color="#92D0F0"
|
||||||
|
gridBreak={(gridCellSize * 0.5).toString() + "px"}
|
||||||
|
path="grid"
|
||||||
|
showHead={false}
|
||||||
|
start={ref1} //can be react ref
|
||||||
|
end={ref3} //or an id
|
||||||
/>
|
/>
|
||||||
<Xarrow
|
<Xarrow
|
||||||
dashness={{
|
dashness={{
|
||||||
|
@ -273,48 +277,8 @@ const SchematicPlayground = () => {
|
||||||
path="grid"
|
path="grid"
|
||||||
// startAnchor={"top"}
|
// startAnchor={"top"}
|
||||||
showHead={false}
|
showHead={false}
|
||||||
start={ref5} //can be react ref
|
start={ref1} //can be react ref
|
||||||
end={ref4} //or an id
|
end={ref5} //or an id
|
||||||
/>
|
|
||||||
<Xarrow
|
|
||||||
dashness={{
|
|
||||||
strokeLen: 10,
|
|
||||||
nonStrokeLen: 15,
|
|
||||||
animation: 1 * 1,
|
|
||||||
}}
|
|
||||||
color="#92D0F0"
|
|
||||||
gridBreak={(gridCellSize * 0.5).toString() + "px"}
|
|
||||||
path="grid"
|
|
||||||
// startAnchor={"top"}
|
|
||||||
showHead={false}
|
|
||||||
start={ref6} //can be react ref
|
|
||||||
end={ref4} //or an id
|
|
||||||
/>
|
|
||||||
<Xarrow
|
|
||||||
dashness={{
|
|
||||||
strokeLen: 10,
|
|
||||||
nonStrokeLen: 15,
|
|
||||||
animation: 1 * 1,
|
|
||||||
}}
|
|
||||||
color="#92D0F0"
|
|
||||||
gridBreak={(gridCellSize * 0.5).toString() + "px"}
|
|
||||||
path="grid"
|
|
||||||
showHead={false}
|
|
||||||
start={ref7} //can be react ref
|
|
||||||
end={ref4} //or an id
|
|
||||||
/>
|
|
||||||
<Xarrow
|
|
||||||
dashness={{
|
|
||||||
strokeLen: 10,
|
|
||||||
nonStrokeLen: 15,
|
|
||||||
animation: 1 * 1,
|
|
||||||
}}
|
|
||||||
color="#92D0F0"
|
|
||||||
gridBreak={(gridCellSize * 0.5).toString() + "px"}
|
|
||||||
path="grid"
|
|
||||||
showHead={false}
|
|
||||||
start={ref8} //can be react ref
|
|
||||||
end={ref4} //or an id
|
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
Ładowanie…
Reference in New Issue