From 4d1a9b12e46d2664acceb42830023c641a6a71e6 Mon Sep 17 00:00:00 2001 From: alexanderroese Date: Tue, 16 Jul 2024 23:12:52 +0200 Subject: [PATCH] emoji picker --- snippets/shx-3d-render-input.liquid | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/snippets/shx-3d-render-input.liquid b/snippets/shx-3d-render-input.liquid index 44519e5..50578de 100644 --- a/snippets/shx-3d-render-input.liquid +++ b/snippets/shx-3d-render-input.liquid @@ -434,12 +434,28 @@ }); }, 1000); + function onClickEmojiPickerButton() { + const emojiPicker = document.createElement("emoji-picker"); + emojiPicker.classList = "light"; + emojiPicker.style.width = "100%"; + + emojiPicker.addEventListener("emoji-click", (e) => { + insertText(document.querySelector("#shx-text1"), e.detail.unicode); + }); + + console.log("add picker"); + + document.getElementsByClassName("shx-emoji-picker-popup")[0].appendChild(emojiPicker); + + document.querySelector('.shx-emoji-picker-popup').classList.toggle('shown') + } + return `
-
+