mirror of
https://github.com/exane/not-gwent-online
synced 2024-11-23 19:36:53 +00:00
add gulp md sprites
This commit is contained in:
parent
00529ffd5c
commit
0dba058a76
22
gulpfile.js
22
gulpfile.js
@ -93,7 +93,20 @@ gulp.task('resize sm', function(done){
|
|||||||
.pipe(gulp.dest('./assets/cards/sm/'));
|
.pipe(gulp.dest('./assets/cards/sm/'));
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('resize lg', ["resize sm"], function(done){
|
gulp.task('resize md', function(done){
|
||||||
|
if(fs.existsSync(__dirname + "/assets/cards/md/monster/arachas1.png")){
|
||||||
|
console.log("skip generating md images");
|
||||||
|
return done();
|
||||||
|
}
|
||||||
|
return gulp.src('./assets/original_cards/**/*.png')
|
||||||
|
.pipe(gm(function(gmfile){
|
||||||
|
return gmfile.resize(null, 284);
|
||||||
|
}))
|
||||||
|
.pipe(imagemin())
|
||||||
|
.pipe(gulp.dest('./assets/cards/md/'));
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('resize lg', ["resize sm", "resize md"], function(done){
|
||||||
if(fs.existsSync(__dirname + "/assets/cards/lg/monster/arachas1.png")){
|
if(fs.existsSync(__dirname + "/assets/cards/lg/monster/arachas1.png")){
|
||||||
console.log("skip generating lg images");
|
console.log("skip generating lg images");
|
||||||
return done();
|
return done();
|
||||||
@ -111,6 +124,9 @@ gulp.task("sprite", ["resize lg"], function(){
|
|||||||
console.log("skip sprite generating");
|
console.log("skip sprite generating");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
console.log("start sprite generating ...");
|
||||||
sprity.src({
|
sprity.src({
|
||||||
src: "./assets/cards/**/*.png",
|
src: "./assets/cards/**/*.png",
|
||||||
style: "cards.css",
|
style: "cards.css",
|
||||||
@ -128,8 +144,6 @@ gulp.task("sprite", ["resize lg"], function(){
|
|||||||
//.pipe(gulpif("*.png", gulp.dest("./public/build/"), gulp.dest("./client/scss/")));
|
//.pipe(gulpif("*.png", gulp.dest("./public/build/"), gulp.dest("./client/scss/")));
|
||||||
.pipe(imagemin())
|
.pipe(imagemin())
|
||||||
.pipe(gulp.dest("./public/build/"));
|
.pipe(gulp.dest("./public/build/"));
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
gulp.task("default", ["watch", "browserify", "sass", "unit tests", "index", "resize lg", "resize sm"]);
|
gulp.task("default", ["watch", "browserify", "sass", "unit tests", "index", "resize lg", "resize sm", "resize md", "sprite"]);
|
||||||
|
Loading…
Reference in New Issue
Block a user