Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
3d-rotater-y
Advanced tools
$ npm i 3d-rotater-y --save
requestAnimationFrame
import rotateCtrl from "3d-rotater-y";
/**
* RotateControl(targetDom, targetRadius);
* targetDom 需要控制的元素
* targetRadius 目标元素的半径(宽度的一半,影响手指或鼠标滑动元素时的敏感度),默认200px
returns {
rad:Number, //弧度值
onTouch:Boolean, //是否正在操作被控目标
}
*/
let targetDom = document.querySelector("#badge_stage");
let rotateCtrl = new RotateControl(targetDom);
let isTouching = false;
// 添加监听事件,目前只有一个`update`事件可供监听,并在回调内更新「徽章badgeMesh.rotation.y」
rotateCtrl.on(
"update",
({ rad, onTouch, positiveRad, speed, startRad, endRad }) => {
isTouching = onTouch;
badgeMesh && (badgeMesh.rotation.y = rad);
}
);
// 开始监听旋转控制返回的数据
rotateCtrl.listen();
/**
* rotateCtrl.reset(duration, resetRad);
* duration 过渡时间ms,默认500
* resetRad 制定重置的角度,默认0
*/
// 比如想在1000ms里,从PI开始重置到0,可以这么用!
rotateCtrl.reset(0, PI);
rotateCtrl.reset(1000, 0);
freezePage
函数:手指/鼠标控制目标元素转动时,禁止页面 scrollYplayAmt
函数:第一个版本,能够实现小摆动,但是停住的时机不够精准;FAQs
Resolve like 3D badge rotation controls.
The npm package 3d-rotater-y receives a total of 1 weekly downloads. As such, 3d-rotater-y popularity was classified as not popular.
We found that 3d-rotater-y demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.