Fishies 0.8.11

This commit is contained in:
CRTkafa 2026-10-31 08:35:11 +00:00
parent 11661ffb05
commit f31db9cb37

View file

@ -17,5 +17,8 @@ export function reveal(img: HTMLImageElement, instant?: boolean): void {
} }
export const FX_IMAGE_SCRIPT = `(function(){var r=${reveal.toString()};` + export const FX_IMAGE_SCRIPT = `(function(){var r=${reveal.toString()};` +
`function h(e){var t=e.target;if(t&&t.tagName==='IMG'&&t.hasAttribute('data-fx'))r(t)}` + `var p=/(\\/game\\/[^?#\\s]+)\\.png(?=[?#\\s]|$)/g;` +
`function w(t){if(t.getAttribute('data-webp-tried'))return false;var s=t.getAttribute('src')||'';if(!/\\/game\\/[^?#]+\\.png/.test(s))return false;` +
`t.setAttribute('data-webp-tried','1');var ss=t.getAttribute('srcset');if(ss)t.setAttribute('srcset',ss.replace(p,'$1.webp'));t.setAttribute('src',s.replace(p,'$1.webp'));return true}` +
`function h(e){var t=e.target;if(!t||t.tagName!=='IMG')return;if(e.type==='error'&&w(t))return;if(t.hasAttribute('data-fx'))r(t)}` +
`document.addEventListener('load',h,true);document.addEventListener('error',h,true)})()` `document.addEventListener('load',h,true);document.addEventListener('error',h,true)})()`