2020-01-29 19:37:25 +00:00
|
|
|
<template>
|
2022-02-11 04:38:47 +00:00
|
|
|
<div class="omfetrab" :class="['s' + size, 'w' + width, 'h' + height, { asDrawer }]" :style="{ maxHeight: maxHeight ? maxHeight + 'px' : undefined }">
|
2022-01-28 02:39:49 +00:00
|
|
|
<input ref="search" v-model.trim="q" class="search" data-prevent-emoji-insert :class="{ filled: q != null && q != '' }" :placeholder="i18n.ts.search" @paste.stop="paste" @keyup.enter="done()">
|
2021-11-19 10:36:12 +00:00
|
|
|
<div ref="emojis" class="emojis">
|
2021-02-27 04:08:34 +00:00
|
|
|
<section class="result">
|
|
|
|
<div v-if="searchResultCustom.length > 0">
|
|
|
|
<button v-for="emoji in searchResultCustom"
|
2022-01-18 14:06:16 +00:00
|
|
|
:key="emoji.id"
|
2021-02-27 04:08:34 +00:00
|
|
|
class="_button"
|
|
|
|
:title="emoji.name"
|
|
|
|
tabindex="0"
|
2021-11-19 10:36:12 +00:00
|
|
|
@click="chosen(emoji, $event)"
|
2021-02-27 04:08:34 +00:00
|
|
|
>
|
2022-01-18 14:06:16 +00:00
|
|
|
<!--<MkEmoji v-if="emoji.char != null" :emoji="emoji.char"/>-->
|
|
|
|
<img :src="disableShowingAnimatedImages ? getStaticImageUrl(emoji.url) : emoji.url"/>
|
2021-02-27 04:08:34 +00:00
|
|
|
</button>
|
2020-11-07 01:43:27 +00:00
|
|
|
</div>
|
2021-02-27 04:08:34 +00:00
|
|
|
<div v-if="searchResultUnicode.length > 0">
|
|
|
|
<button v-for="emoji in searchResultUnicode"
|
2021-11-19 10:36:12 +00:00
|
|
|
:key="emoji.name"
|
2021-02-27 04:08:34 +00:00
|
|
|
class="_button"
|
|
|
|
:title="emoji.name"
|
|
|
|
tabindex="0"
|
2021-11-19 10:36:12 +00:00
|
|
|
@click="chosen(emoji, $event)"
|
2021-02-27 04:08:34 +00:00
|
|
|
>
|
|
|
|
<MkEmoji :emoji="emoji.char"/>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</section>
|
2020-11-07 01:43:27 +00:00
|
|
|
|
2021-11-19 10:36:12 +00:00
|
|
|
<div v-if="tab === 'index'" class="index">
|
2021-02-27 04:08:34 +00:00
|
|
|
<section v-if="showPinned">
|
|
|
|
<div>
|
|
|
|
<button v-for="emoji in pinned"
|
2021-11-19 10:36:12 +00:00
|
|
|
:key="emoji"
|
2020-11-07 01:43:27 +00:00
|
|
|
class="_button"
|
2021-02-27 04:08:34 +00:00
|
|
|
tabindex="0"
|
2021-11-19 10:36:12 +00:00
|
|
|
@click="chosen(emoji, $event)"
|
2020-11-07 01:43:27 +00:00
|
|
|
>
|
2021-02-27 04:08:34 +00:00
|
|
|
<MkEmoji :emoji="emoji" :normal="true"/>
|
2020-11-07 01:43:27 +00:00
|
|
|
</button>
|
2020-01-29 19:37:25 +00:00
|
|
|
</div>
|
2020-11-07 01:43:27 +00:00
|
|
|
</section>
|
|
|
|
|
2021-02-27 04:08:34 +00:00
|
|
|
<section>
|
2022-01-28 02:39:49 +00:00
|
|
|
<header class="_acrylic"><i class="far fa-clock fa-fw"></i> {{ i18n.ts.recentUsed }}</header>
|
2021-02-27 04:08:34 +00:00
|
|
|
<div>
|
2022-01-18 14:06:16 +00:00
|
|
|
<button v-for="emoji in recentlyUsedEmojis"
|
2021-11-19 10:36:12 +00:00
|
|
|
:key="emoji"
|
2020-11-07 01:43:27 +00:00
|
|
|
class="_button"
|
|
|
|
@click="chosen(emoji, $event)"
|
|
|
|
>
|
2021-02-27 04:08:34 +00:00
|
|
|
<MkEmoji :emoji="emoji" :normal="true"/>
|
2020-11-07 01:43:27 +00:00
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</section>
|
2020-01-29 19:37:25 +00:00
|
|
|
</div>
|
2021-02-27 16:09:59 +00:00
|
|
|
<div>
|
2022-01-28 02:39:49 +00:00
|
|
|
<header class="_acrylic">{{ i18n.ts.customEmojis }}</header>
|
|
|
|
<XSection v-for="category in customEmojiCategories" :key="'custom:' + category" :initial-shown="false" :emojis="customEmojis.filter(e => e.category === category).map(e => ':' + e.name + ':')" @chosen="chosen">{{ category || i18n.ts.other }}</XSection>
|
2021-02-27 10:53:20 +00:00
|
|
|
</div>
|
2021-02-27 16:09:59 +00:00
|
|
|
<div>
|
2022-01-28 02:39:49 +00:00
|
|
|
<header class="_acrylic">{{ i18n.ts.emoji }}</header>
|
2022-05-01 13:51:07 +00:00
|
|
|
<XSection v-for="category in categories" :key="category" :emojis="emojilist.filter(e => e.category === category).map(e => e.char)" @chosen="chosen">{{ category }}</XSection>
|
2021-02-27 10:53:20 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="tabs">
|
2021-04-20 14:22:59 +00:00
|
|
|
<button class="_button tab" :class="{ active: tab === 'index' }" @click="tab = 'index'"><i class="fas fa-asterisk fa-fw"></i></button>
|
|
|
|
<button class="_button tab" :class="{ active: tab === 'custom' }" @click="tab = 'custom'"><i class="fas fa-laugh fa-fw"></i></button>
|
|
|
|
<button class="_button tab" :class="{ active: tab === 'unicode' }" @click="tab = 'unicode'"><i class="fas fa-leaf fa-fw"></i></button>
|
|
|
|
<button class="_button tab" :class="{ active: tab === 'tags' }" @click="tab = 'tags'"><i class="fas fa-hashtag fa-fw"></i></button>
|
2020-01-29 19:37:25 +00:00
|
|
|
</div>
|
2021-02-27 04:08:34 +00:00
|
|
|
</div>
|
2020-01-29 19:37:25 +00:00
|
|
|
</template>
|
|
|
|
|
2022-01-18 14:06:16 +00:00
|
|
|
<script lang="ts" setup>
|
|
|
|
import { ref, computed, watch, onMounted } from 'vue';
|
|
|
|
import * as Misskey from 'misskey-js';
|
|
|
|
import { emojilist, UnicodeEmojiDef, unicodeEmojiCategories as categories } from '@/scripts/emojilist';
|
2021-11-11 17:02:25 +00:00
|
|
|
import { getStaticImageUrl } from '@/scripts/get-static-image-url';
|
2021-12-27 13:59:14 +00:00
|
|
|
import Ripple from '@/components/ripple.vue';
|
2021-11-11 17:02:25 +00:00
|
|
|
import * as os from '@/os';
|
2021-12-05 04:10:19 +00:00
|
|
|
import { isTouchUsing } from '@/scripts/touch';
|
2022-02-08 09:46:39 +00:00
|
|
|
import { deviceKind } from '@/scripts/device-kind';
|
2022-01-18 14:06:16 +00:00
|
|
|
import { emojiCategories, instance } from '@/instance';
|
2021-02-27 10:53:20 +00:00
|
|
|
import XSection from './emoji-picker.section.vue';
|
2022-01-18 14:06:16 +00:00
|
|
|
import { i18n } from '@/i18n';
|
|
|
|
import { defaultStore } from '@/store';
|
|
|
|
|
|
|
|
const props = withDefaults(defineProps<{
|
|
|
|
showPinned?: boolean;
|
|
|
|
asReactionPicker?: boolean;
|
|
|
|
maxHeight?: number;
|
|
|
|
asDrawer?: boolean;
|
|
|
|
}>(), {
|
|
|
|
showPinned: true,
|
|
|
|
});
|
2020-01-29 19:37:25 +00:00
|
|
|
|
2022-01-18 14:06:16 +00:00
|
|
|
const emit = defineEmits<{
|
|
|
|
(e: 'chosen', v: string): void;
|
|
|
|
}>();
|
|
|
|
|
|
|
|
const search = ref<HTMLInputElement>();
|
|
|
|
const emojis = ref<HTMLDivElement>();
|
|
|
|
|
|
|
|
const {
|
|
|
|
reactions: pinned,
|
2022-02-11 04:38:47 +00:00
|
|
|
reactionPickerSize,
|
2022-01-18 14:06:16 +00:00
|
|
|
reactionPickerWidth,
|
|
|
|
reactionPickerHeight,
|
|
|
|
disableShowingAnimatedImages,
|
|
|
|
recentlyUsedEmojis,
|
|
|
|
} = defaultStore.reactiveState;
|
|
|
|
|
2022-02-11 04:38:47 +00:00
|
|
|
const size = computed(() => props.asReactionPicker ? reactionPickerSize.value : 1);
|
2022-01-18 14:06:16 +00:00
|
|
|
const width = computed(() => props.asReactionPicker ? reactionPickerWidth.value : 3);
|
|
|
|
const height = computed(() => props.asReactionPicker ? reactionPickerHeight.value : 2);
|
|
|
|
const customEmojiCategories = emojiCategories;
|
|
|
|
const customEmojis = instance.emojis;
|
|
|
|
const q = ref<string | null>(null);
|
|
|
|
const searchResultCustom = ref<Misskey.entities.CustomEmoji[]>([]);
|
|
|
|
const searchResultUnicode = ref<UnicodeEmojiDef[]>([]);
|
|
|
|
const tab = ref<'index' | 'custom' | 'unicode' | 'tags'>('index');
|
|
|
|
|
|
|
|
watch(q, () => {
|
|
|
|
if (emojis.value) emojis.value.scrollTop = 0;
|
|
|
|
|
|
|
|
if (q.value == null || q.value === '') {
|
|
|
|
searchResultCustom.value = [];
|
|
|
|
searchResultUnicode.value = [];
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
const newQ = q.value.replace(/:/g, '');
|
|
|
|
|
|
|
|
const searchCustom = () => {
|
|
|
|
const max = 8;
|
|
|
|
const emojis = customEmojis;
|
|
|
|
const matches = new Set<Misskey.entities.CustomEmoji>();
|
|
|
|
|
|
|
|
const exactMatch = emojis.find(e => e.name === newQ);
|
|
|
|
if (exactMatch) matches.add(exactMatch);
|
|
|
|
|
|
|
|
if (newQ.includes(' ')) { // AND検索
|
|
|
|
const keywords = newQ.split(' ');
|
2020-01-29 19:37:25 +00:00
|
|
|
|
2022-01-18 14:06:16 +00:00
|
|
|
// 名前にキーワードが含まれている
|
|
|
|
for (const emoji of emojis) {
|
|
|
|
if (keywords.every(keyword => emoji.name.includes(keyword))) {
|
|
|
|
matches.add(emoji);
|
|
|
|
if (matches.size >= max) break;
|
2020-11-07 01:43:27 +00:00
|
|
|
}
|
2022-01-18 14:06:16 +00:00
|
|
|
}
|
|
|
|
if (matches.size >= max) return matches;
|
2020-11-07 12:28:28 +00:00
|
|
|
|
2022-01-18 14:06:16 +00:00
|
|
|
// 名前またはエイリアスにキーワードが含まれている
|
|
|
|
for (const emoji of emojis) {
|
|
|
|
if (keywords.every(keyword => emoji.name.includes(keyword) || emoji.aliases.some(alias => alias.includes(keyword)))) {
|
|
|
|
matches.add(emoji);
|
|
|
|
if (matches.size >= max) break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
for (const emoji of emojis) {
|
|
|
|
if (emoji.name.startsWith(newQ)) {
|
|
|
|
matches.add(emoji);
|
|
|
|
if (matches.size >= max) break;
|
2020-11-07 01:43:27 +00:00
|
|
|
}
|
2022-01-18 14:06:16 +00:00
|
|
|
}
|
|
|
|
if (matches.size >= max) return matches;
|
2020-11-07 12:28:28 +00:00
|
|
|
|
2022-01-18 14:06:16 +00:00
|
|
|
for (const emoji of emojis) {
|
|
|
|
if (emoji.aliases.some(alias => alias.startsWith(newQ))) {
|
|
|
|
matches.add(emoji);
|
|
|
|
if (matches.size >= max) break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (matches.size >= max) return matches;
|
2020-11-07 01:43:27 +00:00
|
|
|
|
2022-01-18 14:06:16 +00:00
|
|
|
for (const emoji of emojis) {
|
|
|
|
if (emoji.name.includes(newQ)) {
|
|
|
|
matches.add(emoji);
|
|
|
|
if (matches.size >= max) break;
|
|
|
|
}
|
2021-02-27 16:09:59 +00:00
|
|
|
}
|
2022-01-18 14:06:16 +00:00
|
|
|
if (matches.size >= max) return matches;
|
|
|
|
|
|
|
|
for (const emoji of emojis) {
|
|
|
|
if (emoji.aliases.some(alias => alias.includes(newQ))) {
|
|
|
|
matches.add(emoji);
|
|
|
|
if (matches.size >= max) break;
|
|
|
|
}
|
2020-01-29 19:37:25 +00:00
|
|
|
}
|
2022-01-18 14:06:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return matches;
|
|
|
|
};
|
2020-01-29 19:37:25 +00:00
|
|
|
|
2022-01-18 14:06:16 +00:00
|
|
|
const searchUnicode = () => {
|
|
|
|
const max = 8;
|
|
|
|
const emojis = emojilist;
|
|
|
|
const matches = new Set<UnicodeEmojiDef>();
|
2020-11-07 01:43:27 +00:00
|
|
|
|
2022-01-18 14:06:16 +00:00
|
|
|
const exactMatch = emojis.find(e => e.name === newQ);
|
|
|
|
if (exactMatch) matches.add(exactMatch);
|
|
|
|
|
|
|
|
if (newQ.includes(' ')) { // AND検索
|
|
|
|
const keywords = newQ.split(' ');
|
|
|
|
|
|
|
|
// 名前にキーワードが含まれている
|
|
|
|
for (const emoji of emojis) {
|
|
|
|
if (keywords.every(keyword => emoji.name.includes(keyword))) {
|
|
|
|
matches.add(emoji);
|
|
|
|
if (matches.size >= max) break;
|
|
|
|
}
|
2020-11-08 04:58:16 +00:00
|
|
|
}
|
2022-01-18 14:06:16 +00:00
|
|
|
if (matches.size >= max) return matches;
|
2020-11-07 01:43:27 +00:00
|
|
|
|
2022-01-18 14:06:16 +00:00
|
|
|
// 名前またはエイリアスにキーワードが含まれている
|
|
|
|
for (const emoji of emojis) {
|
|
|
|
if (keywords.every(keyword => emoji.name.includes(keyword) || emoji.keywords.some(alias => alias.includes(keyword)))) {
|
|
|
|
matches.add(emoji);
|
|
|
|
if (matches.size >= max) break;
|
|
|
|
}
|
2020-11-07 01:43:27 +00:00
|
|
|
}
|
2022-01-18 14:06:16 +00:00
|
|
|
} else {
|
|
|
|
for (const emoji of emojis) {
|
|
|
|
if (emoji.name.startsWith(newQ)) {
|
|
|
|
matches.add(emoji);
|
|
|
|
if (matches.size >= max) break;
|
|
|
|
}
|
2020-11-07 01:43:27 +00:00
|
|
|
}
|
2022-01-18 14:06:16 +00:00
|
|
|
if (matches.size >= max) return matches;
|
|
|
|
|
|
|
|
for (const emoji of emojis) {
|
|
|
|
if (emoji.keywords.some(keyword => keyword.startsWith(newQ))) {
|
|
|
|
matches.add(emoji);
|
|
|
|
if (matches.size >= max) break;
|
|
|
|
}
|
2020-11-07 01:43:27 +00:00
|
|
|
}
|
2022-01-18 14:06:16 +00:00
|
|
|
if (matches.size >= max) return matches;
|
|
|
|
|
|
|
|
for (const emoji of emojis) {
|
|
|
|
if (emoji.name.includes(newQ)) {
|
|
|
|
matches.add(emoji);
|
|
|
|
if (matches.size >= max) break;
|
|
|
|
}
|
2020-11-07 12:33:36 +00:00
|
|
|
}
|
2022-01-18 14:06:16 +00:00
|
|
|
if (matches.size >= max) return matches;
|
|
|
|
|
|
|
|
for (const emoji of emojis) {
|
|
|
|
if (emoji.keywords.some(keyword => keyword.includes(newQ))) {
|
|
|
|
matches.add(emoji);
|
|
|
|
if (matches.size >= max) break;
|
|
|
|
}
|
2020-11-07 12:33:36 +00:00
|
|
|
}
|
2022-01-18 14:06:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return matches;
|
|
|
|
};
|
|
|
|
|
|
|
|
searchResultCustom.value = Array.from(searchCustom());
|
|
|
|
searchResultUnicode.value = Array.from(searchUnicode());
|
|
|
|
});
|
|
|
|
|
|
|
|
function focus() {
|
2022-02-08 09:46:39 +00:00
|
|
|
if (!['smartphone', 'tablet'].includes(deviceKind) && !isTouchUsing) {
|
2022-01-18 14:06:16 +00:00
|
|
|
search.value?.focus({
|
|
|
|
preventScroll: true
|
|
|
|
});
|
2020-01-29 19:37:25 +00:00
|
|
|
}
|
2022-01-18 14:06:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function reset() {
|
|
|
|
if (emojis.value) emojis.value.scrollTop = 0;
|
|
|
|
q.value = '';
|
|
|
|
}
|
|
|
|
|
|
|
|
function getKey(emoji: string | Misskey.entities.CustomEmoji | UnicodeEmojiDef): string {
|
|
|
|
return typeof emoji === 'string' ? emoji : (emoji.char || `:${emoji.name}:`);
|
|
|
|
}
|
|
|
|
|
|
|
|
function chosen(emoji: any, ev?: MouseEvent) {
|
2022-01-28 02:53:12 +00:00
|
|
|
const el = ev && (ev.currentTarget ?? ev.target) as HTMLElement | null | undefined;
|
2022-01-18 14:06:16 +00:00
|
|
|
if (el) {
|
|
|
|
const rect = el.getBoundingClientRect();
|
|
|
|
const x = rect.left + (el.offsetWidth / 2);
|
|
|
|
const y = rect.top + (el.offsetHeight / 2);
|
|
|
|
os.popup(Ripple, { x, y }, {}, 'end');
|
|
|
|
}
|
|
|
|
|
|
|
|
const key = getKey(emoji);
|
|
|
|
emit('chosen', key);
|
|
|
|
|
|
|
|
// 最近使った絵文字更新
|
|
|
|
if (!pinned.value.includes(key)) {
|
|
|
|
let recents = defaultStore.state.recentlyUsedEmojis;
|
|
|
|
recents = recents.filter((e: any) => e !== key);
|
|
|
|
recents.unshift(key);
|
|
|
|
defaultStore.set('recentlyUsedEmojis', recents.splice(0, 32));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function paste(event: ClipboardEvent) {
|
|
|
|
const paste = (event.clipboardData || window.clipboardData).getData('text');
|
|
|
|
if (done(paste)) {
|
|
|
|
event.preventDefault();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function done(query?: any): boolean | void {
|
|
|
|
if (query == null) query = q.value;
|
|
|
|
if (query == null || typeof query !== 'string') return;
|
|
|
|
|
|
|
|
const q2 = query.replace(/:/g, '');
|
|
|
|
const exactMatchCustom = customEmojis.find(e => e.name === q2);
|
|
|
|
if (exactMatchCustom) {
|
|
|
|
chosen(exactMatchCustom);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
const exactMatchUnicode = emojilist.find(e => e.char === q2 || e.name === q2);
|
|
|
|
if (exactMatchUnicode) {
|
|
|
|
chosen(exactMatchUnicode);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (searchResultCustom.value.length > 0) {
|
|
|
|
chosen(searchResultCustom.value[0]);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (searchResultUnicode.value.length > 0) {
|
|
|
|
chosen(searchResultUnicode.value[0]);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
focus();
|
|
|
|
});
|
|
|
|
|
|
|
|
defineExpose({
|
|
|
|
focus,
|
|
|
|
reset,
|
2020-01-29 19:37:25 +00:00
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.omfetrab {
|
2020-11-14 02:47:30 +00:00
|
|
|
$pad: 8px;
|
|
|
|
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
|
2022-02-11 04:38:47 +00:00
|
|
|
&.s1 {
|
|
|
|
--eachSize: 40px;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.s2 {
|
|
|
|
--eachSize: 45px;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.s3 {
|
|
|
|
--eachSize: 50px;
|
2020-11-18 03:09:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
&.w1 {
|
|
|
|
width: calc((var(--eachSize) * 5) + (#{$pad} * 2));
|
2021-12-16 17:14:40 +00:00
|
|
|
--columns: 1fr 1fr 1fr 1fr 1fr;
|
2020-11-18 03:09:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
&.w2 {
|
|
|
|
width: calc((var(--eachSize) * 6) + (#{$pad} * 2));
|
2021-12-16 17:14:40 +00:00
|
|
|
--columns: 1fr 1fr 1fr 1fr 1fr 1fr;
|
2020-11-18 03:09:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
&.w3 {
|
|
|
|
width: calc((var(--eachSize) * 7) + (#{$pad} * 2));
|
2021-12-16 17:14:40 +00:00
|
|
|
--columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
|
2020-11-18 03:09:14 +00:00
|
|
|
}
|
|
|
|
|
2022-02-11 04:53:02 +00:00
|
|
|
&.w4 {
|
|
|
|
width: calc((var(--eachSize) * 8) + (#{$pad} * 2));
|
|
|
|
--columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.w5 {
|
|
|
|
width: calc((var(--eachSize) * 9) + (#{$pad} * 2));
|
|
|
|
--columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
|
|
|
|
}
|
|
|
|
|
2020-11-18 03:09:14 +00:00
|
|
|
&.h1 {
|
2021-12-16 17:14:40 +00:00
|
|
|
height: calc((var(--eachSize) * 4) + (#{$pad} * 2));
|
2020-11-18 03:09:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
&.h2 {
|
2021-12-16 17:14:40 +00:00
|
|
|
height: calc((var(--eachSize) * 6) + (#{$pad} * 2));
|
2020-11-18 03:09:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
&.h3 {
|
2021-12-16 17:14:40 +00:00
|
|
|
height: calc((var(--eachSize) * 8) + (#{$pad} * 2));
|
|
|
|
}
|
|
|
|
|
2022-02-11 04:53:02 +00:00
|
|
|
&.h4 {
|
|
|
|
height: calc((var(--eachSize) * 10) + (#{$pad} * 2));
|
|
|
|
}
|
|
|
|
|
2021-12-16 17:14:40 +00:00
|
|
|
&.asDrawer {
|
|
|
|
width: 100% !important;
|
|
|
|
|
|
|
|
> .emojis {
|
|
|
|
::v-deep(section) {
|
2021-12-17 07:14:43 +00:00
|
|
|
> header {
|
|
|
|
height: 32px;
|
|
|
|
line-height: 32px;
|
|
|
|
padding: 0 12px;
|
|
|
|
font-size: 15px;
|
|
|
|
}
|
|
|
|
|
2021-12-16 17:14:40 +00:00
|
|
|
> div {
|
|
|
|
display: grid;
|
|
|
|
grid-template-columns: var(--columns);
|
|
|
|
|
|
|
|
> button {
|
|
|
|
aspect-ratio: 1 / 1;
|
|
|
|
width: auto;
|
|
|
|
height: auto;
|
|
|
|
min-width: 0;
|
|
|
|
|
|
|
|
> * {
|
|
|
|
font-size: 30px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-11-14 02:47:30 +00:00
|
|
|
}
|
2020-01-29 19:37:25 +00:00
|
|
|
|
2020-11-07 01:43:27 +00:00
|
|
|
> .search {
|
|
|
|
width: 100%;
|
|
|
|
padding: 12px;
|
|
|
|
box-sizing: border-box;
|
|
|
|
font-size: 1em;
|
|
|
|
outline: none;
|
|
|
|
border: none;
|
|
|
|
background: transparent;
|
|
|
|
color: var(--fg);
|
2020-11-14 02:47:30 +00:00
|
|
|
|
|
|
|
&:not(.filled) {
|
|
|
|
order: 1;
|
|
|
|
z-index: 2;
|
|
|
|
box-shadow: 0px -1px 0 0px var(--divider);
|
|
|
|
}
|
2020-01-29 19:37:25 +00:00
|
|
|
}
|
|
|
|
|
2021-02-27 10:53:20 +00:00
|
|
|
> .tabs {
|
|
|
|
display: flex;
|
|
|
|
display: none;
|
|
|
|
|
|
|
|
> .tab {
|
|
|
|
flex: 1;
|
|
|
|
height: 38px;
|
2021-04-10 03:40:50 +00:00
|
|
|
border-top: solid 0.5px var(--divider);
|
2021-02-27 10:53:20 +00:00
|
|
|
|
|
|
|
&.active {
|
|
|
|
border-top: solid 1px var(--accent);
|
|
|
|
color: var(--accent);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-01-29 19:37:25 +00:00
|
|
|
> .emojis {
|
2021-12-16 17:14:40 +00:00
|
|
|
height: 100%;
|
2020-01-29 19:37:25 +00:00
|
|
|
overflow-y: auto;
|
|
|
|
overflow-x: hidden;
|
|
|
|
|
2020-11-14 02:47:30 +00:00
|
|
|
scrollbar-width: none;
|
|
|
|
|
|
|
|
&::-webkit-scrollbar {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
2021-02-27 10:53:20 +00:00
|
|
|
> div {
|
|
|
|
&:not(.index) {
|
|
|
|
padding: 4px 0 8px 0;
|
2021-04-10 03:40:50 +00:00
|
|
|
border-top: solid 0.5px var(--divider);
|
2021-02-27 10:53:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
> header {
|
|
|
|
/*position: sticky;
|
|
|
|
top: 0;
|
|
|
|
left: 0;*/
|
|
|
|
height: 32px;
|
|
|
|
line-height: 32px;
|
|
|
|
z-index: 2;
|
|
|
|
padding: 0 8px;
|
|
|
|
font-size: 12px;
|
2020-11-07 01:43:27 +00:00
|
|
|
}
|
2020-01-29 19:37:25 +00:00
|
|
|
}
|
|
|
|
|
2021-02-27 10:53:20 +00:00
|
|
|
::v-deep(section) {
|
2020-11-07 01:43:27 +00:00
|
|
|
> header {
|
|
|
|
position: sticky;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
2021-02-27 10:53:20 +00:00
|
|
|
height: 32px;
|
|
|
|
line-height: 32px;
|
2020-11-07 01:43:27 +00:00
|
|
|
z-index: 1;
|
2021-02-27 10:53:20 +00:00
|
|
|
padding: 0 8px;
|
2020-11-07 01:43:27 +00:00
|
|
|
font-size: 12px;
|
2021-02-27 10:53:20 +00:00
|
|
|
cursor: pointer;
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
color: var(--accent);
|
|
|
|
}
|
2020-11-07 01:43:27 +00:00
|
|
|
}
|
2020-01-29 19:37:25 +00:00
|
|
|
|
2020-11-07 01:43:27 +00:00
|
|
|
> div {
|
2021-02-27 10:53:20 +00:00
|
|
|
position: relative;
|
2020-11-14 02:47:30 +00:00
|
|
|
padding: $pad;
|
2020-01-29 19:37:25 +00:00
|
|
|
|
2020-11-07 01:43:27 +00:00
|
|
|
> button {
|
|
|
|
position: relative;
|
|
|
|
padding: 0;
|
2020-11-18 03:09:14 +00:00
|
|
|
width: var(--eachSize);
|
|
|
|
height: var(--eachSize);
|
2020-11-14 02:47:30 +00:00
|
|
|
border-radius: 4px;
|
2020-01-29 19:37:25 +00:00
|
|
|
|
2021-10-02 17:46:58 +00:00
|
|
|
&:focus-visible {
|
2020-11-07 01:43:27 +00:00
|
|
|
outline: solid 2px var(--focus);
|
|
|
|
z-index: 1;
|
|
|
|
}
|
|
|
|
|
2020-11-14 02:47:30 +00:00
|
|
|
&:hover {
|
|
|
|
background: rgba(0, 0, 0, 0.05);
|
2020-11-07 01:43:27 +00:00
|
|
|
}
|
|
|
|
|
2020-11-14 02:47:30 +00:00
|
|
|
&:active {
|
|
|
|
background: var(--accent);
|
|
|
|
box-shadow: inset 0 0.15em 0.3em rgba(27, 31, 35, 0.15);
|
2020-11-07 01:43:27 +00:00
|
|
|
}
|
2020-01-29 19:37:25 +00:00
|
|
|
|
|
|
|
> * {
|
2020-11-14 02:47:30 +00:00
|
|
|
font-size: 24px;
|
|
|
|
height: 1.25em;
|
|
|
|
vertical-align: -.25em;
|
2020-11-07 01:43:27 +00:00
|
|
|
pointer-events: none;
|
2020-01-29 19:37:25 +00:00
|
|
|
}
|
|
|
|
}
|
2020-11-07 01:43:27 +00:00
|
|
|
}
|
2020-01-29 19:37:25 +00:00
|
|
|
|
2020-11-07 01:43:27 +00:00
|
|
|
&.result {
|
2021-04-10 03:40:50 +00:00
|
|
|
border-bottom: solid 0.5px var(--divider);
|
2020-11-14 02:47:30 +00:00
|
|
|
|
|
|
|
&:empty {
|
|
|
|
display: none;
|
|
|
|
}
|
2020-11-07 01:43:27 +00:00
|
|
|
}
|
2020-01-29 19:37:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|