Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement SCSS version #14

Merged
merged 1 commit into from Apr 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,23 @@ Include the stylesheet:
```
#### Less
```less
@import "<PATH_TO_SOURCE>/src/vue2-animate.less";
@import "<PATH_TO_SOURCE>/src/less/vue2-animate.less";
```

#### Sass/Scss
```scss
$animationDuration: 0.5s; // specify animation duration. Default value: 1s
@import "<PATH_TO_SOURCE>/src/sass/vue2-animate.scss";
```

#### Building
```shell
git clone https://github.com/asika32764/vue2-animate.git
cd vue2-animate
npm install
npm run build #Compiled .css files go to the dist folder
npm run build #Compiled .css files go to the dist folder.
```
You are able to build sass version with command `npm run build-sass`.

## Usage

Expand Down
2 changes: 1 addition & 1 deletion dist/vue2-animate.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@charset "UTF-8";
/*!
* vue2-animate v1.0.4
* vue2-animate v1.0.5
* (c) 2016 Simon Asika
* Released under the MIT License.
* Documentation: https://github.com/asika32764/vue2-animate
Expand Down
2 changes: 1 addition & 1 deletion dist/vue2-animate.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 12 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
"vue.js",
"transition",
"vue-animate",
"css"
"css",
"sass",
"scss"
],
"files": [
"dist/vue2-animate.css",
Expand All @@ -33,11 +35,16 @@
"devDependencies": {
"less": "^2.4.0",
"less-plugin-autoprefix": "^1.5.1",
"less-plugin-clean-css": "^1.5.0"
"less-plugin-clean-css": "^1.5.0",
"sass": "^1.1.1"
},
"scripts": {
"build": "lessc src/vue2-animate.less > dist/vue2-animate.css && lessc --clean-css='--compatibility=ie8 --advanced' src/vue2-animate.less > dist/vue2-animate.min.css",
"less": "lessc src/vue2-animate.less > dist/vue2-animate.css",
"minify": "lessc --clean-css='--compatibility=ie8 --advanced' src/vue2-animate.less > dist/vue2-animate.min.css"
"build": "npm run build-less",
"less": "lessc src/less/vue2-animate.less > dist/vue2-animate.css",
"minify-less": "lessc --clean-css='--compatibility=ie8 --advanced' src/less/vue2-animate.less > dist/vue2-animate.min.css",
"build-less": "npm run less && npm run minify-less",
"sass": "sass src/sass/vue2-animate.scss dist/vue2-animate.css",
"minify-sass": "sass --style='compressed' src/sass/vue2-animate.scss dist/vue2-animate.min.css",
"build-sass": "npm run sass && npm run minify-sass"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 8 additions & 0 deletions src/sass/animations/bouncing/all.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@import 'bounce';
@import 'bounceDown';
@import 'bounceLeft';
@import 'bounceRight';
@import 'bounceUp';

$bounces: Down, Left, Right, Up;
@include make-transitions(bounce, $bounces);
48 changes: 48 additions & 0 deletions src/sass/animations/bouncing/bounce.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
@keyframes bounceIn {
from, 20%, 40%, 60%, 80%, to {
animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
}

0% {
opacity: 0;
transform: scale3d(.3, .3, .3);
}

20% {
transform: scale3d(1.1, 1.1, 1.1);
}

40% {
transform: scale3d(.9, .9, .9);
}

60% {
opacity: 1;
transform: scale3d(1.03, 1.03, 1.03);
}

80% {
transform: scale3d(.97, .97, .97);
}

to {
opacity: 1;
transform: scale3d(1, 1, 1);
}
}

@keyframes bounceOut {
20% {
transform: scale3d(.9, .9, .9);
}

50%, 55% {
opacity: 1;
transform: scale3d(1.1, 1.1, 1.1);
}

to {
opacity: 0;
transform: scale3d(.3, .3, .3);
}
}
43 changes: 43 additions & 0 deletions src/sass/animations/bouncing/bounceDown.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
@keyframes bounceInDown {
from, 60%, 75%, 90%, to {
animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
}

0% {
opacity: 0;
transform: translate3d(0, -3000px, 0);
}

60% {
opacity: 1;
transform: translate3d(0, 25px, 0);
}

75% {
transform: translate3d(0, -10px, 0);
}

90% {
transform: translate3d(0, 5px, 0);
}

to {
transform: none;
}
}

@keyframes bounceOutDown {
20% {
transform: translate3d(0, 10px, 0);
}

40%, 45% {
opacity: 1;
transform: translate3d(0, -20px, 0);
}

to {
opacity: 0;
transform: translate3d(0, 2000px, 0);
}
}
39 changes: 39 additions & 0 deletions src/sass/animations/bouncing/bounceLeft.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
@keyframes bounceInLeft {
from, 60%, 75%, 90%, to {
animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
}

0% {
opacity: 0;
transform: translate3d(-3000px, 0, 0);
}

60% {
opacity: 1;
transform: translate3d(25px, 0, 0);
}

75% {
transform: translate3d(-10px, 0, 0);
}

90% {
transform: translate3d(5px, 0, 0);
}

to {
transform: none;
}
}

@keyframes bounceOutLeft {
20% {
opacity: 1;
transform: translate3d(20px, 0, 0);
}

to {
opacity: 0;
transform: translate3d(-2000px, 0, 0);
}
}
39 changes: 39 additions & 0 deletions src/sass/animations/bouncing/bounceRight.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
@keyframes bounceInRight {
from, 60%, 75%, 90%, to {
animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
}

from {
opacity: 0;
transform: translate3d(3000px, 0, 0);
}

60% {
opacity: 1;
transform: translate3d(-25px, 0, 0);
}

75% {
transform: translate3d(10px, 0, 0);
}

90% {
transform: translate3d(-5px, 0, 0);
}

to {
transform: none;
}
}

@keyframes bounceOutRight {
20% {
opacity: 1;
transform: translate3d(-20px, 0, 0);
}

to {
opacity: 0;
transform: translate3d(2000px, 0, 0);
}
}
43 changes: 43 additions & 0 deletions src/sass/animations/bouncing/bounceUp.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
@keyframes bounceInUp {
from, 60%, 75%, 90%, to {
animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
}

from {
opacity: 0;
transform: translate3d(0, 3000px, 0);
}

60% {
opacity: 1;
transform: translate3d(0, -20px, 0);
}

75% {
transform: translate3d(0, 10px, 0);
}

90% {
transform: translate3d(0, -5px, 0);
}

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

@keyframes bounceOutUp {
20% {
transform: translate3d(0, -10px, 0);
}

40%, 45% {
opacity: 1;
transform: translate3d(0, 20px, 0);
}

to {
opacity: 0;
transform: translate3d(0, -2000px, 0);
}
}
13 changes: 13 additions & 0 deletions src/sass/animations/fading/all.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@import 'fade';
@import 'fadeDown';
@import 'fadeDownBig';
@import 'fadeLeft';
@import 'fadeLeftBig';
@import 'fadeRight';
@import 'fadeRightBig';
@import 'fadeUp';
@import 'fadeUpBig';

$fades: Down, DownBig, Left, LeftBig, Right, RightBig, Up, UpBig;

@include make-transitions(fade, $fades);
19 changes: 19 additions & 0 deletions src/sass/animations/fading/fade.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@keyframes fadeIn {
from {
opacity: 0;
}

to {
opacity: 1;
}
}

@keyframes fadeOut {
from {
opacity: 1;
}

to {
opacity: 0;
}
}
22 changes: 22 additions & 0 deletions src/sass/animations/fading/fadeDown.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
@keyframes fadeInDown {
from {
opacity: 0;
transform: translate3d(0, -100%, 0);
}

to {
opacity: 1;
transform: none;
}
}

@keyframes fadeOutDown {
from {
opacity: 1;
}

to {
opacity: 0;
transform: translate3d(0, 100%, 0);
}
}
22 changes: 22 additions & 0 deletions src/sass/animations/fading/fadeDownBig.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
@keyframes fadeInDownBig {
from {
opacity: 0;
transform: translate3d(0, -2000px, 0);
}

to {
opacity: 1;
transform: none;
}
}

@keyframes fadeOutDownBig {
from {
opacity: 1;
}

to {
opacity: 0;
transform: translate3d(0, 2000px, 0);
}
}
Loading