Squish those Lottie files
npm install lottie-minibash
npm install -g lottie-mini
`
使用方法
$3
1. 提取图片资源
`bash
lottie extract
`
2. 压缩动画
`bash
lottie compress
`
$3
启动后可以通过浏览器访问 http://localhost:3000 使用 Web 界面。
`bash
lottie server
`
#### Web 界面功能
- 文件上传:支持上传 Lottie JSON 文件
- 在线压缩:自动压缩动画中的图片资源
- 动画预览:支持预览上传的动画文件
- 播放控制:支持动画的播放/暂停
技术栈
- Node.js
- Express.js (Web 服务器)
- Commander.js (命令行工具)
- Sharp (图片压缩处理)
- Multer (文件上传处理)
- Lottie Web (动画渲染)
Docker 部署
$3
`bash
docker build -t lottie-mini .
`
$3
`bash
docker run -d -p 3000:3000 --name lottie-mini lottie-mini
`
访问 http://localhost:3000 即可使用 Web 界面。
$3
`bash
docker stop lottie-mini
`
$3
`bash
docker rm lottie-mini
``