🎉 performant confetti animation in the browser
ISC License
Bot releases are hidden (Show)
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
🎉🎉 The module is now at 1.0.0! 🎉🎉
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 #83requestAnimationFrame
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 #86Published by catdad almost 5 years ago
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 settingwindow.Promise
.
Note: if you want to trigger
confetti()
inside your render path (i.e. in therender()
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
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
Published by catdad about 5 years ago
compare: https://github.com/catdad/canvas-confetti/compare/0.4.0...0.4.1
compare: https://github.com/catdad/canvas-confetti/compare/0.0.3...0.1.0
compare: https://github.com/catdad/canvas-confetti/compare/0.1.0...0.2.0
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
Published by catdad about 5 years ago
reset
method to clear all confetti - see #61compare: https://github.com/catdad/canvas-confetti/compare/0.2.1...0.3.0
Published by catdad about 5 years ago
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 #60compare: https://github.com/catdad/canvas-confetti/compare/0.3.0...0.4.0