simplyrotate-js
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

simplyrotate-js

Package to rotate elements with js

Attribution to this post on stackoverflow for pointing out how to go about this. Figured that this is a feature that many people just need a one stop solution for (particularly myself included). So here this is for when I or anyone might need it later.

Usage:

HTML

<span class="rotatible"></span>

JavaScript

import { makeRotatable } from 'simplyrotate-js'

//get all elements classed rotatible
var rotatibleArr = document.querySelectorAll('.rotatible')
//for each of these called makeRotatable on them
rotatibleArr.forEach((r) => makeRotatable(r as HTMLElement))

and there you go...

It should just rotate on drag about the edges of your element

Package Sidebar

Install

npm i simplyrotate-js

Weekly Downloads

0

Version

1.0.2

License

GPL-3.0-or-later

Unpacked Size

51.5 kB

Total Files

8

Last publish

Collaborators

  • zaederx