danilosetra / react-responsive-spritesheet Goto Github PK
View Code? Open in Web Editor NEWReact component which helps you to easily apply responsive spritesheet animations on your project.
License: MIT License
React component which helps you to easily apply responsive spritesheet animations on your project.
License: MIT License
The window.addEventListener
is called, but removeEventListener
is never called, thus leaking event handlers.
Include Bundlephobia badge size
https://badgen.net/bundlephobia/minzip/react-responsive-spritesheet
Allow spritesheet rewind animation :)
Use createRef() instead of random id
On README.md, change the folder of images from 'develop' to 'master'
The component doesn't supports mouse events besides onclick
implement functions to allow preload (using promises, for example) of sprite and background images
The component isn't providing instance parameters like "isPlaying"
Return 'instance' for events (like onMouseEnter, onClick, etc) equals getInstance returns. This will allow to manipulate instance without set getInstance component parameter
Implement event handlers
Register following the documentation - https://help.github.com/en/articles/configuring-npm-for-use-with-github-package-registry
implement setSpeed function. At this point, the spritesheet can change fps even after starts
Currently the build version contains class
which is not compatible with ES5. It would be nice if the build version was compatible with ES5 so it can be used in IE10/11.
component render exceeding determined height when resize window width
I want that every time the scroll is activated, it will play.
but has not implemented those methods, how can I do it?
The component can return the following parameters
The build is'nt and must be minified
Hi,
The React img component has an onError callback in case there's something wrong with image src.
Would it be possible to provide the same callback in the Spritesheet component?
Currently, Spritesheet throw an error:
imgLoadSprite.onerror = () => {
throw new Error(`Failed to load image ${imgLoadSprite.src}`);
};
could be replaced by:
imgLoadSprite.onerror = () => {
onError(`Failed to load image ${imgLoadSprite.src}`);
};
Regards
If you unmount the Spritesheet before the loading is done, an error is thrown.
You probably have to check whether the component is still mounted if the onload callback.
EDIT: this line is probably returning null
since it has already been unmounted.
Include startAt and endAt parameters to allow initial and final frames for animation
The parameter 'isPlaying' supplied by getInfo is returning "true" even while spritesheet paused on start, according the timeout was configured. The correct is start with "false", and after timeout completes, return "true", cause till this, its paused, obviously.
I need to change dynamically sprites on an element, including FPS.
SetFPS function does not work
I understand that the values are initialized when the component is mounted and I can’t change them dynamically, how best to implement this? I can change the start and end frames, but I can’t change the FPS
The component doesn't support multi-row spritesheet images
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.