2020-01-29 20:37:25 +01:00
|
|
|
<template>
|
2020-10-17 13:12:00 +02:00
|
|
|
<MkModal ref="modal" :src="src" @click="$refs.modal.close()" @closed="$emit('closed')">
|
2020-11-14 03:47:30 +01:00
|
|
|
<div class="omfetrab _popup" :class="{ compact }">
|
|
|
|
<input ref="search" class="search" :class="{ filled: q != null && q != '' }" v-model.trim="q" :placeholder="$t('search')" @paste.stop="paste" @keyup.enter="done()">
|
2020-01-29 20:37:25 +01:00
|
|
|
<div class="emojis">
|
2020-11-07 02:43:27 +01:00
|
|
|
<section class="result">
|
|
|
|
<div v-if="searchResultCustom.length > 0">
|
|
|
|
<button v-for="emoji in searchResultCustom"
|
2020-01-29 20:37:25 +01:00
|
|
|
class="_button"
|
|
|
|
:title="emoji.name"
|
2020-11-07 02:43:27 +01:00
|
|
|
@click="chosen(emoji, $event)"
|
2020-10-17 13:12:00 +02:00
|
|
|
:key="emoji"
|
2020-11-07 02:43:27 +01:00
|
|
|
tabindex="0"
|
2020-01-29 20:37:25 +01:00
|
|
|
>
|
2020-10-17 13:12:00 +02:00
|
|
|
<MkEmoji v-if="emoji.char != null" :emoji="emoji.char"/>
|
2020-01-29 20:37:25 +01:00
|
|
|
<img v-else :src="$store.state.device.disableShowingAnimatedImages ? getStaticImageUrl(emoji.url) : emoji.url"/>
|
|
|
|
</button>
|
|
|
|
</div>
|
2020-11-07 02:43:27 +01:00
|
|
|
<div v-if="searchResultUnicode.length > 0">
|
|
|
|
<button v-for="emoji in searchResultUnicode"
|
2020-01-29 20:37:25 +01:00
|
|
|
class="_button"
|
|
|
|
:title="emoji.name"
|
2020-11-07 02:43:27 +01:00
|
|
|
@click="chosen(emoji, $event)"
|
2020-01-29 20:37:25 +01:00
|
|
|
:key="emoji.name"
|
2020-11-07 02:43:27 +01:00
|
|
|
tabindex="0"
|
2020-01-29 20:37:25 +01:00
|
|
|
>
|
2020-10-17 13:12:00 +02:00
|
|
|
<MkEmoji :emoji="emoji.char"/>
|
2020-01-29 20:37:25 +01:00
|
|
|
</button>
|
|
|
|
</div>
|
2020-11-07 02:43:27 +01:00
|
|
|
</section>
|
|
|
|
|
|
|
|
<div class="index">
|
|
|
|
<section>
|
|
|
|
<div>
|
2020-11-08 05:58:16 +01:00
|
|
|
<button v-for="emoji in pinned"
|
2020-11-07 02:43:27 +01:00
|
|
|
class="_button"
|
|
|
|
@click="chosen(emoji, $event)"
|
|
|
|
tabindex="0"
|
|
|
|
>
|
2020-11-08 04:08:07 +01:00
|
|
|
<MkEmoji :emoji="emoji" :normal="true"/>
|
2020-11-07 02:43:27 +01:00
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
<section>
|
2020-11-14 03:47:30 +01:00
|
|
|
<header class="_acrylic"><Fa :icon="faClock" fixed-width/> {{ $t('recentUsed') }}</header>
|
2020-11-07 02:43:27 +01:00
|
|
|
<div>
|
2020-11-08 04:08:07 +01:00
|
|
|
<button v-for="emoji in $store.state.device.recentlyUsedEmojis"
|
2020-01-29 20:37:25 +01:00
|
|
|
class="_button"
|
2020-11-07 02:43:27 +01:00
|
|
|
@click="chosen(emoji, $event)"
|
|
|
|
:key="emoji"
|
2020-01-29 20:37:25 +01:00
|
|
|
>
|
2020-11-08 04:08:07 +01:00
|
|
|
<MkEmoji :emoji="emoji" :normal="true"/>
|
2020-01-29 20:37:25 +01:00
|
|
|
</button>
|
|
|
|
</div>
|
2020-11-07 02:43:27 +01:00
|
|
|
</section>
|
|
|
|
|
|
|
|
<div class="arrow"><Fa :icon="faChevronDown"/></div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<section v-for="category in customEmojiCategories" :key="'custom:' + category" class="custom">
|
|
|
|
<header class="_acrylic" v-appear="() => visibleCategories[category] = true">{{ category || $t('other') }}</header>
|
|
|
|
<div v-if="visibleCategories[category]">
|
|
|
|
<button v-for="emoji in customEmojis.filter(e => e.category === category)"
|
|
|
|
class="_button"
|
|
|
|
:title="emoji.name"
|
|
|
|
@click="chosen(emoji, $event)"
|
|
|
|
:key="emoji.name"
|
|
|
|
>
|
|
|
|
<img :src="$store.state.device.disableShowingAnimatedImages ? getStaticImageUrl(emoji.url) : emoji.url"/>
|
|
|
|
</button>
|
2020-01-29 20:37:25 +01:00
|
|
|
</div>
|
2020-11-07 02:43:27 +01:00
|
|
|
</section>
|
|
|
|
|
|
|
|
<section v-for="category in categories" :key="category.name" class="unicode">
|
|
|
|
<header class="_acrylic" v-appear="() => category.isActive = true"><Fa :icon="category.icon" fixed-width/> {{ category.name }}</header>
|
|
|
|
<div v-if="category.isActive">
|
|
|
|
<button v-for="emoji in emojilist.filter(e => e.category === category.name)"
|
|
|
|
class="_button"
|
|
|
|
:title="emoji.name"
|
|
|
|
@click="chosen(emoji, $event)"
|
|
|
|
:key="emoji.name"
|
|
|
|
>
|
|
|
|
<MkEmoji :emoji="emoji.char"/>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</section>
|
2020-01-29 20:37:25 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
2020-10-17 13:12:00 +02:00
|
|
|
</MkModal>
|
2020-01-29 20:37:25 +01:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2020-11-03 07:49:31 +01:00
|
|
|
import { defineComponent, markRaw } from 'vue';
|
2020-01-29 20:37:25 +01:00
|
|
|
import { emojilist } from '../../misc/emojilist';
|
2020-10-17 13:12:00 +02:00
|
|
|
import { getStaticImageUrl } from '@/scripts/get-static-image-url';
|
2020-11-14 03:47:30 +01:00
|
|
|
import { faAsterisk, faLeaf, faUtensils, faFutbol, faCity, faDice, faGlobe, faClock, faUser, faChevronDown } from '@fortawesome/free-solid-svg-icons';
|
2020-01-29 20:37:25 +01:00
|
|
|
import { faHeart, faFlag, faLaugh } from '@fortawesome/free-regular-svg-icons';
|
2020-10-17 13:12:00 +02:00
|
|
|
import MkModal from '@/components/ui/modal.vue';
|
2020-11-07 02:43:27 +01:00
|
|
|
import Particle from '@/components/particle.vue';
|
|
|
|
import * as os from '@/os';
|
2020-01-29 20:37:25 +01:00
|
|
|
|
2020-10-17 13:12:00 +02:00
|
|
|
export default defineComponent({
|
2020-01-29 20:37:25 +01:00
|
|
|
components: {
|
2020-10-17 13:12:00 +02:00
|
|
|
MkModal,
|
2020-01-29 20:37:25 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
props: {
|
2020-10-17 13:12:00 +02:00
|
|
|
src: {
|
|
|
|
required: false
|
2020-01-29 20:37:25 +01:00
|
|
|
},
|
2020-11-08 05:58:16 +01:00
|
|
|
overridePinned: {
|
2020-11-07 02:43:27 +01:00
|
|
|
required: false
|
|
|
|
},
|
2020-11-14 03:47:30 +01:00
|
|
|
compact: {
|
|
|
|
required: false
|
|
|
|
},
|
2020-01-29 20:37:25 +01:00
|
|
|
},
|
|
|
|
|
2020-10-17 13:12:00 +02:00
|
|
|
emits: ['done', 'closed'],
|
|
|
|
|
2020-01-29 20:37:25 +01:00
|
|
|
data() {
|
|
|
|
return {
|
2020-11-03 07:49:31 +01:00
|
|
|
emojilist: markRaw(emojilist),
|
2020-01-29 20:37:25 +01:00
|
|
|
getStaticImageUrl,
|
2020-11-08 05:58:16 +01:00
|
|
|
pinned: this.overridePinned || this.$store.state.settings.reactions,
|
2020-11-07 02:43:27 +01:00
|
|
|
customEmojiCategories: this.$store.getters['instance/emojiCategories'],
|
|
|
|
customEmojis: this.$store.state.instance.meta.emojis,
|
|
|
|
visibleCategories: {},
|
|
|
|
q: null,
|
|
|
|
searchResultCustom: [],
|
|
|
|
searchResultUnicode: [],
|
2020-11-14 03:47:30 +01:00
|
|
|
faGlobe, faClock, faChevronDown,
|
2020-01-29 20:37:25 +01:00
|
|
|
categories: [{
|
2020-05-15 13:49:01 +02:00
|
|
|
name: 'face',
|
2020-01-29 20:37:25 +01:00
|
|
|
icon: faLaugh,
|
|
|
|
isActive: false
|
2020-05-15 13:49:01 +02:00
|
|
|
}, {
|
|
|
|
name: 'people',
|
|
|
|
icon: faUser,
|
|
|
|
isActive: false
|
2020-01-29 20:37:25 +01:00
|
|
|
}, {
|
|
|
|
name: 'animals_and_nature',
|
|
|
|
icon: faLeaf,
|
|
|
|
isActive: false
|
|
|
|
}, {
|
|
|
|
name: 'food_and_drink',
|
|
|
|
icon: faUtensils,
|
|
|
|
isActive: false
|
|
|
|
}, {
|
|
|
|
name: 'activity',
|
|
|
|
icon: faFutbol,
|
|
|
|
isActive: false
|
|
|
|
}, {
|
|
|
|
name: 'travel_and_places',
|
|
|
|
icon: faCity,
|
|
|
|
isActive: false
|
|
|
|
}, {
|
|
|
|
name: 'objects',
|
|
|
|
icon: faDice,
|
|
|
|
isActive: false
|
|
|
|
}, {
|
|
|
|
name: 'symbols',
|
|
|
|
icon: faHeart,
|
|
|
|
isActive: false
|
|
|
|
}, {
|
|
|
|
name: 'flags',
|
|
|
|
icon: faFlag,
|
|
|
|
isActive: false
|
2020-05-06 07:46:45 +02:00
|
|
|
}],
|
|
|
|
faAsterisk
|
2020-01-29 20:37:25 +01:00
|
|
|
};
|
|
|
|
},
|
|
|
|
|
2020-11-07 02:43:27 +01:00
|
|
|
watch: {
|
|
|
|
q() {
|
|
|
|
if (this.q == null || this.q === '') {
|
|
|
|
this.searchResultCustom = [];
|
|
|
|
this.searchResultUnicode = [];
|
|
|
|
return;
|
|
|
|
}
|
2020-01-29 20:37:25 +01:00
|
|
|
|
2020-11-07 02:43:27 +01: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 20:37:25 +01:00
|
|
|
|
2020-11-07 13:28:28 +01: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 02:43:27 +01:00
|
|
|
}
|
2020-11-07 13:28:28 +01:00
|
|
|
if (matches.size >= max) return matches;
|
2020-11-07 02:43:27 +01:00
|
|
|
|
2020-11-07 13:28:28 +01: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 02:43:27 +01:00
|
|
|
}
|
2020-11-07 13:28:28 +01: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 02:43:27 +01:00
|
|
|
|
2020-11-07 13:28:28 +01: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 02:43:27 +01:00
|
|
|
}
|
2020-11-07 13:28:28 +01: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 02:43:27 +01:00
|
|
|
|
2020-11-07 13:28:28 +01: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 02:43:27 +01:00
|
|
|
}
|
|
|
|
}
|
2020-11-07 13:28:28 +01:00
|
|
|
|
2020-11-07 02:43:27 +01: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 13:28:28 +01: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 02:43:27 +01:00
|
|
|
}
|
2020-11-07 13:28:28 +01:00
|
|
|
if (matches.size >= max) return matches;
|
2020-11-07 02:43:27 +01:00
|
|
|
|
2020-11-07 13:28:28 +01: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 02:43:27 +01:00
|
|
|
}
|
2020-11-07 13:28:28 +01: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 02:43:27 +01:00
|
|
|
|
2020-11-07 13:28:28 +01: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 02:43:27 +01:00
|
|
|
}
|
2020-11-07 13:28:28 +01: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 02:43:27 +01:00
|
|
|
|
2020-11-07 13:28:28 +01: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 02:43:27 +01:00
|
|
|
}
|
|
|
|
}
|
2020-11-07 13:28:28 +01:00
|
|
|
|
2020-11-07 02:43:27 +01:00
|
|
|
return matches;
|
|
|
|
};
|
|
|
|
|
|
|
|
this.searchResultCustom = Array.from(searchCustom());
|
|
|
|
this.searchResultUnicode = Array.from(searchUnicode());
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
mounted() {
|
2020-11-14 03:47:30 +01:00
|
|
|
const isIos = navigator.userAgent.includes('WebKit') && !navigator.userAgent.includes('Chrome');
|
|
|
|
if (!isIos) {
|
|
|
|
this.$refs.search.focus({
|
|
|
|
preventScroll: true
|
|
|
|
});
|
|
|
|
}
|
2020-11-07 02:43:27 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
2020-11-08 04:08:07 +01:00
|
|
|
getKey(emoji: any) {
|
|
|
|
return typeof emoji === 'string' ? emoji : (emoji.char || `:${emoji.name}:`);
|
|
|
|
},
|
|
|
|
|
2020-11-07 02:43:27 +01: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 20:37:25 +01:00
|
|
|
}
|
|
|
|
|
2020-11-08 04:08:07 +01:00
|
|
|
const key = this.getKey(emoji);
|
|
|
|
this.$emit('done', key);
|
2020-11-07 02:43:27 +01:00
|
|
|
this.$refs.modal.close();
|
|
|
|
|
|
|
|
// 最近使った絵文字更新
|
2020-11-08 05:58:16 +01:00
|
|
|
if (!this.pinned.includes(key)) {
|
|
|
|
let recents = this.$store.state.device.recentlyUsedEmojis;
|
|
|
|
recents = recents.filter((e: any) => e !== key);
|
|
|
|
recents.unshift(key);
|
|
|
|
this.$store.commit('device/set', { key: 'recentlyUsedEmojis', value: recents.splice(0, 16) });
|
|
|
|
}
|
2020-11-07 02:43:27 +01: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 02:56:38 +01:00
|
|
|
const exactMatchUnicode = this.emojilist.find(e => e.char === q || e.name === q);
|
2020-11-07 02:43:27 +01:00
|
|
|
if (exactMatchUnicode) {
|
|
|
|
this.chosen(exactMatchUnicode);
|
|
|
|
return true;
|
|
|
|
}
|
2020-11-07 13:33:36 +01: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 20:37:25 +01:00
|
|
|
},
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.omfetrab {
|
2020-11-14 03:47:30 +01:00
|
|
|
$eachSize: 40px;
|
|
|
|
$pad: 8px;
|
|
|
|
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
width: ($eachSize * 7) + ($pad * 2);
|
2020-11-07 02:43:27 +01:00
|
|
|
contain: content;
|
2020-11-14 03:47:30 +01:00
|
|
|
--height: 300px;
|
|
|
|
|
|
|
|
&.compact {
|
|
|
|
width: ($eachSize * 5) + ($pad * 2);
|
|
|
|
--height: 210px;
|
|
|
|
}
|
2020-01-29 20:37:25 +01:00
|
|
|
|
2020-11-07 02:43:27 +01: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 03:47:30 +01:00
|
|
|
|
|
|
|
&:not(.filled) {
|
|
|
|
order: 1;
|
|
|
|
z-index: 2;
|
|
|
|
box-shadow: 0px -1px 0 0px var(--divider);
|
|
|
|
}
|
2020-01-29 20:37:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
> .emojis {
|
2020-11-14 03:47:30 +01:00
|
|
|
height: var(--height);
|
2020-01-29 20:37:25 +01:00
|
|
|
overflow-y: auto;
|
|
|
|
overflow-x: hidden;
|
|
|
|
|
2020-11-14 03:47:30 +01:00
|
|
|
scrollbar-width: none;
|
|
|
|
|
|
|
|
&::-webkit-scrollbar {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
2020-11-07 02:43:27 +01:00
|
|
|
> .index {
|
2020-11-14 03:47:30 +01:00
|
|
|
min-height: var(--height);
|
2020-11-07 02:43:27 +01:00
|
|
|
position: relative;
|
|
|
|
border-bottom: solid 1px var(--divider);
|
|
|
|
|
|
|
|
> .arrow {
|
|
|
|
position: absolute;
|
|
|
|
bottom: 0;
|
|
|
|
left: 0;
|
|
|
|
width: 100%;
|
|
|
|
padding: 16px 0;
|
|
|
|
text-align: center;
|
|
|
|
opacity: 0.5;
|
|
|
|
pointer-events: none;
|
|
|
|
}
|
2020-01-29 20:37:25 +01:00
|
|
|
}
|
|
|
|
|
2020-11-07 02:43:27 +01:00
|
|
|
section {
|
|
|
|
> header {
|
|
|
|
position: sticky;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
z-index: 1;
|
|
|
|
padding: 8px;
|
|
|
|
font-size: 12px;
|
|
|
|
}
|
2020-01-29 20:37:25 +01:00
|
|
|
|
2020-11-07 02:43:27 +01:00
|
|
|
> div {
|
2020-11-14 03:47:30 +01:00
|
|
|
padding: $pad;
|
2020-01-29 20:37:25 +01:00
|
|
|
|
2020-11-07 02:43:27 +01:00
|
|
|
> button {
|
|
|
|
position: relative;
|
|
|
|
padding: 0;
|
2020-11-14 03:47:30 +01:00
|
|
|
width: $eachSize;
|
|
|
|
height: $eachSize;
|
|
|
|
border-radius: 4px;
|
2020-01-29 20:37:25 +01:00
|
|
|
|
2020-11-07 02:43:27 +01:00
|
|
|
&:focus {
|
|
|
|
outline: solid 2px var(--focus);
|
|
|
|
z-index: 1;
|
|
|
|
}
|
|
|
|
|
2020-11-14 03:47:30 +01:00
|
|
|
&:hover {
|
|
|
|
background: rgba(0, 0, 0, 0.05);
|
2020-11-07 02:43:27 +01:00
|
|
|
}
|
|
|
|
|
2020-11-14 03:47:30 +01:00
|
|
|
&:active {
|
|
|
|
background: var(--accent);
|
|
|
|
box-shadow: inset 0 0.15em 0.3em rgba(27, 31, 35, 0.15);
|
2020-11-07 02:43:27 +01:00
|
|
|
}
|
2020-01-29 20:37:25 +01:00
|
|
|
|
|
|
|
> * {
|
2020-11-14 03:47:30 +01:00
|
|
|
font-size: 24px;
|
|
|
|
height: 1.25em;
|
|
|
|
vertical-align: -.25em;
|
2020-11-07 02:43:27 +01:00
|
|
|
pointer-events: none;
|
2020-01-29 20:37:25 +01:00
|
|
|
}
|
|
|
|
}
|
2020-11-07 02:43:27 +01:00
|
|
|
}
|
2020-01-29 20:37:25 +01:00
|
|
|
|
2020-11-07 02:43:27 +01:00
|
|
|
&.result {
|
|
|
|
border-bottom: solid 1px var(--divider);
|
2020-11-14 03:47:30 +01:00
|
|
|
|
|
|
|
&:empty {
|
|
|
|
display: none;
|
|
|
|
}
|
2020-11-07 02:43:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
&.unicode {
|
|
|
|
min-height: 384px;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.custom {
|
|
|
|
min-height: 64px;
|
2020-01-29 20:37:25 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|