2019-03-29 15:49:32 +00:00
|
|
|
<template>
|
|
|
|
<div class="emoji-dropdown">
|
2019-03-29 20:34:59 +00:00
|
|
|
<span class="emoji-dropdown-toggle" @click="togglePanel">
|
|
|
|
<i class="icon-smile"></i>
|
|
|
|
</span>
|
2019-03-29 16:48:52 +00:00
|
|
|
<div class="emoji-dropdown-menu panel panel-default" v-if="open">
|
|
|
|
<div class="panel-heading emoji-tabs">
|
|
|
|
<span class="emoji-tabs-item" v-for="(value, key) in emojis" :key="key" :title="value.text">
|
|
|
|
<i :class="value.icon"></i>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
<div class="panel-body emoji-dropdown-menu-content">
|
|
|
|
<div class="emoji-search">
|
|
|
|
<input type="text" class="form-control" v-model="keyword" />
|
|
|
|
</div>
|
|
|
|
<div class="emoji-groups">
|
|
|
|
<div v-for="(value, key) in emojis" :key="key" class="emoji-group">
|
|
|
|
<h6 class="emoji-group-title">{{value.text}}</h6>
|
2019-03-29 19:56:50 +00:00
|
|
|
<span
|
|
|
|
v-for="emoji in value.emojis"
|
|
|
|
:key="key + emoji.shortcode"
|
|
|
|
:title="emoji.shortcode"
|
|
|
|
class="emoji-item"
|
|
|
|
@click="onEmoji(emoji)"
|
|
|
|
>
|
2019-03-29 16:48:52 +00:00
|
|
|
<span v-if="!emoji.image_url">{{emoji.utf}}</span>
|
|
|
|
<img :src="'https://bikeshed.party' + emoji.image_url" v-else>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2019-03-29 15:49:32 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script src="./emoji-selector.js"></script>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
@import '../../_variables.scss';
|
|
|
|
|
|
|
|
.emoji {
|
|
|
|
&-dropdown {
|
2019-03-29 19:56:50 +00:00
|
|
|
position: absolute;
|
2019-03-29 20:34:59 +00:00
|
|
|
right: 0;
|
|
|
|
top: 100%;
|
2019-03-29 19:56:50 +00:00
|
|
|
z-index: 1;
|
2019-03-29 15:49:32 +00:00
|
|
|
|
|
|
|
&-toggle {
|
|
|
|
cursor: pointer;
|
2019-03-29 19:56:50 +00:00
|
|
|
position: absolute;
|
2019-03-29 20:34:59 +00:00
|
|
|
top: -25px;
|
|
|
|
right: 2px;
|
|
|
|
|
|
|
|
i {
|
|
|
|
font-size: 18px;
|
|
|
|
}
|
2019-03-29 15:49:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
&-menu {
|
|
|
|
position: absolute;
|
|
|
|
z-index: 1;
|
|
|
|
right: 0;
|
|
|
|
width: 300px;
|
|
|
|
height: 300px;
|
|
|
|
display: flex;
|
2019-03-29 16:48:52 +00:00
|
|
|
flex-direction: column;
|
2019-03-29 19:56:50 +00:00
|
|
|
margin: 0 !important;
|
2019-03-29 16:48:52 +00:00
|
|
|
|
|
|
|
&-content {
|
|
|
|
flex: 1 1 1px;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&-tabs {
|
|
|
|
&-item {
|
|
|
|
padding: 0 5px;
|
|
|
|
|
|
|
|
&:first-child, &.active {
|
|
|
|
border-bottom: 4px solid;
|
|
|
|
|
|
|
|
i {
|
|
|
|
color: $fallback--lightText;
|
|
|
|
color: var(--lightText, $fallback--lightText);
|
|
|
|
}
|
2019-03-29 15:49:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-03-29 16:48:52 +00:00
|
|
|
&-search {
|
|
|
|
padding: 5px;
|
|
|
|
}
|
|
|
|
|
|
|
|
&-groups {
|
|
|
|
flex: 1 1 1px;
|
|
|
|
overflow: auto;
|
|
|
|
}
|
|
|
|
|
|
|
|
&-group {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
width: 100%;
|
|
|
|
|
|
|
|
&-title {
|
|
|
|
font-size: 12px;
|
|
|
|
width: 100%;
|
|
|
|
margin: 0;
|
|
|
|
padding: 5px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-03-29 15:49:32 +00:00
|
|
|
&-item {
|
|
|
|
width: 34px;
|
|
|
|
height: 34px;
|
|
|
|
box-sizing: border-box;
|
|
|
|
display: flex;
|
|
|
|
font-size: 16px;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
padding: 5px;
|
|
|
|
cursor: pointer;
|
2019-03-29 16:48:52 +00:00
|
|
|
|
|
|
|
img {
|
|
|
|
max-width: 100%;
|
|
|
|
max-height: 100%;
|
|
|
|
}
|
2019-03-29 15:49:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
</style>
|