logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://anongit.hacktivis.me/git/pleroma-fe.git/
commit: e2bcbd51bb1c42f2c289de5daf993b2d6bb97205
parent 1cc9ff70e0aa929d7146fa8390fe491190dd131c
Author: Henry Jameson <me@hjkos.com>
Date:   Mon, 23 Dec 2024 23:01:15 +0200

emoji consistency + picker improvements

Diffstat:

Msrc/components/emoji_picker/emoji_picker.scss49++++++++++++++++++++++++++++++-------------------
Msrc/components/emoji_picker/emoji_picker.vue2++
Msrc/components/emoji_reactions/emoji_reactions.js4+++-
Msrc/components/emoji_reactions/emoji_reactions.vue13++++++++-----
4 files changed, 43 insertions(+), 25 deletions(-)

diff --git a/src/components/emoji_picker/emoji_picker.scss b/src/components/emoji_picker/emoji_picker.scss @@ -166,24 +166,6 @@ } } - &-group { - display: flex; - align-items: center; - flex-wrap: wrap; - justify-content: left; - - &-title { - font-size: 0.85em; - width: 100%; - margin: 0; - padding-left: 0.3em; - - &.disabled { - display: none; - } - } - } - &-item { width: var(--emoji-size); height: var(--emoji-size); @@ -206,9 +188,38 @@ } .emoji-picker-emoji.-unicode { - font-size: 1.6em; + font-size: calc(var(--emoji-size) * 0.8); overflow: hidden; } } + + &-group { + display: grid; + grid-template-columns: repeat(var(--__amount), 1fr); + justify-items: center; + align-items: center; + justify-content: left; + grid-template-rows: repeat(1, auto); + + &.first-row { + grid-template-rows: repeat(2, auto); + + .emoji-item { + grid-row: 2; + } + } + + &-title { + font-size: 0.85em; + grid-column: span var(--__amount); + width: 100%; + margin: 0; + padding-left: 0.3em; + + &.disabled { + display: none; + } + } + } } } diff --git a/src/components/emoji_picker/emoji_picker.vue b/src/components/emoji_picker/emoji_picker.vue @@ -106,6 +106,8 @@ > <div class="emoji-group" + :class="{ ['first-row']: group.isFirstRow }" + :style="{ '--__amount': itemPerRow }" > <h6 v-if="group.isFirstRow" diff --git a/src/components/emoji_reactions/emoji_reactions.js b/src/components/emoji_reactions/emoji_reactions.js @@ -1,5 +1,6 @@ import UserAvatar from '../user_avatar/user_avatar.vue' import UserListPopover from '../user_list_popover/user_list_popover.vue' +import StillImage from 'src/components/still-image/still-image.vue' import { library } from '@fortawesome/fontawesome-svg-core' import { faPlus, @@ -19,7 +20,8 @@ const EmojiReactions = { name: 'EmojiReactions', components: { UserAvatar, - UserListPopover + UserListPopover, + StillImage }, props: ['status'], data: () => ({ diff --git a/src/components/emoji_reactions/emoji_reactions.vue b/src/components/emoji_reactions/emoji_reactions.vue @@ -18,12 +18,11 @@ <span class="reaction-emoji" > - <img + <StillImage v-if="reaction.url" :src="reaction.url" class="reaction-emoji-content" - width="1em" - > + /> <span v-else class="reaction-emoji reaction-emoji-content" @@ -132,12 +131,16 @@ .reaction-emoji-content { max-width: 100%; max-height: 100%; - width: auto; - height: auto; + width: var(--emoji-size); + height: var(--emoji-size); line-height: inherit; overflow: hidden; font-size: calc(var(--emoji-size) * 0.8); margin: 0; + + img { + object-fit: contain; + } } &:focus {