aviary-ps/src/ffi.js

28 lines
594 B
JavaScript

export function arrayBufferToBlob(mime) {
return function(data) {
return new Blob([data], {type: mime})
}
}
export const nonce = new Uint8Array([0xd0, 0xc3, 0x75, 0x56, 0x58, 0xc1, 0x7e, 0x5f, 0xd6, 0xcc, 0xb6, 0x76]).buffer
export function decodeBlurhashImpl(just) {
return function(nothing) {
return function(x) {
return function(y) {
return function(blurhash) {
try {
return just(BlurHash.toDataURL(blurhash, x, y))
} catch(_) {
return nothing
}
}
}
}
}
}
export function removeSpinner() {
document.getElementById("spinner").remove()
}