mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-15 16:59:41 +00:00
[Glitch] Convert easy entrypoints files to Typescript
Port 36909065b5 to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
18
app/javascript/flavours/glitch/entrypoints/error.ts
Normal file
18
app/javascript/flavours/glitch/entrypoints/error.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import '@/entrypoints/public-path';
|
||||
import ready from 'flavours/glitch/ready';
|
||||
|
||||
ready(() => {
|
||||
const image = document.querySelector<HTMLImageElement>('img');
|
||||
|
||||
if (!image) return;
|
||||
|
||||
image.addEventListener('mouseenter', () => {
|
||||
image.src = '/oops.gif';
|
||||
});
|
||||
|
||||
image.addEventListener('mouseleave', () => {
|
||||
image.src = '/oops.png';
|
||||
});
|
||||
}).catch((e: unknown) => {
|
||||
console.error(e);
|
||||
});
|
||||
Reference in New Issue
Block a user