canvas-confetti

🎉 performant confetti animation in the browser

ISC License

Downloads
2.2M
Stars
8.9K
Committers
18

Bot releases are hidden (Show)

canvas-confetti -

Published by catdad almost 5 years ago

This release only contains updates to the package.json file and internal optimizations. There is no functional difference.

https://github.com/catdad/canvas-confetti/compare/1.0.2...1.0.3

canvas-confetti -

Published by catdad almost 5 years ago

  • Fixed an issue that could cause the main thread to freeze for some time after a lot of individual confetti have been fired using a worker (like for example the snow demo) - see #100
canvas-confetti -

Published by catdad almost 5 years ago

  • Fixed a bug that was causing jsDelivr obfuscation to break the code - see #94
canvas-confetti -

Published by catdad almost 5 years ago

🎉🎉 The module is now at 1.0.0! 🎉🎉

  • Whenever possible, confetti will use a web worker for rendering animation so that it is not doing heavy work on the main thread, and also to allow you to do heavy blocking work without affecting the animation. The default confetti() method will use workers for rendering by default whenever possible, and fall back to main thread rendering when it is not supported. If you are creating a custom canvas or would like to turn this off because you enjoy blocking the main thread, see the new useWorker option on confetti.create() - see #83
  • Fixes a bug that caused animation to speed up on high refresh rate monitors - see #90
  • [Internal] Prefixed versions of requestAnimationFrame will no longer be used. There is a fallback that will be used on all browsers that do not support the official requestAnimationFrame. This should not affect usage of the module's API, though it may change some characteristics about the animation on older browsers - see #86
canvas-confetti - 0.5.0

Published by catdad almost 5 years ago

  • [BREAKING] confetti.Promise is no longer set by default (i.e. if you try to read this value, it will now be undefined). This property was never documented, and it has now been removed from the implementation.

Note: you can still set confetti.Promise = MyPromiseLib to use your custom promises or to polyfill promises without setting window.Promise.

  • Server-side rendering is now supported. You can safely use this module in a build that performs server-side rendering.

Note: if you want to trigger confetti() inside your render path (i.e. in the render() method of a class component or directly inside a function component), you will still need to check that you are on the client, as launching confetti is not supported on the server (for obvious reasons). Include a check such as this:

function MyComponent(props) {
  // launch some confetti when the component renders
  if (typeof window !== 'undefined') {
    confetti();
  }

  return <div>Some page content</div>;
}
class MyComponent extends React.Component {
  render() {
    // launch some confetti when the component renders
    if (typeof window !== 'undefined') {
      confetti();
    }

    return <div>Some page content</div>;
  }
}

compare: https://github.com/catdad/canvas-confetti/compare/0.4.2...0.5.0

canvas-confetti - 0.4.2

Published by catdad about 5 years ago

This release only includes internal testing improvements. There is no functional difference in this release.

compare: https://github.com/catdad/canvas-confetti/compare/0.4.1...0.4.2

canvas-confetti - 0.4.1

Published by catdad about 5 years ago

  • builds that do not transform javascript code to the required target version but do bundle es6 modules (cough angular cough) can now use this module when supporting really old browsers (cough Safari 9 cough) - see #68
  • fixing a bug introduced in 0.4.0 that broke IE support... you can again see 🎊 in IE 11 - see #71

compare: https://github.com/catdad/canvas-confetti/compare/0.4.0...0.4.1

canvas-confetti -

Published by catdad about 5 years ago

🎊 Enjoy a blast of confetti on your page!! 🎊

Think of this as the de-facto first release.

canvas-confetti -

Published by catdad about 5 years ago

  • you can provide your own canvas, allowing you animate confetti over only a portion of the page - see #52

compare: https://github.com/catdad/canvas-confetti/compare/0.0.3...0.1.0

canvas-confetti -

Published by catdad about 5 years ago

  • this release adds an ES6 module - see #56

compare: https://github.com/catdad/canvas-confetti/compare/0.1.0...0.2.0

canvas-confetti - 0.2.1

Published by catdad about 5 years ago

This release only contains internal optimizations to the npm package and documentation. There is no functional difference in this release.

compare: https://github.com/catdad/canvas-confetti/compare/0.2.0...0.2.1

canvas-confetti - 0.3.0

Published by catdad about 5 years ago

  • added a reset method to clear all confetti - see #61

compare: https://github.com/catdad/canvas-confetti/compare/0.2.1...0.3.0

canvas-confetti - 0.4.0

Published by catdad about 5 years ago

  • [BREAKING] added a new circle shape to confetti. The default shape is now to include an even mix of both squares and circles. If you hate the circles and want the old behavior back, you can add shape: ['square'] to your options - see #60

compare: https://github.com/catdad/canvas-confetti/compare/0.3.0...0.4.0