Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion examples/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,21 @@ window.onload = function () {
}
});

$('#js-download-gif-framerate-btn').on('click', function (event){

var loader = require('./images/loader');

document.querySelector('#gif_element').src = loader;


let options = getGifResources();
gifshot.createGIF(options, function (obj) { // GIF generation
if (!obj.error) {
document.querySelector('#gif_element').src = obj.image;
}
});
});

function getGifResources() {
// Returns an object with specific gif options
let imgs = document.getElementsByClassName('step-thumbnail');
Expand All @@ -240,7 +255,7 @@ window.onload = function () {
'gifWidth': imgs[0].width,
'gifHeight': imgs[0].height,
'images': imgSrcs,
'frameDuration': 7,
'frameDuration': parseInt($('#js-download-gif-framerate').val()),
};

return options;
Expand Down
1 change: 1 addition & 0 deletions examples/images/loader.js

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,13 @@ <h4 class="modal-title">Your gif is ready</h4>
</div>
</div>
<div class="modal-footer">
<div>
<div>
<p>Framerates</p>
<input type='number' value=1 id="js-download-gif-framerate" />
<button type="button" id="js-download-gif-framerate-btn" class="btn btn-default">Apply</button>
</div>
</div>
<button type="button" class="btn btn-default" data-dismiss="modal">Done</button>

<button id="js-download-as-gif-button" class="btn btn-primary">Download</button>
Expand Down