yandere_fe/src/components/emoji_picker/emoji_picker.vue

113 lines
3.0 KiB
Vue
Raw Normal View History

2019-03-29 08:49:32 -07:00
<template>
<div class="emoji-picker panel panel-default panel-body">
<div class="heading">
<span class="emoji-tabs">
<span
v-for="group in emojis"
:key="group.id"
class="emoji-tabs-item"
:class="{
active: activeGroupView === group.id,
disabled: group.emojis.length === 0
}"
:title="group.text"
@click.prevent="highlight(group.id)"
>
<i :class="group.icon" />
</span>
</span>
<span
2019-09-12 10:36:43 -07:00
v-if="stickerPickerEnabled"
class="additional-tabs"
>
<span
class="stickers-tab-icon additional-tabs-item"
:class="{active: showingStickers}"
:title="$t('emoji.stickers')"
@click.prevent="toggleStickers"
>
<i class="icon-star" />
</span>
2019-07-28 14:10:43 -07:00
</span>
</div>
<div class="content">
2019-07-28 14:10:43 -07:00
<div
class="emoji-content"
:class="{hidden: showingStickers}"
2019-07-28 14:10:43 -07:00
>
<div class="emoji-search">
<input
v-model="keyword"
type="text"
class="form-control"
:placeholder="$t('emoji.search_emoji')"
>
</div>
2019-07-28 14:10:43 -07:00
<div
ref="emoji-groups"
class="emoji-groups"
:class="groupsScrolledClass"
@scroll="scrolledGroup"
2019-07-28 14:10:43 -07:00
>
<div
v-for="group in emojisView"
:key="group.id"
class="emoji-group"
>
<h6
:ref="'group-' + group.id"
class="emoji-group-title"
2019-07-28 14:10:43 -07:00
>
{{ group.text }}
</h6>
<span
v-for="emoji in group.emojis"
:key="group.id + emoji.displayText"
:title="emoji.displayText"
class="emoji-item"
@click.stop.prevent="onEmoji(emoji)"
>
2019-09-12 09:15:22 -07:00
<span v-if="!emoji.imageUrl">{{ emoji.replacement }}</span>
<img
v-else
:src="emoji.imageUrl"
2019-09-12 09:15:22 -07:00
>
</span>
</div>
2019-07-28 14:10:43 -07:00
</div>
<div class="keep-open">
<Checkbox v-model="keepOpen">
{{ $t('emoji.keep_open') }}
</Checkbox>
</div>
2019-10-08 11:34:36 -07:00
<div
v-if="askForSanity"
class="too-many-emoji"
>
<div class="alert warning hint">
{{ $t('emoji.load_all_hint', { saneAmount } ) }}
</div>
<button
class="btn btn-default"
@click.prevent="loadEmojiInsane"
2019-10-08 11:34:36 -07:00
>
{{ $t('emoji.load_all', { emojiAmount: filteredEmoji.length } ) }}
</button>
</div>
2019-03-29 09:48:52 -07:00
</div>
<div
v-if="showingStickers"
class="stickers-content"
>
<sticker-picker
@uploaded="onStickerUploaded"
@upload-failed="onStickerUploadFailed"
/>
</div>
2019-03-29 08:49:32 -07:00
</div>
</div>
2019-03-29 08:49:32 -07:00
</template>
2019-08-12 03:18:37 -07:00
<script src="./emoji_picker.js"></script>
<style lang="scss" src="./emoji_picker.scss"></style>