0.0.3 • Published 5 months ago

element-rotator v0.0.3

Weekly downloads
-
License
-
Repository
-
Last release
5 months ago

element-rotator

元素旋转

安装

npm install element-rotator

yarn add element-rotator

使用

import ElementRotator from "element-rotator";
import type { IOptions } from 'element-rotator';

const container = document.querySelector("#container");

const options = {
  top: "-50px", // 旋转点偏移位置
  rotate: 45, // 初始旋转角度
  // able: document.querySelector("#target"), // 自定义旋转点
};
const elementRotatorIns = new ElementRotator(container, options as IOptions);

API options

参数说明类型
top旋转点偏移位置number | string
rotate初始旋转角度number
able自定义旋转点Element
0.0.3

5 months ago

0.0.2

5 months ago

0.0.1

5 months ago