Fishies 0.8.11
This commit is contained in:
parent
9020cffee7
commit
ed00d055ae
23 changed files with 108 additions and 52 deletions
|
|
@ -1,5 +1,9 @@
|
|||
export type FxState = 'wait' | 'fade' | 'ready' | 'error'
|
||||
|
||||
let alternative: (src: string) => string | null = () => null
|
||||
export function configureImageFallback(find: (src: string) => string | null): void { alternative = find }
|
||||
export const imageFallback = (src: string): string | null => alternative(src)
|
||||
|
||||
export function reveal(img: HTMLImageElement, instant?: boolean): void {
|
||||
if (img.getAttribute('data-fx') !== 'wait' || !img.complete) return
|
||||
const src = img.currentSrc || img.src
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue