From 579b5c9e77154db5fe1bc712969b6fa39830442f Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 12 Aug 2019 14:20:08 +0300 Subject: [PATCH] initial attempts at making emoji-picker somewhat extensible --- src/components/emoji_picker/emoji_picker.js | 6 +- src/components/emoji_picker/emoji_picker.scss | 83 ++++++++ src/components/emoji_picker/emoji_picker.vue | 201 +++++------------- 3 files changed, 144 insertions(+), 146 deletions(-) create mode 100644 src/components/emoji_picker/emoji_picker.scss diff --git a/src/components/emoji_picker/emoji_picker.js b/src/components/emoji_picker/emoji_picker.js index 92d517b7..e25f98ff 100644 --- a/src/components/emoji_picker/emoji_picker.js +++ b/src/components/emoji_picker/emoji_picker.js @@ -6,7 +6,8 @@ const EmojiPicker = { data () { return { keyword: '', - activeGroup: 'standard' + activeGroup: 'standard', + showingAdditional: false } }, methods: { @@ -28,6 +29,9 @@ const EmojiPicker = { this.activeGroup = key } }) + }, + toggleAdditional (value) { + this.showingAdditional = value } }, computed: { diff --git a/src/components/emoji_picker/emoji_picker.scss b/src/components/emoji_picker/emoji_picker.scss new file mode 100644 index 00000000..72889441 --- /dev/null +++ b/src/components/emoji_picker/emoji_picker.scss @@ -0,0 +1,83 @@ +@import '../../_variables.scss'; + +.emoji-picker { + position: absolute; + z-index: 1; + right: 0; + width: 300px; + height: 300px; + display: flex; + flex-direction: column; + margin: 0 !important; + + .emoji { + &-tabs { + &-item { + padding: 0 5px; + + &.active { + border-bottom: 4px solid; + + i { + color: $fallback--lightText; + color: var(--lightText, $fallback--lightText); + } + } + } + } + + &-content { + display: flex; + flex-direction: column; + } + + &-search { + padding: 5px; + flex: 0 0 1px; + + input { + width: 100%; + } + } + + &-groups { + flex: 1 1 1px; + position: relative; + overflow: auto; + } + + &-group { + display: flex; + align-items: center; + flex-wrap: wrap; + padding: 5px; + justify-content: space-between; + + &-title { + font-size: 12px; + width: 100%; + margin: 0; + } + } + + &-item { + width: 32px; + height: 32px; + box-sizing: border-box; + display: flex; + font-size: 32px; + align-items: center; + justify-content: center; + margin: 2px; + + cursor: pointer; + + img { + max-width: 100%; + max-height: 100%; + } + } + + } + +} diff --git a/src/components/emoji_picker/emoji_picker.vue b/src/components/emoji_picker/emoji_picker.vue index 70d08700..ec1702f3 100644 --- a/src/components/emoji_picker/emoji_picker.vue +++ b/src/components/emoji_picker/emoji_picker.vue @@ -1,161 +1,72 @@ - - +