Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
frame-animation
Advanced tools
通常我们会遇到一些需求,用js实现一组动画(这里指的是由一帧帧图片组合而成的动画,非jq的animate)。
其实原理很简单,如果是多张图,就定时去改变image的src,如果是一张图,就定时改变backgroud-position;同时,我们还要支持图片预加载,动画执行次数(一次,n次,无限次),动画暂停,动画执行完成的回调等等。
有了上述需求,我觉得写一个通用的animation库还是很有必要的,这样用户就每必要为每一组动画写逻辑了,从繁琐的劳动中解放,不正是每个coder所期望的么:)
废话不多说,我们先看一下animation接口的调用demo,支持链式调用。
var animation = require("animation");
var demoAnimation = animation().changePosition(ele, positions).repeat();
demoAnimation.start(200);
这种链式调用的语法,是不是很爽呢(妈妈再也不用担心我的动画)
animation的源码是基于webpack构建的
首先,clone项目源码
git clone https://github.com/ustbhuangyi/animation.git
安装依赖
cd animation
npm install
测试demo页
npm run dev
打开浏览器访问如下地址, 查看效果
localhost:9090
FAQs
a common animation lib
The npm package frame-animation receives a total of 1 weekly downloads. As such, frame-animation popularity was classified as not popular.
We found that frame-animation 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
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.