Commit be0769d475d4dee22b91116233eefea808b818f6
1 parent
0b1b650d
added move up transition for Notice
#30
Showing
5 changed files
with
68 additions
and
1 deletions
Show diff stats
src/components/notice/index.js
src/styles/animation/move.less
... | ... | @@ -117,3 +117,45 @@ |
117 | 117 | opacity: 0; |
118 | 118 | } |
119 | 119 | } |
120 | + | |
121 | +// specific transition for Notice | |
122 | + | |
123 | +.move-motion(move-notice, ivuMoveNotice); | |
124 | +@import '../components/notice.less'; | |
125 | + | |
126 | +@keyframes ivuMoveNoticeIn { | |
127 | + 0% { | |
128 | + opacity: 0; | |
129 | + transform-origin: 0 0; | |
130 | + transform: translateX(100%); | |
131 | + } | |
132 | + 100% { | |
133 | + opacity: 1; | |
134 | + transform-origin: 0 0; | |
135 | + transform: translateX(0%); | |
136 | + } | |
137 | +} | |
138 | + | |
139 | +@keyframes ivuMoveNoticeOut { | |
140 | + 0% { | |
141 | + transform-origin: 0 0; | |
142 | + transform: translateX(0%); | |
143 | + opacity: 1; | |
144 | + } | |
145 | + 70% { | |
146 | + transform-origin: 0 0; | |
147 | + transform: translateX(100%); | |
148 | + height: auto; | |
149 | + padding: @notice-padding; | |
150 | + margin-bottom: @notice-margin-bottom; | |
151 | + opacity: 0; | |
152 | + } | |
153 | + 100% { | |
154 | + transform-origin: 0 0; | |
155 | + transform: translateX(100%); | |
156 | + height: 0; | |
157 | + padding: 0; | |
158 | + margin-bottom: 0; | |
159 | + opacity: 0; | |
160 | + } | |
161 | +} | ... | ... |
test/app.vue
test/main.js
... | ... | @@ -155,6 +155,11 @@ router.map({ |
155 | 155 | require(['./routers/tree.vue'], resolve); |
156 | 156 | } |
157 | 157 | }, |
158 | + '/notice': { | |
159 | + component: function (resolve) { | |
160 | + require(['./routers/notice.vue'], resolve); | |
161 | + } | |
162 | + }, | |
158 | 163 | }); |
159 | 164 | |
160 | 165 | router.beforeEach(function () { | ... | ... |
1 | +<template> | |
2 | + <i-button @click="pop">Pop</i-button> | |
3 | +</template> | |
4 | +<script> | |
5 | + export default { | |
6 | + methods: { | |
7 | + pop () { | |
8 | + for (let i = 0; i < 6; i++) { | |
9 | + setTimeout(() => { | |
10 | + this.$Notice.open({ | |
11 | + title: 'test', | |
12 | + duration: 1.5 + i | |
13 | + }); | |
14 | + }, i * 500); | |
15 | + } | |
16 | + } | |
17 | + } | |
18 | + } | |
19 | +</script> | ... | ... |