Rotate

Allows you to rotate an element.

Usage

new rotate(rotateOptions)

Basic implementation

const circle = new rotate({ element: '.circle1' });

rotateOptions

element

Type:

type element = string

The element selector.

snapAngle

Type:

type snapAngle = number

default: 1

The angle that the rotation snaps to.

onRotation

Type:

type onRotation = (angle) => {}

Executes when the element rotates.

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);