Freezeframe.js is a library that pauses animated .gifs and enables them to animate on mouse hover / mouse click / touch event, or triggered manually.
If you want to use freezeframe as a jquery plugin, check out freezeframe v3.0.10.
This is a lerna.js monorepo, containing the following packages:
To get started with freezeframe, head over to the core freezeframe package.
To use freezeframe with Vue.js, check out the vue-freezeframe docs.
React users should give react-freezeframe a try.
How it works
For the curious, we are able to pause animated gifs by writing their data to a canvas element. Only the first frame of the animation can be written to the canvas, so we now have a frozen version of the gif.
- Fork or clone the repository.
- Install lerna globally (optional)
npm install -g lerna
- Install the monorepo dependencies
- Install the sub-package dependencies
npm run bootstrap
- Run tests for all sub-packages
- Run build for all sub-packages
npm run build
- If you are part of the ctrl-freaks organization, you can publish directly to npm:
Otherwise, submit your PR for review.
freezeframe.js is released under the terms of the MIT License.