chinwagsocial/app/javascript/entrypoints/error.ts

19 lines
397 B
TypeScript
Raw Normal View History

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