1
0
mirror of https://github.com/MisskeyIO/misskey synced 2024-12-23 11:08:22 +09:00
MisskeyIO/packages/frontend/src/components/MkReactionsViewer.vue

60 lines
1.5 KiB
Vue
Raw Normal View History

2018-02-07 18:34:43 +09:00
<template>
2022-12-30 14:10:00 +09:00
<Transition :name="$store.state.animation ? 'y' : ''">
<TransitionGroup v-if="Object.keys(note.reactions).length > 0" :name="$store.state.animation ? 'x' : ''" tag="div" class="tdflqwzn" :class="{ isMe }">
2022-12-30 13:52:40 +09:00
<XReaction v-for="(count, reaction) in note.reactions" :key="reaction" :reaction="reaction" :count="count" :is-initial="initialReactions.has(reaction)" :note="note"/>
</TransitionGroup>
2022-12-30 14:10:00 +09:00
</Transition>
2018-02-07 18:34:43 +09:00
</template>
<script lang="ts" setup>
import { computed } from 'vue';
import * as misskey from 'misskey-js';
import { $i } from '@/account';
import XReaction from '@/components/MkReactionsViewer.reaction.vue';
const props = defineProps<{
note: misskey.entities.Note;
}>();
const initialReactions = new Set(Object.keys(props.note.reactions));
const isMe = computed(() => $i && $i.id === props.note.userId);
2018-02-07 18:41:48 +09:00
</script>
<style lang="scss" scoped>
2022-12-30 14:10:00 +09:00
.y-enter-active, .y-leave-active {
overflow: clip;
max-height: 36px;
transition: opacity 0.2s cubic-bezier(0,.5,.5,1), max-height 0.2s cubic-bezier(0,.5,.5,1) !important;
}
.y-enter-from, .y-leave-to {
max-height: 0px;
opacity: 0;
}
2022-12-30 13:52:40 +09:00
.x-move, .x-enter-active, .x-leave-active {
transition: opacity 0.2s cubic-bezier(0,.5,.5,1), transform 0.2s cubic-bezier(0,.5,.5,1) !important;
}
.x-enter-from, .x-leave-to {
opacity: 0;
transform: scale(0.7);
}
.x-leave-active {
position: absolute;
}
2020-02-22 06:43:46 +09:00
.tdflqwzn {
margin: 4px -2px 0 -2px;
2018-02-07 18:41:48 +09:00
&:empty {
display: none;
}
2018-02-07 18:41:48 +09:00
&.isMe {
> span {
cursor: default !important;
}
}
}
2018-02-07 18:41:48 +09:00
</style>