Skip to content

Commit

Permalink
fix "off" icons
Browse files Browse the repository at this point in the history
  • Loading branch information
codecalm committed Apr 17, 2022
1 parent 5474c02 commit 235f9e5
Show file tree
Hide file tree
Showing 60 changed files with 5 additions and 118 deletions.
2 changes: 2 additions & 0 deletions _import.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ do
sed -i "" 's/xmlns="http:\/\/www.w3.org\/2000\/svg"//g' ${file}
sed -i "" 's/<path d="M0 0h24v24H0z"\/>"//g' ${file}
sed -i "" 's/<path stroke="red" stroke-width=".1" d="M5 1l18 18"\/>//g' ${file}
sed -i "" 's/<path stroke="red" stroke-width=".1" d="M5 1l18 18" \/>//g' ${file}
sed -i "" 's/<path stroke="red" stroke-width=".1" d="M3 3l18 18"\/>//g' ${file}
sed -i "" 's/<path stroke="red" stroke-width=".1" d="M3 3l18 18" \/>//g' ${file}
done

svgo -f ./new/ --pretty --disable mergePaths
Expand Down
5 changes: 3 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ if (fs.existsSync('./compile-options.json')) {
}
})
}

if (typeof tempOptions.excludeIcons !== "undefined") {
if (!Array.isArray(tempOptions.excludeIcons)) {
throw "property excludeIcons is not an array"
Expand Down Expand Up @@ -509,6 +509,7 @@ gulp.task('optimize', function (cb) {
svgFileContent = svgFileContent
.replace(/><\/(polyline|line|rect|circle|path)>/g, '/>')
.replace(/rx="([^"]+)"\s+ry="\1"/g, 'rx="$1"')
.replace(/<path stroke="red" stroke-width="\.1"([^>]+)?\/>/g, '')
.replace(/\s?\/>/g, ' />')
.replace(/\n\s*<(line|circle|path|polyline|rect)/g, "\n <$1")
.replace(/polyline points="([0-9.]+)\s([0-9.]+)\s([0-9.]+)\s([0-9.]+)"/g, 'line x1="$1" y1="$2" x2="$3" y2="$4"')
Expand All @@ -519,7 +520,7 @@ gulp.task('optimize', function (cb) {
})
.replace(/d="m/g, 'd="M')
.replace(/([Aa])\s?([0-9.]+)\s([0-9.]+)\s([0-9.]+)\s?([0-1])\s?([0-1])\s?(-?[0-9.]+)\s?(-?[0-9.]+)/gi, '$1$2 $3 $4 $5 $6 $7 $8')
.replace(/\n\n+/g, "\n")
.replace(/\n\s+\n+/g, "\n")

.replace(/<path d="M([0-9.]*) ([0-9.]*)l\s?([-0-9.]*) ([-0-9.]*)"/g, function (f, r1, r2, r3, r4) {
return `<line x1="${r1}" y1="${r2}" x2="${addFloats(r1, r3)}" y2="${addFloats(r2, r4)}"`
Expand Down
2 changes: 0 additions & 2 deletions src/_icons/anchor-off.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions src/_icons/api-off.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions src/_icons/atom-off.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions src/_icons/award-off.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions src/_icons/badge-off.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions src/_icons/badges-off.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions src/_icons/ballon-off.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions src/_icons/barrel-off.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions src/_icons/bath-off.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions src/_icons/bed-off.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions src/_icons/beer-off.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions src/_icons/box-off.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions src/_icons/bucket-off.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions src/_icons/cake-off.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions src/_icons/cash-off.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions src/_icons/coffee-off.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions src/_icons/container-off.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions src/_icons/cpu-off.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions src/_icons/crane-off.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions src/_icons/creative-commons-off.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions src/_icons/cross-off.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions src/_icons/crutches-off.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions src/_icons/cup-off.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions src/_icons/current-location-off.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions src/_icons/cursor-off.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions src/_icons/dental-off.svg
2 changes: 0 additions & 2 deletions src/_icons/device-nintendo-off.svg
2 changes: 0 additions & 2 deletions src/_icons/device-speaker-off.svg
2 changes: 0 additions & 2 deletions src/_icons/devices-pc-off.svg
2 changes: 0 additions & 2 deletions src/_icons/dialpad-off.svg
2 changes: 0 additions & 2 deletions src/_icons/diamond-off.svg
2 changes: 0 additions & 2 deletions src/_icons/directions-off.svg
2 changes: 0 additions & 2 deletions src/_icons/disabled-off.svg
2 changes: 0 additions & 2 deletions src/_icons/disc-off.svg
2 changes: 0 additions & 2 deletions src/_icons/dna-2-off.svg
2 changes: 0 additions & 2 deletions src/_icons/dna-off.svg
2 changes: 0 additions & 2 deletions src/_icons/door-off.svg
2 changes: 0 additions & 2 deletions src/_icons/download-off.svg
2 changes: 0 additions & 2 deletions src/_icons/edit-circle-off.svg
2 changes: 0 additions & 2 deletions src/_icons/edit-off.svg
2 changes: 0 additions & 2 deletions src/_icons/egg-off.svg
2 changes: 0 additions & 2 deletions src/_icons/engine-off.svg
2 changes: 0 additions & 2 deletions src/_icons/error-404-off.svg
2 changes: 0 additions & 2 deletions src/_icons/exchange-off.svg
2 changes: 0 additions & 2 deletions src/_icons/exclamation-mark-off.svg
2 changes: 0 additions & 2 deletions src/_icons/external-link-off.svg
2 changes: 0 additions & 2 deletions src/_icons/eyeglass-off.svg
2 changes: 0 additions & 2 deletions src/_icons/face-mask-off.svg
2 changes: 0 additions & 2 deletions src/_icons/feather-off.svg
2 changes: 0 additions & 2 deletions src/_icons/fence-off.svg
2 changes: 0 additions & 2 deletions src/_icons/fingerprint-off.svg
2 changes: 0 additions & 2 deletions src/_icons/fish-off.svg
Loading

0 comments on commit 235f9e5

Please sign in to comment.