Skip to content

Commit

Permalink
加上转场动画
Browse files Browse the repository at this point in the history
  • Loading branch information
ahnuchen committed Jun 6, 2018
1 parent 1f85e8c commit 4f5b8a1
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 0 deletions.
72 changes: 72 additions & 0 deletions src/style/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
@mixin t-center {
text-align: center;
}

* {
margin: 0;
padding: 0;
Expand Down Expand Up @@ -596,6 +597,11 @@ a.media-box {
-webkit-animation-fill-mode: both;
animation-fill-mode: both
}
.animated-slow {
animation-duration: 0.3s;
-webkit-animation-fill-mode: both;
animation-fill-mode: both
}

@keyframes slideInUp {
0% {
Expand All @@ -608,3 +614,69 @@ a.media-box {
transform: translate3d(0, 0, 0)
}
}

@keyframes slideOutRight {
from {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}

to {
visibility: hidden;
-webkit-transform: translate3d(100%, 0, 0);
transform: translate3d(100%, 0, 0);
}
}

.slideOutRight {
-webkit-animation-name: slideOutRight;
animation-name: slideOutRight;
}

@keyframes slideInRight {
from {
-webkit-transform: translate3d(100%, 0, 0);
transform: translate3d(100%, 0, 0);
visibility: visible;
}

to {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
}

.slideInRight {
-webkit-animation-name: slideInRight;
animation-name: slideInRight;
}

@keyframes fadeIn {
from {
opacity: 0;
}

to {
opacity: 1;
}
}

.fadeIn {
-webkit-animation-name: fadeIn;
animation-name: fadeIn;
}

@keyframes fadeOut {
from {
opacity: 1;
}

to {
opacity: 0;
}
}

.fadeOut {
-webkit-animation-name: fadeOut;
animation-name: fadeOut;
}
12 changes: 12 additions & 0 deletions src/views/App.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
<template lang="html">
<div id="application">
<transition :enter-active-class="transactionEnterLiveName"
:leave-active-class="transactionLeaveLiveName"
>
<router-view></router-view>
</transition>
</div>
</template>
<script>
export default {
data(){
return {
transactionEnterLiveName:"animated-slow fadeIn",
transactionLeaveLiveName:"animated-slow fadeOut",
}
}
}
</script>

0 comments on commit 4f5b8a1

Please sign in to comment.