Skip to content

Commit 80d3de9

Browse files
committed
Complete switch to Gulp
1 parent c3e5360 commit 80d3de9

File tree

7 files changed

+63
-29
lines changed

7 files changed

+63
-29
lines changed

animate.css

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

33
/*!
4-
* Animate.css -http://daneden.me/animate
4+
* animate.css -http://daneden.me/animate
55
* Version - 3.4.0
66
* Licensed under the MIT license - http://opensource.org/licenses/MIT
77
*
88
* Copyright (c) 2015 Daniel Eden
99
*/
10-
1110
.animated {
1211
-webkit-animation-duration: 1s;
1312
animation-duration: 1s;

animate.min.css

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

gulpfile.js

Lines changed: 49 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,68 @@ var gulp = require('gulp');
77
// Gulp plugins
88
var gutil = require('gulp-util');
99
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');
1015

1116
// Misc/global vars
1217
var pkg = JSON.parse(fs.readFileSync('package.json'));
1318
var banner = [
19+
'@charset "UTF-8";\n',
1420
'/*!',
1521
' * <%= name %> -<%= homepage %>',
1622
' * Version - <%= version %>',
1723
' * Licensed under the MIT license - http://opensource.org/licenses/MIT',
1824
' *',
1925
' * Copyright (c) <%= new Date().getFullYear() %> <%= author.name %>',
20-
' */',
26+
' */\n\n'
2127
].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+
// ----------------------------
2269

2370
// Read the config file and return an array of the animations to be activated
24-
var activatedAnimations = function () {
71+
function activateAnimations() {
2572
var categories = JSON.parse(fs.readFileSync('animate-config.json')),
2673
category, files, file,
2774
target = [ 'source/_base.css' ],
@@ -48,13 +95,3 @@ var activatedAnimations = function () {
4895

4996
return target;
5097
};
51-
52-
gulp.task('default', function() {
53-
54-
});
55-
56-
gulp.task('concatCSS', function() {
57-
return gulp.src(activatedAnimations)
58-
.pipe(concat('animate.css'))
59-
.pipe(gulp.dest('./'));
60-
});

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,16 @@
2121
},
2222
"devDependencies": {
2323
"gulp": "^3.9.0",
24-
"gulp-concat": "^2.6.0"
24+
"gulp-autoprefixer": "^3.1.0",
25+
"gulp-concat": "^2.6.0",
26+
"gulp-minify-css": "^1.2.2",
27+
"run-sequence": "^1.1.5"
2528
},
2629
"spm": {
2730
"main": "./animate.css"
2831
},
2932
"dependencies": {
30-
"gulp-header": "^1.7.1"
33+
"gulp-header": "^1.7.1",
34+
"gulp-rename": "^1.2.2"
3135
}
3236
}

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)