From da30d6899aeb1da5337227cf65645096b6d753da Mon Sep 17 00:00:00 2001 From: N-Pex Date: Thu, 15 Apr 2021 11:44:58 +0200 Subject: [PATCH] Support custom short code stickers Issue #105. --- README.md | 9 + src/assets/config.json | 3 +- src/assets/css/chat.scss | 16 ++ src/components/BottomSheet.vue | 184 ++++++++++++++++++ src/components/Chat.vue | 42 +++- src/components/StickerPickerBottomSheet.vue | 77 ++++++++ .../messages/MessageIncomingSticker.vue | 49 +++++ .../messages/MessageOutgoingSticker.vue | 47 +++++ src/plugins/stickers.js | 66 +++++++ 9 files changed, 490 insertions(+), 3 deletions(-) create mode 100644 src/components/BottomSheet.vue create mode 100644 src/components/StickerPickerBottomSheet.vue create mode 100644 src/components/messages/MessageIncomingSticker.vue create mode 100644 src/components/messages/MessageOutgoingSticker.vue create mode 100644 src/plugins/stickers.js diff --git a/README.md b/README.md index 1b7ddd3..c764eca 100644 --- a/README.md +++ b/README.md @@ -39,3 +39,12 @@ npm run lint ### Customize configuration See [Configuration Reference](https://cli.vuejs.org/config/). + +``` + +## Theming + +# Sticker short codes - To enable sticker short codes, follow there steps: +* set "useShortCodeStickers" to true in config.json. +* Add your sticker pack folders (containing stickers) to /src/assets/stickers/ +* Create file /src/assets/stickers/order.txt that lists the folders names in order, one folder name per line. \ No newline at end of file diff --git a/src/assets/config.json b/src/assets/config.json index c74a46c..d6bad56 100644 --- a/src/assets/config.json +++ b/src/assets/config.json @@ -1,3 +1,4 @@ { - "defaultServer": "https://neo.keanu.im" + "defaultServer": "https://neo.keanu.im", + "useShortCodeStickers": false } diff --git a/src/assets/css/chat.scss b/src/assets/css/chat.scss index 04ad1bf..1133285 100644 --- a/src/assets/css/chat.scss +++ b/src/assets/css/chat.scss @@ -197,6 +197,15 @@ $admin-fg: white; width: 70%; max-width: 70%; } + .bubble.sticker-bubble { + padding: 0px; + overflow: hidden; + display: inline-block; + width: 30%; + max-width: 30%; + background-color: transparent; + border: 0px solid transparent !important; + } .avatar { display: inline-block; vertical-align: top !important; @@ -261,6 +270,13 @@ $admin-fg: white; border-radius: 10px 10px 0 10px; } } + .bubble.sticker-bubble { + padding: 0px; + display: inline-block; + width: 30%; + max-width: 30%; + background-color: transparent; + } .avatar { display: inline-block; vertical-align: bottom !important; diff --git a/src/components/BottomSheet.vue b/src/components/BottomSheet.vue new file mode 100644 index 0000000..c1be4f3 --- /dev/null +++ b/src/components/BottomSheet.vue @@ -0,0 +1,184 @@ + + + + + diff --git a/src/components/Chat.vue b/src/components/Chat.vue index 9e9c68d..fd82805 100644 --- a/src/components/Chat.vue +++ b/src/components/Chat.vue @@ -195,6 +195,19 @@ + + + face + + +