rudeshark.net/src/client/components/sequential-entrance.vue

41 lines
704 B
Vue
Raw Normal View History

<template>
2020-02-06 11:11:14 +01:00
<transition-group v-if="$store.state.device.animation"
2020-02-15 10:39:45 +01:00
class="uupnnhew"
name="staggered"
tag="div"
appear
>
<slot></slot>
</transition-group>
2020-02-06 11:11:14 +01:00
<div v-else>
<slot></slot>
</div>
</template>
<script lang="ts">
import Vue from 'vue';
export default Vue.extend({
methods: {
focus() {
this.$slots.default[0].elm.focus();
}
2020-02-15 10:39:45 +01:00
},
});
</script>
<style lang="scss">
2020-02-21 01:11:35 +01:00
.uupnnhew {
> .staggered-enter {
2020-02-15 10:39:45 +01:00
opacity: 0;
transform: translateY(-64px);
}
@for $i from 1 through 30 {
2020-02-21 01:11:35 +01:00
> .staggered-enter-active:nth-child(#{$i}) {
2020-02-15 10:42:43 +01:00
transition: transform 0.7s cubic-bezier(0.23, 1, 0.32, 1) (15ms * ($i - 1)), opacity 0.7s cubic-bezier(0.23, 1, 0.32, 1) (15ms * ($i - 1));
2020-02-15 10:39:45 +01:00
}
}
}
</style>