2020-01-29 19:37:25 +00:00
|
|
|
<template>
|
2021-02-27 04:08:34 +00:00
|
|
|
<div class="omfetrab _popup" :class="['w' + width, 'h' + height, { big }]">
|
|
|
|
<input ref="search" class="search" data-prevent-emoji-insert :class="{ filled: q != null && q != '' }" v-model.trim="q" :placeholder="$ts.search" @paste.stop="paste" @keyup.enter="done()">
|
|
|
|
<div class="emojis" ref="emojis">
|
|
|
|
<section class="result">
|
|
|
|
<div v-if="searchResultCustom.length > 0">
|
|
|
|
<button v-for="emoji in searchResultCustom"
|
|
|
|
class="_button"
|
|
|
|
:title="emoji.name"
|
|
|
|
@click="chosen(emoji, $event)"
|
|
|
|
:key="emoji"
|
|
|
|
tabindex="0"
|
|
|
|
>
|
|
|
|
<MkEmoji v-if="emoji.char != null" :emoji="emoji.char"/>
|
|
|
|
<img v-else :src="$store.state.disableShowingAnimatedImages ? getStaticImageUrl(emoji.url) : emoji.url"/>
|
|
|
|
</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"
|
|
|
|
class="_button"
|
|
|
|
:title="emoji.name"
|
|
|
|
@click="chosen(emoji, $event)"
|
|
|
|
:key="emoji.name"
|
|
|
|
tabindex="0"
|
|
|
|
>
|
|
|
|
<MkEmoji :emoji="emoji.char"/>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</section>
|
2020-11-07 01:43:27 +00:00
|
|
|
|
2021-02-27 10:53:20 +00:00
|
|
|
<div class="index" v-if="tab === 'index'">
|
2021-02-27 04:08:34 +00:00
|
|
|
<section v-if="showPinned">
|
|
|
|
<div>
|
|
|
|
<button v-for="emoji in pinned"
|
2020-11-07 01:43:27 +00:00
|
|
|
class="_button"
|
|
|
|
@click="chosen(emoji, $event)"
|
2021-02-27 04:08:34 +00:00
|
|
|
tabindex="0"
|
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>
|
|
|
|
<header class="_acrylic"><Fa :icon="faClock" fixed-width/> {{ $ts.recentUsed }}</header>
|
|
|
|
<div>
|
|
|
|
<button v-for="emoji in $store.state.recentlyUsedEmojis"
|
2020-11-07 01:43:27 +00:00
|
|
|
class="_button"
|
|
|
|
@click="chosen(emoji, $event)"
|
2021-02-27 04:08:34 +00:00
|
|
|
:key="emoji"
|
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>
|
|
|
|
</div>
|
|
|
|
</section>
|
2020-01-29 19:37:25 +00:00
|
|
|
</div>
|
2021-02-27 16:09:59 +00:00
|
|
|
<div>
|
2021-02-27 10:53:20 +00:00
|
|
|
<header class="_acrylic">{{ $ts.customEmojis }}</header>
|
2021-02-27 16:09:59 +00:00
|
|
|
<XSection v-for="category in customEmojiCategories" :key="'custom:' + category" :initial-shown="false" :emojis="customEmojis.filter(e => e.category === category).map(e => ':' + e.name + ':')">{{ category || $ts.other }}</XSection>
|
2021-02-27 10:53:20 +00:00
|
|
|
</div>
|
2021-02-27 16:09:59 +00:00
|
|
|
<div>
|
2021-02-27 10:53:20 +00:00
|
|
|
<header class="_acrylic">{{ $ts.emoji }}</header>
|
2021-02-27 16:09:59 +00:00
|
|
|
<XSection v-for="category in categories" :emojis="emojilist.filter(e => e.category === category).map(e => e.char)">{{ category }}</XSection>
|
2021-02-27 10:53:20 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="tabs">
|
|
|
|
<button class="_button tab" :class="{ active: tab === 'index' }" @click="tab = 'index'"><Fa :icon="faAsterisk" fixed-width/></button>
|
|
|
|
<button class="_button tab" :class="{ active: tab === 'custom' }" @click="tab = 'custom'"><Fa :icon="faLaugh" fixed-width/></button>
|
|
|
|
<button class="_button tab" :class="{ active: tab === 'unicode' }" @click="tab = 'unicode'"><Fa :icon="faLeaf" fixed-width/></button>
|
|
|
|
<button class="_button tab" :class="{ active: tab === 'tags' }" @click="tab = 'tags'"><Fa :icon="faHashtag" fixed-width/></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>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2020-11-03 06:49:31 +00:00
|
|
|
import { defineComponent, markRaw } from 'vue';
|
2020-01-29 19:37:25 +00:00
|
|
|
import { emojilist } from '../../misc/emojilist';
|
2021-03-23 08:30:14 +00:00
|
|
|
import { getStaticImageUrl } from '@client/scripts/get-static-image-url';
|
2021-02-27 10:53:20 +00:00
|
|
|
import { faAsterisk, faLeaf, faUtensils, faFutbol, faCity, faDice, faGlobe, faClock, faUser, faChevronDown, faShapes, faBicycle, faHashtag } from '@fortawesome/free-solid-svg-icons';
|
2020-01-29 19:37:25 +00:00
|
|
|
import { faHeart, faFlag, faLaugh } from '@fortawesome/free-regular-svg-icons';
|
2021-03-23 08:30:14 +00:00
|
|
|
import Particle from '@client/components/particle.vue';
|
|
|
|
import * as os from '@client/os';
|
|
|
|
import { isDeviceTouch } from '@client/scripts/is-device-touch';
|
|
|
|
import { isMobile } from '@client/scripts/is-mobile';
|
|
|
|
import { emojiCategories } from '@client/instance';
|
2021-02-27 10:53:20 +00:00
|
|
|
import XSection from './emoji-picker.section.vue';
|
2020-01-29 19:37:25 +00:00
|
|
|
|
2020-10-17 11:12:00 +00:00
|
|
|
export default defineComponent({
|
2021-02-27 10:53:20 +00:00
|
|
|
components: {
|
|
|
|
XSection
|
|
|
|
},
|
|
|
|
|
2020-01-29 19:37:25 +00:00
|
|
|
props: {
|
2020-11-14 05:32:01 +00:00
|
|
|
showPinned: {
|
|
|
|
required: false,
|
|
|
|
default: true
|
2020-11-07 01:43:27 +00:00
|
|
|
},
|
2020-11-18 03:09:14 +00:00
|
|
|
asReactionPicker: {
|
2020-11-14 02:47:30 +00:00
|
|
|
required: false
|
|
|
|
},
|
2020-01-29 19:37:25 +00:00
|
|
|
},
|
|
|
|
|
2021-02-27 04:08:34 +00:00
|
|
|
emits: ['chosen'],
|
2020-10-17 11:12:00 +00:00
|
|
|
|
2020-01-29 19:37:25 +00:00
|
|
|
data() {
|
|
|
|
return {
|
2020-11-03 06:49:31 +00:00
|
|
|
emojilist: markRaw(emojilist),
|
2020-01-29 19:37:25 +00:00
|
|
|
getStaticImageUrl,
|
2020-12-19 01:55:52 +00:00
|
|
|
pinned: this.$store.state.reactions,
|
|
|
|
width: this.asReactionPicker ? this.$store.state.reactionPickerWidth : 3,
|
|
|
|
height: this.asReactionPicker ? this.$store.state.reactionPickerHeight : 2,
|
2020-11-18 03:09:14 +00:00
|
|
|
big: this.asReactionPicker ? isDeviceTouch : false,
|
2020-12-19 01:55:52 +00:00
|
|
|
customEmojiCategories: emojiCategories,
|
|
|
|
customEmojis: this.$instance.emojis,
|
2020-11-07 01:43:27 +00:00
|
|
|
q: null,
|
|
|
|
searchResultCustom: [],
|
|
|
|
searchResultUnicode: [],
|
2021-02-27 10:53:20 +00:00
|
|
|
tab: 'index',
|
|
|
|
categories: ['face', 'people', 'animals_and_nature', 'food_and_drink', 'activity', 'travel_and_places', 'objects', 'symbols', 'flags'],
|
|
|
|
faGlobe, faClock, faChevronDown, faAsterisk, faLaugh, faUtensils, faLeaf, faShapes, faBicycle, faHashtag,
|
2020-01-29 19:37:25 +00:00
|
|
|
};
|
|
|
|
},
|
|
|
|
|
2020-11-07 01:43:27 +00:00
|
|
|
watch: {
|
|
|
|
q() {
|
2020-12-31 02:45:27 +00:00
|
|
|
this.$refs.emojis.scrollTop = 0;
|
|
|
|
|
2020-11-07 01:43:27 +00:00
|
|
|
if (this.q == null || this.q === '') {
|
|
|
|
this.searchResultCustom = [];
|
|
|
|
this.searchResultUnicode = [];
|
|
|
|
return;
|
|
|
|
}
|
2020-01-29 19:37:25 +00:00
|
|
|
|
2020-11-07 01:43:27 +00:00
|
|
|
const q = this.q.replace(/:/g, '');
|
|
|
|
|
|
|
|
const searchCustom = () => {
|
|
|
|
const max = 8;
|
|
|
|
const emojis = this.customEmojis;
|
|
|
|
const matches = new Set();
|
|
|
|
|
|
|
|
const exactMatch = emojis.find(e => e.name === q);
|
|
|
|
if (exactMatch) matches.add(exactMatch);
|
2020-01-29 19:37:25 +00:00
|
|
|
|
2020-11-07 12:28:28 +00:00
|
|
|
if (q.includes(' ')) { // AND検索
|
|
|
|
const keywords = q.split(' ');
|
|
|
|
|
|
|
|
// 名前にキーワードが含まれている
|
|
|
|
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
|
|
|
}
|
2020-11-07 12:28:28 +00:00
|
|
|
if (matches.size >= max) return matches;
|
2020-11-07 01:43:27 +00:00
|
|
|
|
2020-11-07 12:28:28 +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;
|
|
|
|
}
|
2020-11-07 01:43:27 +00:00
|
|
|
}
|
2020-11-07 12:28:28 +00:00
|
|
|
} else {
|
|
|
|
for (const emoji of emojis) {
|
|
|
|
if (emoji.name.startsWith(q)) {
|
|
|
|
matches.add(emoji);
|
|
|
|
if (matches.size >= max) break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (matches.size >= max) return matches;
|
2020-11-07 01:43:27 +00:00
|
|
|
|
2020-11-07 12:28:28 +00:00
|
|
|
for (const emoji of emojis) {
|
|
|
|
if (emoji.aliases.some(alias => alias.startsWith(q))) {
|
|
|
|
matches.add(emoji);
|
|
|
|
if (matches.size >= max) break;
|
|
|
|
}
|
2020-11-07 01:43:27 +00:00
|
|
|
}
|
2020-11-07 12:28:28 +00:00
|
|
|
if (matches.size >= max) return matches;
|
|
|
|
|
|
|
|
for (const emoji of emojis) {
|
|
|
|
if (emoji.name.includes(q)) {
|
|
|
|
matches.add(emoji);
|
|
|
|
if (matches.size >= max) break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (matches.size >= max) return matches;
|
2020-11-07 01:43:27 +00:00
|
|
|
|
2020-11-07 12:28:28 +00:00
|
|
|
for (const emoji of emojis) {
|
|
|
|
if (emoji.aliases.some(alias => alias.includes(q))) {
|
|
|
|
matches.add(emoji);
|
|
|
|
if (matches.size >= max) break;
|
|
|
|
}
|
2020-11-07 01:43:27 +00:00
|
|
|
}
|
|
|
|
}
|
2020-11-07 12:28:28 +00:00
|
|
|
|
2020-11-07 01:43:27 +00:00
|
|
|
return matches;
|
|
|
|
};
|
|
|
|
|
|
|
|
const searchUnicode = () => {
|
|
|
|
const max = 8;
|
|
|
|
const emojis = this.emojilist;
|
|
|
|
const matches = new Set();
|
|
|
|
|
|
|
|
const exactMatch = emojis.find(e => e.name === q);
|
|
|
|
if (exactMatch) matches.add(exactMatch);
|
|
|
|
|
2020-11-07 12:28:28 +00:00
|
|
|
if (q.includes(' ')) { // AND検索
|
|
|
|
const keywords = q.split(' ');
|
|
|
|
|
|
|
|
// 名前にキーワードが含まれている
|
|
|
|
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
|
|
|
}
|
2020-11-07 12:28:28 +00:00
|
|
|
if (matches.size >= max) return matches;
|
2020-11-07 01:43:27 +00:00
|
|
|
|
2020-11-07 12:28:28 +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
|
|
|
}
|
2020-11-07 12:28:28 +00:00
|
|
|
} else {
|
|
|
|
for (const emoji of emojis) {
|
|
|
|
if (emoji.name.startsWith(q)) {
|
|
|
|
matches.add(emoji);
|
|
|
|
if (matches.size >= max) break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (matches.size >= max) return matches;
|
2020-11-07 01:43:27 +00:00
|
|
|
|
2020-11-07 12:28:28 +00:00
|
|
|
for (const emoji of emojis) {
|
|
|
|
if (emoji.keywords.some(keyword => keyword.startsWith(q))) {
|
|
|
|
matches.add(emoji);
|
|
|
|
if (matches.size >= max) break;
|
|
|
|
}
|
2020-11-07 01:43:27 +00:00
|
|
|
}
|
2020-11-07 12:28:28 +00:00
|
|
|
if (matches.size >= max) return matches;
|
|
|
|
|
|
|
|
for (const emoji of emojis) {
|
|
|
|
if (emoji.name.includes(q)) {
|
|
|
|
matches.add(emoji);
|
|
|
|
if (matches.size >= max) break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (matches.size >= max) return matches;
|
2020-11-07 01:43:27 +00:00
|
|
|
|
2020-11-07 12:28:28 +00:00
|
|
|
for (const emoji of emojis) {
|
|
|
|
if (emoji.keywords.some(keyword => keyword.includes(q))) {
|
|
|
|
matches.add(emoji);
|
|
|
|
if (matches.size >= max) break;
|
|
|
|
}
|
2020-11-07 01:43:27 +00:00
|
|
|
}
|
|
|
|
}
|
2020-11-07 12:28:28 +00:00
|
|
|
|
2020-11-07 01:43:27 +00:00
|
|
|
return matches;
|
|
|
|
};
|
|
|
|
|
|
|
|
this.searchResultCustom = Array.from(searchCustom());
|
|
|
|
this.searchResultUnicode = Array.from(searchUnicode());
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
mounted() {
|
2021-02-27 16:09:59 +00:00
|
|
|
this.focus();
|
2020-11-07 01:43:27 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
2021-02-27 16:09:59 +00:00
|
|
|
focus() {
|
|
|
|
if (!isMobile && !isDeviceTouch) {
|
|
|
|
this.$refs.search.focus({
|
|
|
|
preventScroll: true
|
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2021-02-28 01:03:52 +00:00
|
|
|
reset() {
|
|
|
|
this.$refs.emojis.scrollTop = 0;
|
2021-03-05 13:47:29 +00:00
|
|
|
this.q = '';
|
2021-02-28 01:03:52 +00:00
|
|
|
},
|
|
|
|
|
2020-11-08 03:08:07 +00:00
|
|
|
getKey(emoji: any) {
|
|
|
|
return typeof emoji === 'string' ? emoji : (emoji.char || `:${emoji.name}:`);
|
|
|
|
},
|
|
|
|
|
2020-11-07 01:43:27 +00:00
|
|
|
chosen(emoji: any, ev) {
|
|
|
|
if (ev) {
|
|
|
|
const el = ev.currentTarget || ev.target;
|
|
|
|
const rect = el.getBoundingClientRect();
|
|
|
|
const x = rect.left + (el.clientWidth / 2);
|
|
|
|
const y = rect.top + (el.clientHeight / 2);
|
|
|
|
os.popup(Particle, { x, y }, {}, 'end');
|
2020-01-29 19:37:25 +00:00
|
|
|
}
|
|
|
|
|
2020-11-08 03:08:07 +00:00
|
|
|
const key = this.getKey(emoji);
|
2021-02-27 04:08:34 +00:00
|
|
|
this.$emit('chosen', key);
|
2020-11-07 01:43:27 +00:00
|
|
|
|
|
|
|
// 最近使った絵文字更新
|
2020-11-08 04:58:16 +00:00
|
|
|
if (!this.pinned.includes(key)) {
|
2020-12-19 01:55:52 +00:00
|
|
|
let recents = this.$store.state.recentlyUsedEmojis;
|
2020-11-08 04:58:16 +00:00
|
|
|
recents = recents.filter((e: any) => e !== key);
|
|
|
|
recents.unshift(key);
|
2021-02-27 10:53:20 +00:00
|
|
|
this.$store.set('recentlyUsedEmojis', recents.splice(0, 32));
|
2020-11-08 04:58:16 +00:00
|
|
|
}
|
2020-11-07 01:43:27 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
paste(event) {
|
|
|
|
const paste = (event.clipboardData || window.clipboardData).getData('text');
|
|
|
|
if (this.done(paste)) {
|
|
|
|
event.preventDefault();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
done(query) {
|
|
|
|
if (query == null) query = this.q;
|
|
|
|
if (query == null) return;
|
|
|
|
const q = query.replace(/:/g, '');
|
|
|
|
const exactMatchCustom = this.customEmojis.find(e => e.name === q);
|
|
|
|
if (exactMatchCustom) {
|
|
|
|
this.chosen(exactMatchCustom);
|
|
|
|
return true;
|
|
|
|
}
|
2020-11-07 01:56:38 +00:00
|
|
|
const exactMatchUnicode = this.emojilist.find(e => e.char === q || e.name === q);
|
2020-11-07 01:43:27 +00:00
|
|
|
if (exactMatchUnicode) {
|
|
|
|
this.chosen(exactMatchUnicode);
|
|
|
|
return true;
|
|
|
|
}
|
2020-11-07 12:33:36 +00:00
|
|
|
if (this.searchResultCustom.length > 0) {
|
|
|
|
this.chosen(this.searchResultCustom[0]);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (this.searchResultUnicode.length > 0) {
|
|
|
|
this.chosen(this.searchResultUnicode[0]);
|
|
|
|
return true;
|
|
|
|
}
|
2020-01-29 19:37:25 +00:00
|
|
|
},
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.omfetrab {
|
2020-11-14 02:47:30 +00:00
|
|
|
$pad: 8px;
|
2020-11-18 03:09:14 +00:00
|
|
|
--eachSize: 40px;
|
2020-11-14 02:47:30 +00:00
|
|
|
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
2020-11-07 01:43:27 +00:00
|
|
|
contain: content;
|
2020-11-14 02:47:30 +00:00
|
|
|
|
2020-11-18 03:09:14 +00:00
|
|
|
&.big {
|
|
|
|
--eachSize: 44px;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.w1 {
|
|
|
|
width: calc((var(--eachSize) * 5) + (#{$pad} * 2));
|
|
|
|
}
|
|
|
|
|
|
|
|
&.w2 {
|
|
|
|
width: calc((var(--eachSize) * 6) + (#{$pad} * 2));
|
|
|
|
}
|
|
|
|
|
|
|
|
&.w3 {
|
|
|
|
width: calc((var(--eachSize) * 7) + (#{$pad} * 2));
|
|
|
|
}
|
|
|
|
|
|
|
|
&.h1 {
|
|
|
|
--height: calc((var(--eachSize) * 4) + (#{$pad} * 2));
|
|
|
|
}
|
|
|
|
|
|
|
|
&.h2 {
|
|
|
|
--height: calc((var(--eachSize) * 6) + (#{$pad} * 2));
|
|
|
|
}
|
|
|
|
|
|
|
|
&.h3 {
|
|
|
|
--height: calc((var(--eachSize) * 8) + (#{$pad} * 2));
|
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;
|
|
|
|
border-top: solid 1px var(--divider);
|
|
|
|
|
|
|
|
&.active {
|
|
|
|
border-top: solid 1px var(--accent);
|
|
|
|
color: var(--accent);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-01-29 19:37:25 +00:00
|
|
|
> .emojis {
|
2020-11-14 02:47:30 +00:00
|
|
|
height: var(--height);
|
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;
|
|
|
|
border-top: solid 1px var(--divider);
|
|
|
|
}
|
|
|
|
|
|
|
|
> 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
|
|
|
|
2020-11-07 01:43:27 +00:00
|
|
|
&:focus {
|
|
|
|
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 {
|
|
|
|
border-bottom: solid 1px 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>
|