better hitbox for status emoji

This commit is contained in:
Henry Jameson 2019-09-08 21:18:05 +03:00
parent 7360a4d9ef
commit 9146bee7aa
3 changed files with 20 additions and 9 deletions

View file

@ -696,6 +696,22 @@ $status-margin: 0.75em;
line-height: 1.4em;
white-space: pre-wrap;
.emoji-container {
display: inline-block;
width: 32px;
height: 32px;
z-index: 1;
&:hover {
z-index: 2;
.emoji {
transform: scale(3);
z-index: 2;
}
}
}
img, video {
max-width: 100%;
max-height: 400px;
@ -707,12 +723,7 @@ $status-margin: 0.75em;
height: 32px;
transition: transform 200ms;
transform: scale(1);
z-index: 1;
&:hover {
transform: scale(3);
z-index: 2;
}
pointer-events: none;
}
}

View file

@ -194,7 +194,7 @@ export const addEmojis = (string, emojis) => {
return emojis.reduce((acc, emoji) => {
return acc.replace(
new RegExp(`:${emoji.shortcode}:`, 'g'),
`<img src='${emoji.url}' alt='${emoji.shortcode}' title='${emoji.shortcode}' class='emoji' />`
`<span class='emoji-container'><img src='${emoji.url}' alt='${emoji.shortcode}' title='${emoji.shortcode}' class='emoji' /></span>`
)
}, string)
}