@ampproject/animations

中文文档
0.2.2发布于 2020/01/16Apache-2.0ESM + CJS零依赖近 30 天下载 1890

JavaScript animation functions and helpers.

原始使用文档
文档目录7 节
  1. Links
  2. Image Transform
  3. Animation Test Helpers
  4. Developing
  5. Build
  6. Test
  7. Demos

Animations

Some JavaScript animation helpers.

Image Transform

Transforms an image from one position/size to another. In addition to scaling up, this also supports changing the 'crop' of the image as defined by the object-fit CSS property.

Animation Test Helpers

Helps with writing tests for animations by pausing then and allowing control of the progress of animations on the page. You can pause an animation part way through and do a screenshot based test or simply validate the position or dimensions of elements.

Developing

Build

npm run build
npm run build-watch

Test

npm run test
npm run test-watch

Demos

To build, serve, and open a browser tab with the demos:

npm run demo

版本与发布记录

@ampproject/animations 共发布 8 个版本,首次发布于 2018/11/02;过去 12 个月发布了 0 个版本。

版本发布日期距今
0.2.2latest2020/01/166 年前
0.2.12019/12/066 年前
0.2.02019/05/107 年前
0.1.22019/02/217 年前
0.1.12018/12/207 年前
0.1.02018/12/017 年前

关于 @ampproject/animations 的常见问题

@ampproject/animations 是什么?

JavaScript animation functions and helpers.

如何安装 @ampproject/animations?

在项目目录运行 npm install @ampproject/animations,或使用 pnpm add / yarn add / bun add。

@ampproject/animations 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/ampproject__animations 是否存在。

@ampproject/animations 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@ampproject/animations 可以商用吗?

@ampproject/animations 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@ampproject/animations 的下载量有多少?

根据 npm 官方下载统计,@ampproject/animations 在 2026/10/06 – 2026/11/04 这 30 天内被下载 1,890 次,日均约 63 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@ampproject/animations 还在维护吗?

最新版本 0.2.2 发布于 2020/01/16(6 年前);至今共发布 8 个版本,其中过去 12 个月发布了 0 个;首次发布于 2018/11/02。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。