Skip to content

Commit

Permalink
在线编辑器支持delay
Browse files Browse the repository at this point in the history
  • Loading branch information
Dituon committed Aug 20, 2022
1 parent 8bb73f7 commit f51589b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion editor/dataBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ function buildData() {
$('#alias').val().trim().split(' ').forEach(alia => {
if (alia) alias.push('"' + alia + '"')
})
const extra = !alias.length ? '' : `,\n "alias": [${alias}]`
let extra = !alias.length ? '' : `,\n "alias": [${alias}]`

if (imageType === 'GIF') extra += `,\n "delay": ${Math.round(1000 / $('#fps').val())}`

let out = `{
"type": "${imageType}",
Expand Down
3 changes: 2 additions & 1 deletion editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ function loadGif(image) {
}
frameLength = gif.get_length()
})
$('#settingsBar').append('<div class="check" onclick="downloadAllBackground()">下载每一帧</div>')
$('#settingsBar').append('<div class="check">fps<input type="number" id="fps" value="15" style="width: 3rem"></div>')
.append('<div class="check" onclick="downloadAllBackground()">下载每一帧</div>')
}
}

Expand Down

0 comments on commit f51589b

Please sign in to comment.