0.0.1-security • Published 2 years ago

doper v0.0.1-security

Weekly downloads
1
License
-
Repository
-
Last release
2 years ago

Dom Wrapper

What is this tool for ?

With this tool, you can manipulate the position/rotation/scale of dom element with a much easy way. Including:

  • x
  • y
  • width
  • height
  • scale
  • scaleX
  • scaleY
  • rotation
  • pivot
  • top
  • bottom
  • left
  • right
  • minAnchor
  • maxAnchor
  • parent
  • html
  • css

and many more...

All the attributes are behave separately, and auto refreshs the dom correspondingly while you assigning them. Much like a UGUI way to control your dom elements. Works perfectly with other animation libraries (e.g. tween)

Examples

let node = doper('<div>Hello World!</div>', '.container');

node.parent.style.position = 'relative';
node.style.backgroundColor = '#789';

// 居中
node.minAnchorX = 0.5;
node.maxAnchorX = 0.5;
node.minAnchorY = 0.5;
node.maxAnchorY = 0.5;

function update() {
	node.rotation++;
	node.y = Math.sin(node.rotation * 0.05) * 100;
	requestAnimationFrame(update);
}

update();

Result:

https://i.imgur.com/JxPoBs1.gif

0.0.1-security

2 years ago

0.1.10

5 years ago

0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago