Skip to content

Commit f6f81f9

Browse files
committed
Revert "Revert "Change error graphic to hover-to-play (mastodon#10055)""
This reverts commit c8554e6. * add public/oops.png Signed-off-by: lindwurm <lindwurm.q@gmail.com>
1 parent 9b9765e commit f6f81f9

4 files changed

Lines changed: 24 additions & 8 deletions

File tree

app/javascript/packs/error.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import ready from '../mastodon/ready';
2+
3+
ready(() => {
4+
const image = document.querySelector('img');
5+
6+
image.addEventListener('mouseenter', () => {
7+
image.src = '/oops.gif';
8+
});
9+
10+
image.addEventListener('mouseleave', () => {
11+
image.src = '/oops.png';
12+
});
13+
});

app/javascript/styles/mastodon/basics.scss

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,14 @@ body {
130130
vertical-align: middle;
131131
margin: 20px;
132132

133-
img {
134-
display: block;
135-
max-width: 470px;
136-
width: 100%;
137-
height: auto;
138-
margin-top: -120px;
133+
&__illustration {
134+
img {
135+
display: block;
136+
max-width: 470px;
137+
width: 100%;
138+
height: auto;
139+
margin-top: -120px;
140+
}
139141
}
140142

141143
h1 {

app/views/layouts/error.html.haml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
= javascript_pack_tag 'error', crossorigin: 'anonymous'
1212
%body.error
1313
.dialog
14-
%img{ alt: Setting.default_settings['site_title'], src: '/oops.gif' }/
15-
%div
14+
.dialog__illustration
15+
%img{ alt: Setting.default_settings['site_title'], src: '/oops.gif' }/
16+
.dialog__message
1617
%h1= yield :content

public/oops.png

20.5 KB
Loading

0 commit comments

Comments
 (0)