Skip to content

Commit

Permalink
Change error graphic to hover-to-play (mastodon#10055)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gargron committed Feb 15, 2019
1 parent 71e28ba commit 80388a3
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 8 deletions.
13 changes: 13 additions & 0 deletions app/javascript/packs/error.js
@@ -0,0 +1,13 @@
import ready from '../mastodon/ready';

ready(() => {
const image = document.querySelector('img');

image.addEventListener('mouseenter', () => {
image.src = '/oops.gif';
});

image.addEventListener('mouseleave', () => {
image.src = '/oops.png';
});
});
14 changes: 8 additions & 6 deletions app/javascript/styles/mastodon/basics.scss
Expand Up @@ -100,12 +100,14 @@ body {
vertical-align: middle;
margin: 20px;

img {
display: block;
max-width: 470px;
width: 100%;
height: auto;
margin-top: -120px;
&__illustration {
img {
display: block;
max-width: 470px;
width: 100%;
height: auto;
margin-top: -120px;
}
}

h1 {
Expand Down
7 changes: 5 additions & 2 deletions app/views/layouts/error.html.haml
Expand Up @@ -7,8 +7,11 @@
%meta{ content: 'width=device-width,initial-scale=1', name: 'viewport' }/
= stylesheet_pack_tag 'common', media: 'all'
= stylesheet_pack_tag Setting.default_settings['theme'], media: 'all'
= javascript_pack_tag 'common', integrity: true, crossorigin: 'anonymous'
= javascript_pack_tag 'error', integrity: true, crossorigin: 'anonymous'
%body.error
.dialog
%img{ alt: Setting.default_settings['site_title'], src: '/oops.gif' }/
%div
.dialog__illustration
%img{ alt: Setting.default_settings['site_title'], src: '/oops.png' }/
.dialog__message
%h1= yield :content
Binary file added public/oops.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 80388a3

Please sign in to comment.