Coder Social home page Coder Social logo

juanfran / freezeframe.js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ctrl-freaks/freezeframe.js

0.0 2.0 0.0 22.47 MB

freezeframe.js is a library that pauses animated .gifs and enables them to animate on mouse hover / mouse click / touch event, or with trigger / release functions.

Home Page: http://ctrl-freaks.github.io/freezeframe.js/

License: MIT License

CSS 0.83% JavaScript 22.04% HTML 6.71% Vue 9.01% Shell 0.59% TypeScript 41.98% SCSS 10.21% EJS 8.64%

freezeframe.js's Introduction

Freezeframe.js

npm version Coverage Status Size License: MIT

Freezeframe.js is a library that pauses animated .gifs and enables them to animate on mouse hover / mouse click / touch event, or triggered manually.

http://ctrl-freaks.github.io/freezeframe.js/

v5 - TypeScript

Freezeframe is now written in / supports TypeScript! The library will still support usage in JavaScript, but if your project uses TypeScript, you'll have access to Freezeframe's type definitions, improved input validation, and depending on your IDE/text editor, autocompletion/intellisense.

To get started using freezeframe 5:

npm install freezeframe
npm install vue-freezeframe
npm install react-freezeframe
npm install angular-freezeframe

Version 5+ is built with modern development in mind. It's transpiled from TypeScript to JavaScript, and it should work in all modern browsers, but we are no longer supporting older browsers, or the jquery plugin.

If you need to support older browsers (and don't need TypeScript), try v4.x:

npm install [email protected]

If you want to use freezeframe as a jquery plugin, check out freezeframe v3.0.10.

Packages / Documentation

This is a lerna.js monorepo, containing the following packages, each with their own docs:

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.

Unfortunately, browser security prevents reading the actual data of the image if it is hosted on a different domain, which prevents us from being able to truly "pause" the gif on the true current frame. Supporting gifs on other domains is a requirement for this project, so the only frame you can pause on is the first frame.

Contributing

  • Fork or clone the repository
  • Install lerna globally (optional)
npm install -g lerna
  • Install the monorepo dependencies
npm install
  • Install the sub-package dependencies
npm run bootstrap
  • Run tests for all sub-packages
npm test
  • Run build for all sub-packages
npm run build

Then, submit your PR for review.

License

freezeframe.js is released under the terms of the MIT License.

Thanks

freezeframe.js's People

Contributors

nickforddev avatar chrisantonellis avatar dependabot[bot] avatar pweigand avatar mritterhoff avatar dohnutt avatar shedali avatar kgaut avatar mitsunee avatar vsaarinen avatar codemilli avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.