Skip to content

Commit 0a6a8ab

Browse files
committed
Merge pull request animate-css#507 from daneden/gulp
Switch from Grunt to Gulp
2 parents 069a87f + 14402f2 commit 0a6a8ab

File tree

8 files changed

+115
-131
lines changed

8 files changed

+115
-131
lines changed

Gruntfile.js

Lines changed: 0 additions & 107 deletions
This file was deleted.

animate.css

100755100644
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
@charset "UTF-8";
22

33
/*!
4-
* Animate.css -http://daneden.me/animate
5-
* Version - 3.4.0
4+
* animate.css -http://daneden.me/animate
5+
* Version - 3.5.0
66
* Licensed under the MIT license - http://opensource.org/licenses/MIT
77
*
88
* Copyright (c) 2015 Daniel Eden

animate.min.css

100755100644
Lines changed: 4 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gulpfile.js

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
// Utilities
2+
var fs = require('fs');
3+
4+
// Gulp
5+
var gulp = require('gulp');
6+
7+
// Gulp plugins
8+
var gutil = require('gulp-util');
9+
var concat = require('gulp-concat');
10+
var header = require('gulp-header');
11+
var autoprefixer = require('gulp-autoprefixer');
12+
var runSequence = require('run-sequence');
13+
var minify = require('gulp-minify-css');
14+
var rename = require('gulp-rename');
15+
16+
// Misc/global vars
17+
var pkg = JSON.parse(fs.readFileSync('package.json'));
18+
var banner = [
19+
'@charset "UTF-8";\n',
20+
'/*!',
21+
' * <%= name %> -<%= homepage %>',
22+
' * Version - <%= version %>',
23+
' * Licensed under the MIT license - http://opensource.org/licenses/MIT',
24+
' *',
25+
' * Copyright (c) <%= new Date().getFullYear() %> <%= author.name %>',
26+
' */\n\n'
27+
].join('\n');
28+
var activatedAnimations = activateAnimations();
29+
30+
// ----------------------------
31+
// Gulp task definitions
32+
// ----------------------------
33+
34+
gulp.task('default', function() {
35+
runSequence('concatCSS', 'addHeader', 'prefixes', 'minifyCSS');
36+
});
37+
38+
gulp.task('concatCSS', function() {
39+
return gulp.src(activatedAnimations)
40+
.pipe(concat('animate.css'))
41+
.pipe(gulp.dest('./'));
42+
});
43+
44+
gulp.task('addHeader', function() {
45+
return gulp.src('animate.css')
46+
.pipe(header(banner, pkg))
47+
.pipe(gulp.dest('./'));
48+
});
49+
50+
gulp.task('prefixes', function() {
51+
return gulp.src('animate.css')
52+
.pipe(autoprefixer({
53+
browsers: ['last 2 versions'],
54+
cascade: false
55+
}))
56+
.pipe(gulp.dest('./'));
57+
});
58+
59+
gulp.task('minifyCSS', function() {
60+
return gulp.src('animate.css')
61+
.pipe(rename('animate.min.css'))
62+
.pipe(minify())
63+
.pipe(gulp.dest('./'));
64+
});
65+
66+
// ----------------------------
67+
// Helpers/functions
68+
// ----------------------------
69+
70+
// Read the config file and return an array of the animations to be activated
71+
function activateAnimations() {
72+
var categories = JSON.parse(fs.readFileSync('animate-config.json')),
73+
category, files, file,
74+
target = [ 'source/_base.css' ],
75+
count = 0;
76+
77+
for (category in categories) {
78+
if (categories.hasOwnProperty(category)) {
79+
files = categories[category];
80+
81+
for (file in files) {
82+
if (files.hasOwnProperty(file) && files[file]) {
83+
target.push('source/' + category + '/' + file + '.css');
84+
count += 1;
85+
}
86+
}
87+
}
88+
}
89+
90+
if (!count) {
91+
gutil.log('No animations activated.');
92+
} else {
93+
gutil.log(count + (count > 1 ? ' animations' : ' animation') + ' activated.');
94+
}
95+
96+
return target;
97+
};

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "animate.css",
3-
"version": "3.4.0",
3+
"version": "3.5.0",
44
"main": "animate.css",
55
"repository": {
66
"type": "git",
@@ -20,13 +20,13 @@
2020
}
2121
},
2222
"devDependencies": {
23-
"grunt": "~0.4.1",
24-
"grunt-autoprefixer": "~0.4.0",
25-
"grunt-contrib-watch": "~0.5.3",
26-
"grunt-banner": "~0.6.0",
27-
"grunt-contrib-concat": "~0.3.0",
28-
"grunt-contrib-cssmin": "~0.8.0",
29-
"load-grunt-tasks": "~0.2.0"
23+
"gulp": "^3.9.0",
24+
"gulp-autoprefixer": "^3.1.0",
25+
"gulp-concat": "^2.6.0",
26+
"gulp-minify-css": "^1.2.2",
27+
"gulp-header": "^1.7.1",
28+
"gulp-rename": "^1.2.2",
29+
"run-sequence": "^1.1.5"
3030
},
3131
"spm": {
3232
"main": "./animate.css"

source/_base.css

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
@charset "UTF-8";
2-
3-
/*! inject-banner */
4-
51
.animated {
62
animation-duration: 1s;
73
animation-fill-mode: both;
@@ -18,6 +14,6 @@
1814
.animated.flipOutX,
1915
.animated.flipOutY,
2016
.animated.bounceIn,
21-
.animated.bounceOut{
17+
.animated.bounceOut {
2218
animation-duration: .75s;
2319
}

source/attention_seekers/headShake.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@keyframes headShake {
2-
0 {
2+
0% {
33
transform: translateX(0);
44
}
55

source/attention_seekers/jello.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
}
3333
}
3434

35-
.jello{
36-
animation-name:jello;
35+
.jello {
36+
animation-name: jello;
3737
transform-origin: center;
3838
}

0 commit comments

Comments
 (0)