Skip to content
This repository was archived by the owner on Aug 26, 2024. It is now read-only.

Commit 58193e1

Browse files
committed
add more classes and update docs
1 parent c91db1b commit 58193e1

File tree

7 files changed

+60
-6
lines changed

7 files changed

+60
-6
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# vue-transitions-css
22
A lightweight CSS library for for adding transitions to Vue components :star:
33

4+
[Demo](https://vue-transitions-css.netlify.app/) | [Contribution](#contribution)
5+
46
## USAGE
57
Installation via NPM:
68
```bash

demo/src/App.vue

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<Nav />
44
<div id="body">
55
<div id="selector">
6-
<select name="animations" id="animations" v-model="selected">
6+
<select name="animations" id="animations-list" v-model="selected">
77
<option
88
v-for="(animation, index) in animations"
99
:key="index"
@@ -12,10 +12,11 @@
1212
{{ animation.name }}
1313
</option>
1414
</select>
15-
<button @click="animate">toggle</button>
15+
<button @click="animate" class="animation-toggle-button">toggle</button>
1616
</div>
1717
<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">
1920
<Content v-if="show" />
2021
</transition>
2122
</div>
@@ -68,4 +69,23 @@ export default {
6869
margin: auto;
6970
padding: 20px;
7071
}
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+
}
7191
</style>

demo/src/assets/animations.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ export default [
33
name: 'Fade',
44
class: 'fade',
55
},
6+
{
7+
name: 'Fade X',
8+
class: 'fade-x',
9+
},
10+
{
11+
name: 'Fade Y',
12+
class: 'fade-y',
13+
},
614
{
715
name: 'Shrink',
816
class: 'shrink',

dist/index.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/fade-x.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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+
}

src/fade-y.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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+
}

src/shrink.css

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
/* shrink animation */
22
.shrink-enter,
33
.shrink-leave-to {
4-
transform: scale(1.2);
4+
transform: scale(1.12);
5+
opacity: 0;
56
}
67

78
.shrink-enter-active,
89
.shrink-leave-active {
9-
transition: transform 0.3s;
10+
transition: transform 0.5s, opacity 0.3s;
1011
}

0 commit comments

Comments
 (0)