Skip to content

Commit

Permalink
add transition effect to timeline
Browse files Browse the repository at this point in the history
  • Loading branch information
nasum committed Apr 20, 2018
1 parent eccce55 commit 71580e5
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 9 deletions.
9 changes: 9 additions & 0 deletions src/renderer/assets/timeline-transition.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.timeline-enter-active, .timeline-leave-active {
transition: all 0.1s;
}
.timeline-enter, .timeline-leave-to {
opacity: 0;
}
.timeline-move {
transition: transform 0.1s;
}
9 changes: 6 additions & 3 deletions src/renderer/components/TimelineSpace/Contents/Home.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<template>
<div id="home">
<div class="home-timeline" v-for="(message, index) in timeline" v-bind:key="index">
<toot :message="message" :key="message.id"></toot>
</div>
<transition-group name="timeline" tag="div">
<div class="home-timeline" v-for="(message, index) in timeline" v-bind:key="index">
<toot :message="message" :key="message.id"></toot>
</div>
</transition-group>
<div class="loading-card" v-loading="lazyLoading" :element-loading-background="backgroundColor">
</div>
</div>
Expand Down Expand Up @@ -62,3 +64,4 @@ export default {
height: 0;
}
</style>
<style src="@/assets/timeline-transition.scss"></style>
9 changes: 6 additions & 3 deletions src/renderer/components/TimelineSpace/Contents/Local.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<template>
<div id="local">
<div class="local-timeline" v-for="message in timeline" v-bind:key="message.id">
<toot :message="message" v-on:update="updateToot"></toot>
</div>
<transition-group name="timeline" tag="div">
<div class="local-timeline" v-for="message in timeline" v-bind:key="message.id">
<toot :message="message" v-on:update="updateToot"></toot>
</div>
</transition-group>
<div class="loading-card" v-loading="lazyLoading" :element-loading-background="backgroundColor">
</div>
</div>
Expand Down Expand Up @@ -92,3 +94,4 @@ export default {
height: 0;
}
</style>
<style src="@/assets/timeline-transition.scss"></style>
9 changes: 6 additions & 3 deletions src/renderer/components/TimelineSpace/Contents/Public.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<template>
<div id="public">
<div class="public-timeline" v-for="message in timeline" v-bind:key="message.id">
<toot :message="message" v-on:update="updateToot"></toot>
</div>
<transition-group name="timeline" tag="div">
<div class="public-timeline" v-for="message in timeline" v-bind:key="message.id">
<toot :message="message" v-on:update="updateToot"></toot>
</div>
</transition-group>
<div class="loading-card" v-loading="lazyLoading" :element-loading-background="backgroundColor">
</div>
</div>
Expand Down Expand Up @@ -92,3 +94,4 @@ export default {
height: 0;
}
</style>
<style src="@/assets/timeline-transition.scss"></style>

0 comments on commit 71580e5

Please sign in to comment.