This commit is contained in:
syuilo 2022-12-30 14:10:00 +09:00
parent 2244cf2995
commit 4767804bcc
1 changed files with 13 additions and 1 deletions

View File

@ -1,9 +1,11 @@
<template> <template>
<div class="tdflqwzn" :class="{ isMe }"> <Transition :name="$store.state.animation ? 'y' : ''">
<div v-if="Object.keys(note.reactions).length > 0" class="tdflqwzn" :class="{ isMe }">
<TransitionGroup :name="$store.state.animation ? 'x' : ''"> <TransitionGroup :name="$store.state.animation ? 'x' : ''">
<XReaction v-for="(count, reaction) in note.reactions" :key="reaction" :reaction="reaction" :count="count" :is-initial="initialReactions.has(reaction)" :note="note"/> <XReaction v-for="(count, reaction) in note.reactions" :key="reaction" :reaction="reaction" :count="count" :is-initial="initialReactions.has(reaction)" :note="note"/>
</TransitionGroup> </TransitionGroup>
</div> </div>
</Transition>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
@ -22,6 +24,16 @@ const isMe = computed(() => $i && $i.id === props.note.userId);
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.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;
}
.x-move, .x-enter-active, .x-leave-active { .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; transition: opacity 0.2s cubic-bezier(0,.5,.5,1), transform 0.2s cubic-bezier(0,.5,.5,1) !important;
} }