chinwagsocial/app/javascript/entrypoints/error.ts
2024-10-21 20:22:46 +11:00

18 lines
397 B
TypeScript

import './public-path';
import ready from '../mastodon/ready';
ready(() => {
const image = document.querySelector<HTMLImageElement>('img');
if (!image) return;
image.addEventListener('mouseenter', () => {
image.src = '/error-anim.gif';
});
image.addEventListener('mouseleave', () => {
image.src = '/error-static.png';
});
}).catch((e: unknown) => {
console.error(e);
});