Skip to content

Commit 80388a3

Browse files
authored
Change error graphic to hover-to-play (mastodon#10055)
Fix mastodon#6060
1 parent 71e28ba commit 80388a3

File tree

4 files changed

+26
-8
lines changed

4 files changed

+26
-8
lines changed

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
@@ -100,12 +100,14 @@ body {
100100
vertical-align: middle;
101101
margin: 20px;
102102

103-
img {
104-
display: block;
105-
max-width: 470px;
106-
width: 100%;
107-
height: auto;
108-
margin-top: -120px;
103+
&__illustration {
104+
img {
105+
display: block;
106+
max-width: 470px;
107+
width: 100%;
108+
height: auto;
109+
margin-top: -120px;
110+
}
109111
}
110112

111113
h1 {

app/views/layouts/error.html.haml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@
77
%meta{ content: 'width=device-width,initial-scale=1', name: 'viewport' }/
88
= stylesheet_pack_tag 'common', media: 'all'
99
= stylesheet_pack_tag Setting.default_settings['theme'], media: 'all'
10+
= javascript_pack_tag 'common', integrity: true, crossorigin: 'anonymous'
11+
= javascript_pack_tag 'error', integrity: true, crossorigin: 'anonymous'
1012
%body.error
1113
.dialog
12-
%img{ alt: Setting.default_settings['site_title'], src: '/oops.gif' }/
13-
%div
14+
.dialog__illustration
15+
%img{ alt: Setting.default_settings['site_title'], src: '/oops.png' }/
16+
.dialog__message
1417
%h1= yield :content

public/oops.png

20.1 KB
Loading

0 commit comments

Comments
 (0)