Fishies 0.8.11

This commit is contained in:
CRTkafa 2026-10-30 08:23:23 +00:00
parent 9020cffee7
commit ed00d055ae
23 changed files with 108 additions and 52 deletions

View file

@ -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