This repository was archived by the owner on Aug 26, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 7 files changed +60
-6
lines changed Expand file tree Collapse file tree 7 files changed +60
-6
lines changed Original file line number Diff line number Diff line change 1
1
# vue-transitions-css
2
2
A lightweight CSS library for for adding transitions to Vue components :star :
3
3
4
+ [ Demo] ( https://vue-transitions-css.netlify.app/ ) | [ Contribution] ( #contribution )
5
+
4
6
## USAGE
5
7
Installation via NPM:
6
8
``` bash
Original file line number Diff line number Diff line change 3
3
<Nav />
4
4
<div id =" body" >
5
5
<div id =" selector" >
6
- <select name =" animations" id =" animations" v-model =" selected" >
6
+ <select name =" animations" id =" animations-list " v-model =" selected" >
7
7
<option
8
8
v-for =" (animation, index) in animations"
9
9
:key =" index"
12
12
{{ animation.name }}
13
13
</option >
14
14
</select >
15
- <button @click =" animate" >toggle</button >
15
+ <button @click =" animate" class = " animation-toggle-button " >toggle</button >
16
16
</div >
17
17
<div id =" preview" >
18
- <transition :name =" selected" >
18
+ <p class =" class-name" ><strong >Class name:</strong > {{ selected }}</p >
19
+ <transition :name =" selected" mode =" out-in" >
19
20
<Content v-if =" show" />
20
21
</transition >
21
22
</div >
@@ -68,4 +69,23 @@ export default {
68
69
margin : auto ;
69
70
padding : 20px ;
70
71
}
72
+ #animations-list {
73
+ width : 200px ;
74
+ display : inline-block ;
75
+ margin-right : 30px ;
76
+ padding : 30px 20px ;
77
+ }
78
+ .animation-toggle-button {
79
+ padding : 5px 10px ;
80
+ border-radius : 4px ;
81
+ color : white ;
82
+ background-color : #44a1df ;
83
+ cursor : pointer ;
84
+ }
85
+ #preview {
86
+ margin-top : 50px ;
87
+ }
88
+ .class-name {
89
+ margin : 20px 0px ;
90
+ }
71
91
</style >
Original file line number Diff line number Diff line change @@ -3,6 +3,14 @@ export default [
3
3
name : 'Fade' ,
4
4
class : 'fade' ,
5
5
} ,
6
+ {
7
+ name : 'Fade X' ,
8
+ class : 'fade-x' ,
9
+ } ,
10
+ {
11
+ name : 'Fade Y' ,
12
+ class : 'fade-y' ,
13
+ } ,
6
14
{
7
15
name : 'Shrink' ,
8
16
class : 'shrink' ,
Original file line number Diff line number Diff line change
1
+ /* fade horizontally */
2
+
3
+ .fade-x-enter ,
4
+ .fade-x-leave-to {
5
+ opacity : 0 ;
6
+ transform : translateX (20px );
7
+ }
8
+
9
+ .fade-x-enter-active ,
10
+ .fade-x-leave-to {
11
+ transition : opacity 0.3s , transform 0.5s ;
12
+ }
Original file line number Diff line number Diff line change
1
+ /* fade up */
2
+ .fade-y-enter ,
3
+ .fade-y-leave-to {
4
+ opacity : 0 ;
5
+ transform : translateY (20px );
6
+ }
7
+
8
+ .fade-y-enter-active ,
9
+ .fade-y-leave-active {
10
+ transition : opacity 0.3s , transform 0.5s ;
11
+ }
Original file line number Diff line number Diff line change 1
1
/* shrink animation */
2
2
.shrink-enter ,
3
3
.shrink-leave-to {
4
- transform : scale (1.2 );
4
+ transform : scale (1.12 );
5
+ opacity : 0 ;
5
6
}
6
7
7
8
.shrink-enter-active ,
8
9
.shrink-leave-active {
9
- transition : transform 0.3s ;
10
+ transition : transform 0.5 s , opacity 0. 3s ;
10
11
}
You can’t perform that action at this time.
0 commit comments