-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
32 lines (26 loc) · 718 Bytes
/
index.js
File metadata and controls
32 lines (26 loc) · 718 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
const move = new Moveable(document.body, {
target: document.querySelector(".root"),
draggable: false,
scalable: true,
resizable: false,
keepRatio: false,
rotatable: false,
warpable:false,
});
move.on("drag", ({ target, transform }) => {
target.style.transform = transform;
});
move.on("resize", ({ target, width, height }) => {
target.style.width = width + "px";
target.style.height = height + "px";
});
move.on("scale", ({ target, transform }) => {
target.style.transform = transform;
console.log(target)
});
move.on("rotate", ({ target, transform }) => {
target.style.transform = transform;
});
move.on("warp", ({ target, transform, }) => {
target.style.transform = transform;
});