1
0
mirror of https://github.com/misskey-dev/misskey synced 2024-12-24 03:28:43 +09:00
misskey/src/client/components/sequential-entrance.vue

81 lines
1.4 KiB
Vue
Raw Normal View History

<template>
2020-02-06 19:11:14 +09:00
<transition-group v-if="$store.state.device.animation"
2020-02-15 18:39:45 +09:00
class="uupnnhew"
:data-direction="direction"
:data-reversed="reversed ? 'true' : 'false'"
name="staggered"
tag="div"
appear
>
<slot></slot>
</transition-group>
2020-02-06 19:11:14 +09:00
<div v-else>
<slot></slot>
</div>
</template>
<script lang="ts">
import Vue from 'vue';
export default Vue.extend({
props: {
delay: {
type: Number,
required: false,
default: 40
},
direction: {
type: String,
required: false,
default: 'down'
2020-02-06 14:23:01 +09:00
},
reversed: {
type: Boolean,
required: false,
default: false
}
},
methods: {
focus() {
this.$slots.default[0].elm.focus();
}
2020-02-15 18:39:45 +09:00
},
});
</script>
<style lang="scss">
2020-02-15 18:39:45 +09:00
.staggered-move {
transition: all 0.7s cubic-bezier(0.23, 1, 0.32, 1) !important;
}
.uupnnhew[data-direction="up"] {
.staggered-enter {
opacity: 0;
transform: translateY(64px);
}
}
.uupnnhew[data-direction="down"] {
.staggered-enter {
opacity: 0;
transform: translateY(-64px);
}
}
.uupnnhew[data-reversed="true"] {
@for $i from 1 through 30 {
.staggered-enter-active:nth-last-child(#{$i}) {
transition: all 0.7s cubic-bezier(0.23, 1, 0.32, 1) (15ms * ($i - 1));
}
}
}
.uupnnhew[data-reversed="false"] {
@for $i from 1 through 30 {
.staggered-enter-active:nth-child(#{$i}) {
transition: all 0.7s cubic-bezier(0.23, 1, 0.32, 1) (15ms * ($i - 1));
}
}
}
</style>