Merge branch 'twemojiEmoteMenuSvelte' of github.com:thecodingmachine/workadventure into twemojiEmoteMenuSvelte
This commit is contained in:
parent
7922de10ff
commit
63c4eeb4c7
@ -4,6 +4,7 @@
|
|||||||
import { emoteStore, emoteMenuStore } from "../../Stores/EmoteStore";
|
import { emoteStore, emoteMenuStore } from "../../Stores/EmoteStore";
|
||||||
import { onDestroy, onMount } from "svelte";
|
import { onDestroy, onMount } from "svelte";
|
||||||
import { EmojiButton } from '@joeattardi/emoji-button';
|
import { EmojiButton } from '@joeattardi/emoji-button';
|
||||||
|
import { isMobile } from "../../Enum/EnvironmentVariable";
|
||||||
|
|
||||||
let emojiContainer: HTMLElement;
|
let emojiContainer: HTMLElement;
|
||||||
let picker: EmojiButton;
|
let picker: EmojiButton;
|
||||||
@ -16,7 +17,8 @@
|
|||||||
styleProperties: {
|
styleProperties: {
|
||||||
'--font': 'Press Start 2P'
|
'--font': 'Press Start 2P'
|
||||||
},
|
},
|
||||||
autoFocusSearch : false
|
emojisPerRow: isMobile() ? 6 : 8,
|
||||||
|
autoFocusSearch: false
|
||||||
});
|
});
|
||||||
|
|
||||||
picker.on("emoji", (selection) => {
|
picker.on("emoji", (selection) => {
|
||||||
@ -36,6 +38,12 @@
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
function onKeyDown(e:KeyboardEvent) {
|
||||||
|
if (e.key === 'Escape') {
|
||||||
|
emoteMenuStore.closeEmoteMenu();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onDestroy(() => {
|
onDestroy(() => {
|
||||||
if (unsubscriber) {
|
if (unsubscriber) {
|
||||||
unsubscriber();
|
unsubscriber();
|
||||||
@ -46,6 +54,8 @@
|
|||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<svelte:window on:keydown={onKeyDown}/>
|
||||||
|
|
||||||
<div class="emote-menu-container">
|
<div class="emote-menu-container">
|
||||||
<div class="emote-menu" bind:this={emojiContainer}></div>
|
<div class="emote-menu" bind:this={emojiContainer}></div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1106,3 +1106,12 @@ div.is-silent.hide {
|
|||||||
.emote-menu .emoji-picker .emoji-picker__emoji {
|
.emote-menu .emoji-picker .emoji-picker__emoji {
|
||||||
font-family: "Twemoji Mozilla" !important;
|
font-family: "Twemoji Mozilla" !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
div.emoji-picker {
|
||||||
|
background-color: #333;
|
||||||
|
border-radius: 1em;
|
||||||
|
|
||||||
|
input.emoji-picker__search {
|
||||||
|
border-radius: 1em;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user