gifStream is a JavaScript tool for creating large animated graphics on the web.
Install
npm i -S @entryline/gifstream
Example Usage
import GifStream from '@entryline/gifstream';
const gifStream = new GifStream();
gifStream.createGIF({
'gifWidth': 100,
'gifHeight': 100,
'images': [
{src:'someURL', text:'some frame text'}, Frame-specific text
{src:'someURL', delay: 2000},
{src:'someURL', delay: 1000}
],
'waterMarkXCoordinate': 10
'waterMarkYCoordinate': 100,
'waterMarkHeight': 100,
'waterMark': image,
'waterMarkWidth': 100,
'fontSize': someSize + 'px',
'textXCoordinate': 0,
'textYCoordinate': 0,
'fontColor': '#fff',
'fontWeight': '300',
'fontFamily': 'Open Sans',
'showFrameText': true,
'extraLastFrameDelay': 1000,
'text': '',
'stroke': {
'color': '#000',
'pixels': 1
},
'pause': 1
}, onGifComplete);
};
Cancel requests
Tested in chrome, Edge, and Firefox (and does not break anything in IE)
createGif() {
gifStream.createGIF({this.options})
this.isDownloading = true;
}
componentWillUnmount() {
if (this.isDownloading) {
gifStream.cancel();
}
}
Credits
gifstream would like to thank the following individuals and origanization for whom this project would not have been possible without:
@benJaki2, @ZachTRice, @nasa-gibs, Worldview, @jimmywarting, @gfranko, @ChaseWest