-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
64 changed files
with
1,482 additions
and
1,213 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
# See https://help.github.com/articles/ignoring-files for more about ignoring files. | ||
# | ||
|
||
|
||
|
||
node_modules/ | ||
|
||
build/ | ||
|
||
src/libs/ | ||
src/libs/ | ||
|
||
src/style/scss_components/scss_sprite/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# Sborshchik | ||
сборка фронтенда | ||
# сборка фронтенда |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,6 @@ | |
], | ||
"dependencies": { | ||
"normalize.css": "*", | ||
"jquery": "3.*", | ||
"bourbon": "^4.2.7" | ||
"jquery": "3.*" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,51 @@ | ||
|
||
|
||
var gulp = require('gulp'); | ||
// var spritesmith = require('gulp.spritesmith'); | ||
var config = require('../config'); | ||
var p = require('gulp-load-plugins')(); | ||
var pngquant = require('imagemin-pngquant'); | ||
var bufferino = require('vinyl-buffer'); | ||
var merge = require('merge-stream'); | ||
var path = require('path'); | ||
|
||
|
||
|
||
// то,куда будут складываться препроцессорные файлы с переменными спрайта | ||
var scssDestFolder = 'src/style/scss_components/scss_sprite/'; | ||
|
||
|
||
gulp.task('buildPngSprite', p.folders(config.images.src.spriteSrcFolder, function (folder) { | ||
|
||
var imgURLinCSS = '../img/pngSprites/' + folder + '/' + folder + '.png'; | ||
|
||
var spriteData = gulp.src( path.join(config.images.src.spriteSrcFolder, folder,'*.png') ) | ||
.pipe(p.plumber({ | ||
handleError: function (err) { | ||
console.log(err); | ||
this.emit('end'); | ||
} | ||
})) | ||
.pipe(p.spritesmith({ | ||
imgName: folder + '.png', | ||
cssName: '_'+ folder + '.scss', | ||
imgPath: imgURLinCSS, | ||
padding: 1 | ||
})); | ||
|
||
var imgStream = spriteData.img | ||
// DEV: We must buffer our stream into a Buffer for `imagemin` | ||
.pipe(bufferino()) | ||
.pipe(p.cache(p.imagemin({ | ||
verbose: true, | ||
interlaced: true, | ||
progressive: true, | ||
use: [pngquant()], | ||
}))) | ||
.pipe(gulp.dest( config.images.dest.spriteDestFolder + folder )); | ||
|
||
var cssStream = spriteData.css | ||
.pipe(gulp.dest( scssDestFolder )); | ||
|
||
|
||
gulp.task('buildPngSprite', function () { // тест спрайтоварильщика | ||
|
||
/* | ||
pngIconsForSprite - это директория,которая будет подвержена переимнованию, | ||
например, для png картинок отдельного спрайта | ||
*/ | ||
|
||
// тестовый путь | ||
var spriteData = gulp.src( config.images.src.pngIconsForSprite ) | ||
.pipe(p.spritesmith({ | ||
imgName: 'pngIconSprite.png', | ||
cssName: '_pngIconSprite.scss', | ||
imgPath: '../img/pngSprites/pngIconSprite.png', | ||
padding: 2 | ||
})); | ||
|
||
var imgStream = spriteData.img | ||
// DEV: We must buffer our stream into a Buffer for `imagemin` | ||
.pipe(bufferino()) | ||
.pipe(p.cache(p.imagemin({ | ||
verbose: true, | ||
interlaced: true, | ||
progressive: true, | ||
use: [pngquant()], | ||
}))) | ||
.pipe(gulp.dest( config.images.dest.pngSprite )); | ||
|
||
// Pipe CSS stream through CSS optimizer and onto disk | ||
var cssStream = spriteData.css | ||
.pipe(gulp.dest('src/style/scss_components/')); | ||
|
||
// Return a merged stream to handle both `end` events | ||
return merge(imgStream, cssStream); | ||
|
||
|
||
/* var spriteData2 = gulp.src('src/img/rasterSprites/pngToSprite/*.png') | ||
.pipe(spritesmith({ | ||
imgName: 'mysprite228.png', | ||
cssName: '_mysprite228.scss', | ||
imgPath: '../img/rasterImages/mysprite228.png', | ||
padding: 2 | ||
})); | ||
var cssstr = spriteData2.css.pipe(gulp.dest('src/style/scss_components/')); | ||
var imgstr = spriteData2.img.pipe(gulp.dest('build/img/rasterImages/')); | ||
merge(imgstr,cssstr);*/ | ||
}); | ||
return merge(imgStream, cssStream); | ||
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.