when autoplay is off play animated emoji on hover

staging
multiple creatures 2019-05-16 15:41:49 -05:00
parent 506d2e9cf0
commit 8a1ac19777
3 changed files with 20 additions and 2 deletions

View File

@ -11,6 +11,20 @@
}
}
.hoverplay {
background-position: center;
background-repeat: no-repeat;
background-size: 0 0;
}
.hoverplay:hover {
background-size: contain;
position: relative;
box-sizing: border-box;
overflow: hidden;
padding-left: 16px;
}
.emoji-picker-dropdown__menu {
background: $simple-background-color;
position: absolute;

View File

@ -28,8 +28,11 @@ const emojify = (str, customEmojis = {}) => {
// now got a replacee as ':shortname:'
// if you want additional emoji handler, add statements below which set replacement and return true.
if (shortname in customEmojis) {
const filename = autoPlayGif ? customEmojis[shortname].url : customEmojis[shortname].static_url;
replacement = `<img draggable="false" class="emojione" alt="${shortname}" title="${shortname}" src="${filename}" />`;
if (autoPlayGif) {
replacement = `<img draggable="false" class="emojione" alt="${shortname}" title="${shortname}" src="${customEmojis[shortname].url}" />`;
} else {
replacement = `<img draggable="false" class="emojione hoverplay" alt="${shortname}" title="${shortname}" src="${customEmojis[shortname].static_url}" style="background-image:url(${customEmojis[shortname].url})" />`;
}
return true;
}
return false;

View File

@ -88,6 +88,7 @@
-if current_account&.user_wants_larger_emoji?
:css
.status__content .emojione { width: 32px !important; height: 32px !important }
.status__content .hoverplay:hover { padding-left: 32px !important }
%body{ class: body_classes }
= content_for?(:content) ? yield(:content) : yield