From 286ad57d9e2eb4dc72644381ebecefdd4464d593 Mon Sep 17 00:00:00 2001 From: codecalm Date: Sat, 21 Mar 2020 22:33:22 +0100 Subject: readme fixes, png images of icons --- .github/icons-stroke.png | Bin 0 -> 6479 bytes .github/icons-stroke.svg | 22 +++---- .github/icons.png | Bin 76711 -> 177010 bytes README.md | 6 +- gulpfile.js | 148 +++++++++++++++++++++++++++++++++++++++-------- 5 files changed, 139 insertions(+), 37 deletions(-) create mode 100644 .github/icons-stroke.png diff --git a/.github/icons-stroke.png b/.github/icons-stroke.png new file mode 100644 index 0000000..8c89357 Binary files /dev/null and b/.github/icons-stroke.png differ diff --git a/.github/icons-stroke.svg b/.github/icons-stroke.svg index e91bfe8..e1c3269 100644 --- a/.github/icons-stroke.svg +++ b/.github/icons-stroke.svg @@ -1,19 +1,19 @@ - - + + - + - + - + - + - - - - - + + + + + \ No newline at end of file diff --git a/.github/icons.png b/.github/icons.png index dd929ef..2913a33 100644 Binary files a/.github/icons.png and b/.github/icons.png differ diff --git a/README.md b/README.md index 639057f..def35f1 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,11 @@ A set of over 300 free MIT-licensed high-quality SVG icons for you to use in your web projects. Each icon is designed on a 24x24 grid and a `2px` stroke. -**If you want to support my project and help me grow it, you can [become a sponsor on GitHub](https://github.com/sponsors/codecalm)!** +**If you want to support my project and help me grow it, you can [become a sponsor on GitHub](https://github.com/sponsors/codecalm) or just [donate me on PayPal](https://paypal.me/codecalm) 🙂** ## Preview -![](./.github/icons.svg) +![](https://raw.githubusercontent.com/tabler/tabler-icons/master/.github/icons.png) ## Installation @@ -71,7 +71,7 @@ Add an icon to be displayed on your page with the following markup (`activity` i All icons in this repository have been created with the value of the `stroke-width` property, so if you change the value, you can get different icon variants that will fit in well with your design. -![](./.github/icons-stroke.svg) +![](https://raw.githubusercontent.com/tabler/tabler-icons/master/.github/icons-stroke.png) ## License diff --git a/gulpfile.js b/gulpfile.js index 679c3ef..7d0110e 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -49,8 +49,9 @@ const createScreenshot = async (filePath) => { const page = await browser.newPage(); await page.setViewport({ - height: 100, - width: 100 + height: 10, + width: 10, + deviceScaleFactor: 2 }); await page.goto(htmlFilePath); @@ -68,6 +69,77 @@ const createScreenshot = async (filePath) => { } }; + +const printChangelog = function(newIcons, modifiedIcons, renamedIcons) { + if(newIcons.length > 0) { + let str = ''; + str += `${newIcons.length} new icons: `; + + newIcons.forEach(function(icon, i){ + str += `\`${icon}\``; + + if((i + 1) <= newIcons.length - 1) { + str += ', ' + } + }); + + console.log(str); + console.log(''); + } + + if(modifiedIcons.length > 0) { + let str = ''; + str += `Fixed icons: `; + + modifiedIcons.forEach(function(icon, i){ + str += `\`${icon}\``; + + if((i + 1) <= modifiedIcons.length - 1) { + str += ', ' + } + }); + + console.log(str); + console.log(''); + } + + if(renamedIcons.length > 0) { + console.log(`Renamed icons: `); + + renamedIcons.forEach(function(icon, i){ + console.log(`- \`${icon[0]}\` renamed to \`${icon[1]}\``); + }); + } +}; + + + +gulp.task('build-zip', function() { + const version = p.version; + + return gulp.src('{icons/**/*,icons-png/**/*,tabler-sprite.svg,tabler-sprite-nostroke.svg}') + .pipe(zip(`tabler-icons-${version}.zip`)) + .pipe(gulp.dest('packages')) +}); + +gulp.task('build-jekyll', function(cb){ + cp.exec('bundle exec jekyll build', function() { + cb(); + }); +}); + +gulp.task('build-copy', function(cb){ + cp.exec('mkdir -p icons/ && rm -fd ./icons/* && cp ./_site/icons/* ./icons', function() { + cb(); + }); +}); + +gulp.task('clean-png', function(cb){ + cp.exec('rm -fd ./icons-png/*', function() { + cb(); + }); +}); + gulp.task('icons-sprite', function (cb) { glob("_site/icons/*.svg", {}, function (er, files) { @@ -143,14 +215,14 @@ gulp.task('icons-preview', function (cb) { }); }); -gulp.task('icons-stroke', function (cb) { +gulp.task('icons-stroke', gulp.series('build-jekyll', function (cb) { const icon = "disabled", strokes = ['.5', '1', '1.5', '2', '2.75'], - svgFileContent = fs.readFileSync(`_site/icons/${icon}.svg`).toString(), + svgFileContent = fs.readFileSync(`icons/${icon}.svg`).toString(), padding = 16, paddingOuter = 5, - iconSize = 64, + iconSize = 32, width = (strokes.length * (iconSize + padding) - padding) + paddingOuter * 2, height = iconSize + paddingOuter * 2; @@ -174,10 +246,10 @@ gulp.task('icons-stroke', function (cb) { const svgContent = `\n${svgContentSymbols}\n${svgContentIcons}\n`; - fs.writeFileSync('icons-stroke.svg', svgContent); - createScreenshot('icons-stroke.svg'); + fs.writeFileSync('.github/icons-stroke.svg', svgContent); + createScreenshot('.github/icons-stroke.svg'); cb(); -}); +})); gulp.task('optimize', function (cb) { glob("src/_icons/*.svg", {}, function (er, files) { @@ -202,32 +274,62 @@ gulp.task('optimize', function (cb) { }); }); -gulp.task('build-zip', function(cb) { - const version = p.version; - return gulp.src('{icons/**/*,icons-png/**/*,tabler-sprite.svg,tabler-sprite-nostroke.svg}') - .pipe(zip(`tabler-icons-${version}.zip`)) - .pipe(gulp.dest('packages')) -}); +gulp.task('changelog-commit', function(cb) { + cp.exec('git status', function(err, ret) { + let newIcons = [], modifiedIcons = [], renamedIcons = []; -gulp.task('build-jekyll', function(cb){ - cp.exec('bundle exec jekyll build', function() { - cb(); - }); -}); + ret.replace(/new file:\s+src\/_icons\/([a-z1-9-]+)\.svg/g, function (m, fileName) { + newIcons.push(fileName); + }); + + ret.replace(/modified:\s+src\/_icons\/([a-z1-9-]+)\.svg/g, function (m, fileName) { + modifiedIcons.push(fileName); + }); + + ret.replace(/renamed:\s+src\/_icons\/([a-z1-9-]+).svg -> src\/_icons\/([a-z1-9-]+).svg/g, function (m, fileNameBefore, fileNameAfter) { + renamedIcons.push([fileNameBefore, fileNameAfter]); + }); + + modifiedIcons = modifiedIcons.filter( function( el ) { + return newIcons.indexOf( el ) < 0; + }); + + printChangelog(newIcons, modifiedIcons, renamedIcons); -gulp.task('build-copy', function(cb){ - cp.exec('mkdir -p icons/ && rm -fd ./icons/* && cp ./_site/icons/* ./icons', function() { cb(); }); }); -gulp.task('clean-png', function(cb){ - cp.exec('rm -fd ./icons-png/*', function() { +gulp.task('changelog-diff', function(cb) { + const version = p.version; + cp.exec(`git diff v${version} HEAD --name-status`, function(err, ret) { + + let newIcons = [], modifiedIcons = [], renamedIcons = []; + + ret.replace(/A\s+src\/_icons\/([a-z1-9-]+)\.svg/g, function (m, fileName) { + newIcons.push(fileName); + }); + + ret.replace(/M\s+src\/_icons\/([a-z1-9-]+)\.svg/g, function (m, fileName) { + modifiedIcons.push(fileName); + }); + + ret.replace(/R[0-9]+\s+src\/_icons\/([a-z1-9-]+)\.svg\s+src\/_icons\/([a-z1-9-]+).svg/g, function (m, fileNameBefore, fileNameAfter) { + renamedIcons.push([fileNameBefore, fileNameAfter]); + }); + + modifiedIcons = modifiedIcons.filter( function( el ) { + return newIcons.indexOf( el ) < 0; + }); + + printChangelog(newIcons, modifiedIcons, renamedIcons); + cb(); }); }); + gulp.task('svg-to-png', gulp.series('build-jekyll', 'clean-png', async (cb) => { let files = glob.sync("_site/icons/*.svg"); -- cgit v1.2.1 From 5af1b6c53ca948186d624076fcd7e19b9d561155 Mon Sep 17 00:00:00 2001 From: codecalm Date: Sat, 21 Mar 2020 22:35:21 +0100 Subject: icons-stroke fix --- .github/icons-stroke.png | Bin 6479 -> 7714 bytes .github/icons-stroke.svg | 2 +- gulpfile.js | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/icons-stroke.png b/.github/icons-stroke.png index 8c89357..5451105 100644 Binary files a/.github/icons-stroke.png and b/.github/icons-stroke.png differ diff --git a/.github/icons-stroke.svg b/.github/icons-stroke.svg index e1c3269..a85315f 100644 --- a/.github/icons-stroke.svg +++ b/.github/icons-stroke.svg @@ -1,4 +1,4 @@ - + diff --git a/gulpfile.js b/gulpfile.js index 7d0110e..75699b1 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -223,7 +223,7 @@ gulp.task('icons-stroke', gulp.series('build-jekyll', function (cb) { padding = 16, paddingOuter = 5, iconSize = 32, - width = (strokes.length * (iconSize + padding) - padding) + paddingOuter * 2, + width = 882, height = iconSize + paddingOuter * 2; let svgContentSymbols = '', -- cgit v1.2.1 From 7b1346e7faacd5ec601e8c998c02697045aa3590 Mon Sep 17 00:00:00 2001 From: codecalm Date: Sat, 21 Mar 2020 22:36:30 +0100 Subject: readme fix --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index def35f1..e710e9f 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ A set of over 300 free MIT-licensed high-quality SVG icons for you to use in your web projects. Each icon is designed on a 24x24 grid and a `2px` stroke. -**If you want to support my project and help me grow it, you can [become a sponsor on GitHub](https://github.com/sponsors/codecalm) or just [donate me on PayPal](https://paypal.me/codecalm) 🙂** +**If you want to support my project and help me grow it, you can [become a sponsor on GitHub](https://github.com/sponsors/codecalm) or just [donate me on PayPal](https://paypal.me/codecalm) :)** ## Preview -- cgit v1.2.1