Skip to content

Commit 79c9fb7

Browse files
committed
Implement @RadLikeWhoa’s build script
1 parent 25448e3 commit 79c9fb7

File tree

6 files changed

+315
-17
lines changed

6 files changed

+315
-17
lines changed

.animate-config

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
{
2+
3+
"attention_seekers": {
4+
"bounce": true,
5+
"flash": true,
6+
"pulse": true,
7+
"shake": true,
8+
"swing": true,
9+
"tada": true,
10+
"wobble": true
11+
},
12+
13+
"bouncing_entrances": {
14+
"bounceIn": true,
15+
"bounceInDown": true,
16+
"bounceInLeft": true,
17+
"bounceInRight": true,
18+
"bounceInUp": true
19+
},
20+
21+
"bouncing_exits": {
22+
"bounceOut": true,
23+
"bounceOutDown": true,
24+
"bounceOutLeft": true,
25+
"bounceOutRight": true,
26+
"bounceOutUp": true
27+
},
28+
29+
"fading_entrances": {
30+
"fadeIn": true,
31+
"fadeInDown": true,
32+
"fadeInDownBig": true,
33+
"fadeInLeft": true,
34+
"fadeInLeftBig": true,
35+
"fadeInRight": true,
36+
"fadeInRightBig": true,
37+
"fadeInUp": true,
38+
"fadeInUpBig": true
39+
},
40+
41+
"fading_exits": {
42+
"fadeOut": true,
43+
"fadeOutDown": true,
44+
"fadeOutDownBig": true,
45+
"fadeOutLeft": true,
46+
"fadeOutLeftBig": true,
47+
"fadeOutRight": true,
48+
"fadeOutRightBig": true,
49+
"fadeOutUp": true,
50+
"fadeOutUpBig": true
51+
},
52+
53+
"flippers": {
54+
"flip": true,
55+
"flipInX": true,
56+
"flipInY": true,
57+
"flipOutX": true,
58+
"flipOutY": true
59+
},
60+
61+
"lightspeed": {
62+
"lightspeedIn": true,
63+
"lightspeedOut": true
64+
},
65+
66+
"rotating_entrances": {
67+
"rotateIn": true,
68+
"rotateInDownLeft": true,
69+
"rotateInDownRight": true,
70+
"rotateInUpLeft": true,
71+
"rotateInUpRight": true
72+
},
73+
74+
"rotating_exits": {
75+
"rotateOut": true,
76+
"rotateOutDownLeft": true,
77+
"rotateOutDownRight": true,
78+
"rotateOutUpLeft": true,
79+
"rotateOutUpRight": true
80+
},
81+
82+
"sliders": {
83+
"slideInDown": true,
84+
"slideInLeft": true,
85+
"slideInRight": true,
86+
"slideOutLeft": true,
87+
"slideOutRight": true,
88+
"slideOutUp": true
89+
},
90+
91+
"specials": {
92+
"hinge": true,
93+
"rollIn": true,
94+
"rollOut": true
95+
}
96+
97+
}

Gruntfile.js

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module.exports = function(grunt) {
99
// _base.css required for .animated helper class
1010
'source/_base.css',
1111
'source/**/*.css'
12-
]
12+
],
1313
dest: 'animate.css'
1414
}
1515
},
@@ -40,10 +40,11 @@ module.exports = function(grunt) {
4040
css: {
4141
files: [
4242
'source/**/*',
43-
'!node_modules'
43+
'!node_modules',
44+
'.animate-config'
4445
],
4546
// Run Sass, autoprefixer, and CSSO
46-
tasks: ['concat', 'autoprefixer', 'csso'],
47+
tasks: ['concat-anim', 'autoprefixer', 'csso'],
4748
}
4849
}
4950

@@ -55,4 +56,28 @@ module.exports = function(grunt) {
5556
grunt.loadNpmTasks('grunt-autoprefixer');
5657
grunt.loadNpmTasks('grunt-csso');
5758
grunt.registerTask('default', ['watch']);
59+
60+
grunt.registerTask('concat-anim', 'Concatenates activated animations', function () {
61+
var config = grunt.file.readJSON('.animate-config'),
62+
target = [ 'source/_base.css' ],
63+
count = 0
64+
65+
for (var cat in config) {
66+
for (var file in config[cat]) {
67+
if (config[cat][file]) {
68+
target.push('source/' + cat + '/' + file + '.css')
69+
count++
70+
}
71+
}
72+
}
73+
74+
if (!count) {
75+
grunt.log.writeln('No animations activated.')
76+
}
77+
78+
grunt.log.writeln(count + (count > 1 ? ' animations' : ' animation') + ' activated.')
79+
80+
grunt.config('concat', { 'animate.css': target })
81+
grunt.task.run('concat')
82+
});
5883
};

0 commit comments

Comments
 (0)