first commit

This commit is contained in:
2025-04-24 13:11:28 +08:00
commit ff9c54d5e4
5960 changed files with 834111 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
function loadingFailed(imgEl) {
return imgEl.complete && imgEl.naturalWidth === 0
}
document.querySelectorAll('[data-ol-fallback-image]').forEach(imgEl => {
function showFallback() {
imgEl.src = imgEl.getAttribute('data-ol-fallback-image')
}
if (loadingFailed(imgEl)) {
// The image loading failed before the sprinkle ran.
showFallback()
} else {
// The image loading might fail in the future.
imgEl.addEventListener('error', showFallback)
}
})