Rotate
Allows you to rotate an element.
new rotate(rotateOptions)
Basic implementation
Section titled “Basic implementation”const circle = new rotate({ element: '.circle1' });
rotateOptions
Section titled “rotateOptions”element
Section titled “element”Type:
type element = string
The element selector.
snapAngle
Section titled “snapAngle”Type:
type snapAngle = number
default: 1
The angle that the rotation snaps to.
onRotation
Section titled “onRotation”Type:
type onRotation = (angle) => {}
Executes when the element rotates.
Actions
Section titled “Actions”You are able to rotate elements using actions. Since every rotate action is unique you can do the following:
const element = new rotate({ element: '.circle1' });
actions.execute(element.actionName, angle);