diff --git a/frontend/src/views/dashboard/canvas/CanvasShape.vue b/frontend/src/views/dashboard/canvas/CanvasShape.vue new file mode 100644 index 00000000..9ae68ac2 --- /dev/null +++ b/frontend/src/views/dashboard/canvas/CanvasShape.vue @@ -0,0 +1,126 @@ + + + + + \ No newline at end of file diff --git a/frontend/src/views/dashboard/css/CanvasStyle.less b/frontend/src/views/dashboard/css/CanvasStyle.less new file mode 100644 index 00000000..c062b541 --- /dev/null +++ b/frontend/src/views/dashboard/css/CanvasStyle.less @@ -0,0 +1,97 @@ +.dragAndResize +{ + position: relative; + user-select: none; + * + { + box-sizing: border-box; + margin: 0; + padding: 0; + } + .item + { + position: absolute; + width: 100px; + height: 100px; + cursor: move; + border: 1px solid #59c7f9; + background-color: #fff; + .resizeHandle + { + position: absolute; + background: #fff; + border: 1px solid #59c7f9; + width: 8px; + height: 8px; + border-radius: 50%; + z-index: 0; + } + } + .moveAnimation + { + transition: top 80ms ease; + } + .canNotDrag + { + cursor: default!important; + } + + .cloneNode + { + z-index: 3; + + transition: none; + + opacity: .5; + } + + .movingItem + { + position: absolute; + + border: none; + &:before + { + position: absolute; + z-index: 2; + top: 0; + left: 0; + width: 100%; + height: 100%; + content: ''; + background-color: #b8d3f9; + } + .resizeHandle + { + display: none; + } + } + + .positionBox + { + position: fixed; + top: 0; + right: 100px; + + overflow: auto; + + width: 500px; + height: 500px; + + border: 1px solid; + } + + .coords + { + position: fixed; + right: 100px; + bottom: 200px; + + overflow: auto; + + width: 200px; + height: 200px; + + border: 1px solid; + } +} diff --git a/frontend/src/views/dashboard/utils/CanvasUtils.ts b/frontend/src/views/dashboard/utils/CanvasUtils.ts new file mode 100644 index 00000000..8db686e4 --- /dev/null +++ b/frontend/src/views/dashboard/utils/CanvasUtils.ts @@ -0,0 +1,26 @@ +export interface CanvasItem { + _dragId: string | number + x: number + y: number + sizeX: number + sizeY: number + [key: string]: any +} + + +export type CanvasCoord = { + x1: number + y1: number + x2: number + y2: number + c1: number + c2: number + el: { + x: number + y: number + sizeX: number + sizeY: number + _dragId: string | number + [key: string]: any + } +} \ No newline at end of file