提交 4b5335c3 编辑于 作者: AppleMonkey2019's avatar AppleMonkey2019
浏览文件

fix(Icon): remove invalid icon and fixed source errors

Showing 148 additions284 deletions
+148 -284
......@@ -9,7 +9,7 @@
English | [简体中文](README.zh-CN.md)
## Introduction
The IconPark gives access to more than 1,300 high-quality icons, and introduces an interface for customizing your icons.
The IconPark gives access to more than 1,200 high-quality icons, and introduces an interface for customizing your icons.
Instead of using various SVG source files to achieve different themes, We implement a technology transforming attributes of an SVG source file into multiple themes. Besides, we provide cross-platform codes, like `react-icons`, `vue-icons`, `svg-icons`.
So whether you are a designer or a developer, you can use them in your designs or your codes for free.
<img src="https://sf1-dycdn-tos.pstatp.com/obj/eden-cn/lswwheh7nupwnuhog/icons/icon-dance.gif"></ifram>
......
......@@ -9,7 +9,7 @@
[English](README.md) | 简体中文
## 介绍
IconPark提供了超过1300个高质量图标,并且提供了一个界面来帮你定制图标。与使用各种SVG源文件来达到换肤效果的方案不同的是,我们实现了一种创新性的技术,
IconPark提供了超过1200个高质量图标,并且提供了一个界面来帮你定制图标。与使用各种SVG源文件来达到换肤效果的方案不同的是,我们实现了一种创新性的技术,
通过改变一个SVG文件的属性来变换出多种主题。并且支持跨平台导出多种图标代码库,方便您在代码中以组件的形式按需引用,比如`react-icons`, `vue-icons`, `svg-icons`.
所以不管您是设计师还是开发者,都可以在您的项目中去使用IconPark.
......
......@@ -10,7 +10,7 @@ interface IIconProps {
id: number;
title: string;
name: string;
svg: string;
svg?: string;
tag: string[];
category: string;
categoryCN: string;
......@@ -25,10 +25,35 @@ const map: {[key: string]: boolean} = {};
let count = 0;
let errors: {[key: string]: boolean} = {};
const data: IIconProps[] = arr.slice(1).map((item: string[], i) => {
const ALL_ICON_MAP: Record<string, [string, string]> = {};
const NEW_CSV: string[][] = arr.slice(0, 1);
fs.readdirSync(path.join(__dirname, '../source')).forEach(dir => {
const dirPath = path.join(__dirname, '../source', dir);
if (fs.statSync(dirPath).isDirectory()) {
fs.readdirSync(dirPath).forEach(file => {
const filePath = path.join(dirPath, file);
const key = path.basename(filePath, '.svg');
if (ALL_ICON_MAP[key]) {
console.log('图标名字重复:', key);
}
ALL_ICON_MAP[key] = [dir, fs.readFileSync(filePath, 'utf8')];
});
}
});
const data: IIconProps[] = [];
arr.slice(1).forEach((item: string[], i) => {
const name = item[1];
const category = item[3];
let category = item[3];
const filePath = path.resolve(__dirname, '../source', category, name + '.svg');
const result = category + '/' + name;
const printErrorMsg = (msg: string, data = result) => {
......@@ -40,9 +65,18 @@ const data: IIconProps[] = arr.slice(1).map((item: string[], i) => {
// 校验
if (!fs.existsSync(filePath)) {
printErrorMsg('svg路径不存在:请检查是否缺失svg或者拼写错误');
if (ALL_ICON_MAP[name]) {
svg = ALL_ICON_MAP[name][1];
printErrorMsg('svg分类错误: 请检查图标分类, 真实分类 = ' + ALL_ICON_MAP[name][0]);
NEW_CSV.push(item);
} else {
printErrorMsg('svg路径不存在: 请检查是否缺失svg或者拼写错误');
return;
}
} else {
svg = fs.readFileSync(filePath, 'utf8');
NEW_CSV.push(item);
}
// 非法字符
......@@ -63,20 +97,24 @@ const data: IIconProps[] = arr.slice(1).map((item: string[], i) => {
count = count + 1;
return {
data.push({
id: i,
title: item[0],
name,
category,
categoryCN: item[2],
author: item[5].replace(/[,, ]+/g, ''),
tag: item[4].split(/[,, ]+/),
time: item[6],
tag: item[5].split(/[,, ]+/).filter(item => item.trim()),
time: item[7],
svg
};
});
});
console.log('总图标数', count);
console.log('错误图标数', Object.keys(errors).length);
fs.writeFileSync(path.resolve(__dirname, '../source/icons.json'), JSON.stringify(data, null, 4), 'utf8');
data.forEach(item => delete item.svg);
fs.writeFileSync(path.resolve(__dirname, '../source/icons-config.json'), JSON.stringify(data, null, 4), 'utf8');
......@@ -4,7 +4,7 @@
## Introduction
### Features
* Provide more than 1300 icons
* Provide more than 1200 icons
* Provide 4 themes:
* outline
* filled
......
......@@ -4,7 +4,7 @@
## 介绍
### 新特性
* 提供超过1300图标
* 提供超过1200图标
* 支持4种主题:
* 线性
* 填充
......
......@@ -18,44 +18,23 @@ export default IconWrapper(
viewBox="0 0 48 48"
fill="none"
>
<path
d="M42 5H6V13H42V5Z"
fill="#09C8E2"
/>
<path
d="M42 5H6V13H42V5Z"
fill={props.colors[1]}
/>
<path
d="M42 5H6V13H42V5Z"
stroke={props.colors[0]}
strokeWidth={props.strokeWidth}
strokeLinejoin={props.strokeLinejoin}
/>
<path
d="M42 20H6V28H42V20Z"
fill="#09C8E2"
/>
<path
d="M42 20H6V28H42V20Z"
fill={props.colors[1]}
/>
<path
d="M42 20H6V28H42V20Z"
stroke={props.colors[0]}
strokeWidth={props.strokeWidth}
strokeLinejoin={props.strokeLinejoin}
/>
<path
d="M42 35H6V43H42V35Z"
fill="#09C8E2"
/>
<path
d="M42 35H6V43H42V35Z"
fill={props.colors[1]}
/>
<path
d="M42 35H6V43H42V35Z"
stroke={props.colors[0]}
strokeWidth={props.strokeWidth}
strokeLinejoin={props.strokeLinejoin}
......
......@@ -18,22 +18,11 @@ export default IconWrapper(
viewBox="0 0 48 48"
fill="none"
>
<circle
cx="24"
cy="24"
r="20"
fill="#09C8E2"
/>
<circle
cx="24"
cy="24"
r="20"
fill={props.colors[1]}
/>
<circle
cx="24"
cy="24"
r="20"
stroke={props.colors[0]}
strokeWidth={props.strokeWidth}
strokeLinecap={props.strokeLinecap}
......@@ -53,10 +42,6 @@ export default IconWrapper(
strokeLinecap={props.strokeLinecap}
strokeLinejoin={props.strokeLinejoin}
/>
<path
d="M21.1429 28L18 17L14.8571 28H21.1429Z"
fill="#09C8E2"
/>
<path
d="M21.1429 28L18 17L14.8571 28H21.1429Z"
fill={props.colors[1]}
......@@ -68,16 +53,9 @@ export default IconWrapper(
strokeLinecap={props.strokeLinecap}
strokeLinejoin={props.strokeLinejoin}
/>
<path
d="M35 24C35 29 31.4183 31 27 31V17C31.4183 17 35 19 35 24Z"
fill="#09C8E2"
/>
<path
d="M35 24C35 29 31.4183 31 27 31V17C31.4183 17 35 19 35 24Z"
fill={props.colors[1]}
/>
<path
d="M35 24C35 29 31.4183 31 27 31V17C31.4183 17 35 19 35 24Z"
stroke={props.colors[2]}
strokeWidth={props.strokeWidth}
strokeLinecap={props.strokeLinecap}
......
......@@ -18,32 +18,16 @@ export default IconWrapper(
viewBox="0 0 48 48"
fill="none"
>
<path
d="M4 14L24 4L34 9L44 14V34L24 44L4 34V14Z"
fill="#09C8E2"
/>
<path
d="M4 14L24 4L34 9L44 14V34L24 44L4 34V14Z"
fill={props.colors[1]}
/>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M4 14L14 19L24 24L44 14"
fill="#09C8E2"
/>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M4 14L14 19L24 24L44 14"
fill={props.colors[1]}
/>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M24 24V44V24Z"
fill="#09C8E2"
/>
<path
fillRule="evenodd"
clipRule="evenodd"
......
......@@ -16,44 +16,33 @@ export default IconWrapper(
width={props.size}
height={props.size}
viewBox="0 0 48 48"
fill="none"
>
<g
stroke="none"
<rect
x="6"
y="6"
width="36"
height="36"
rx="3"
fill={props.colors[1]}
stroke={props.colors[0]}
strokeWidth={props.strokeWidth}
fill="none"
fillRule="evenodd"
>
<g>
<rect
stroke={props.colors[0]}
strokeWidth={props.strokeWidth}
fill={props.colors[1]}
fillRule="nonzero"
strokeLinejoin={props.strokeLinejoin}
x="6"
y="6"
width="36"
height="36"
rx="3"
/>
<path
d="M18.3431458,18.3431458 L29.6568542,29.6568542"
stroke={props.colors[2]}
strokeWidth={props.strokeWidth}
strokeLinecap={props.strokeLinecap}
strokeLinejoin={props.strokeLinejoin}
transform="translate(24.000000, 24.000000) rotate(45.000000) translate(-24.000000, -24.000000) "
/>
<path
d="M29.6568542,18.3431458 L18.3431458,29.6568542"
stroke={props.colors[2]}
strokeWidth={props.strokeWidth}
strokeLinecap={props.strokeLinecap}
strokeLinejoin={props.strokeLinejoin}
transform="translate(24.000000, 24.000000) rotate(-135.000000) translate(-24.000000, -24.000000) "
/>
</g>
</g>
strokeLinejoin={props.strokeLinejoin}
/>
<path
d="M24 16V32"
stroke={props.colors[2]}
strokeWidth={props.strokeWidth}
strokeLinecap={props.strokeLinecap}
strokeLinejoin={props.strokeLinejoin}
/>
<path
d="M16 24L32 24"
stroke={props.colors[2]}
strokeWidth={props.strokeWidth}
strokeLinecap={props.strokeLinecap}
strokeLinejoin={props.strokeLinejoin}
/>
</svg>
)
);
......@@ -25,16 +25,9 @@ export default IconWrapper(
strokeLinecap={props.strokeLinecap}
strokeLinejoin={props.strokeLinejoin}
/>
<path
d="M6 30H24H42V42H6V30Z"
fill="#09C8E2"
/>
<path
d="M6 30H24H42V42H6V30Z"
fill={props.colors[1]}
/>
<path
d="M6 30H24H42V42H6V30Z"
stroke={props.colors[0]}
strokeWidth={props.strokeWidth}
strokeLinecap={props.strokeLinecap}
......
......@@ -16,42 +16,29 @@ export default IconWrapper(
width={props.size}
height={props.size}
viewBox="0 0 48 48"
fill="none"
>
<g
stroke="none"
<path
d="M24 44C35.0457 44 44 35.0457 44 24C44 12.9543 35.0457 4 24 4C12.9543 4 4 12.9543 4 24C4 35.0457 12.9543 44 24 44Z"
fill={props.colors[1]}
stroke={props.colors[0]}
strokeWidth={props.strokeWidth}
fill="none"
fillRule="evenodd"
>
<g>
<circle
stroke={props.colors[0]}
strokeWidth={props.strokeWidth}
fill={props.colors[1]}
fillRule="nonzero"
strokeLinejoin={props.strokeLinejoin}
cx="24"
cy="24"
r="20"
/>
<path
d="M18.3431458,18.3431458 L29.6568542,29.6568542"
stroke={props.colors[2]}
strokeWidth={props.strokeWidth}
strokeLinecap={props.strokeLinecap}
strokeLinejoin={props.strokeLinejoin}
transform="translate(24.000000, 24.000000) rotate(45.000000) translate(-24.000000, -24.000000) "
/>
<path
d="M29.6568542,18.3431458 L18.3431458,29.6568542"
stroke={props.colors[2]}
strokeWidth={props.strokeWidth}
strokeLinecap={props.strokeLinecap}
strokeLinejoin={props.strokeLinejoin}
transform="translate(24.000000, 24.000000) rotate(-135.000000) translate(-24.000000, -24.000000) "
/>
</g>
</g>
strokeLinejoin={props.strokeLinejoin}
/>
<path
d="M24 16V32"
stroke={props.colors[2]}
strokeWidth={props.strokeWidth}
strokeLinecap={props.strokeLinecap}
strokeLinejoin={props.strokeLinejoin}
/>
<path
d="M16 24L32 24"
stroke={props.colors[2]}
strokeWidth={props.strokeWidth}
strokeLinecap={props.strokeLinecap}
strokeLinejoin={props.strokeLinejoin}
/>
</svg>
)
);
......@@ -25,16 +25,9 @@ export default IconWrapper(
strokeLinecap={props.strokeLinecap}
strokeLinejoin={props.strokeLinejoin}
/>
<path
d="M18 28H42V42H18V35V28Z"
fill="#09C8E2"
/>
<path
d="M18 28H42V42H18V35V28Z"
fill={props.colors[1]}
/>
<path
d="M18 28H42V42H18V35V28Z"
stroke={props.colors[0]}
strokeWidth={props.strokeWidth}
strokeLinecap={props.strokeLinecap}
......
......@@ -46,22 +46,11 @@ export default IconWrapper(
strokeLinecap={props.strokeLinecap}
strokeLinejoin={props.strokeLinejoin}
/>
<circle
cx="24"
cy="17"
r="4"
fill="#09C8E2"
/>
<circle
cx="24"
cy="17"
r="4"
fill={props.colors[1]}
/>
<circle
cx="24"
cy="17"
r="4"
stroke={props.colors[0]}
strokeWidth={props.strokeWidth}
strokeLinecap={props.strokeLinecap}
......
......@@ -18,18 +18,10 @@ export default IconWrapper(
viewBox="0 0 48 48"
fill="none"
>
<path
d="M14 29H42V41H14V35V29Z"
fill="#09C8E2"
/>
<path
d="M14 29H42V41H14V35V29Z"
fill={props.colors[1]}
/>
<path
d="M14 7H42V19H14V13V7Z"
fill="#09C8E2"
/>
<path
d="M14 7H42V19H14V13V7Z"
fill={props.colors[1]}
......@@ -48,31 +40,17 @@ export default IconWrapper(
strokeLinecap={props.strokeLinecap}
strokeLinejoin={props.strokeLinejoin}
/>
<path
d="M14 29H42V41H14V35V29Z"
fill="#09C8E2"
/>
<path
d="M14 29H42V41H14V35V29Z"
fill={props.colors[1]}
/>
<path
d="M14 29H42V41H14V35V29Z"
stroke={props.colors[0]}
strokeWidth={props.strokeWidth}
strokeLinecap={props.strokeLinecap}
strokeLinejoin={props.strokeLinejoin}
/>
<path
d="M14 7H42V19H14V13V7Z"
fill="#09C8E2"
/>
<path
d="M14 7H42V19H14V13V7Z"
fill={props.colors[1]}
/>
<path
d="M14 7H42V19H14V13V7Z"
stroke={props.colors[0]}
strokeWidth={props.strokeWidth}
strokeLinecap={props.strokeLinecap}
......
......@@ -18,10 +18,6 @@ export default IconWrapper(
viewBox="0 0 48 48"
fill="none"
>
<path
d="M4 4H44V44H4V4Z"
fill="#09C8E2"
/>
<path
d="M4 4H44V44H4V4Z"
fill={props.colors[1]}
......
......@@ -27,12 +27,6 @@ export default IconWrapper(
strokeLinecap={props.strokeLinecap}
strokeLinejoin={props.strokeLinejoin}
/>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M24 37V44V37Z"
fill="#09C8E2"
/>
<path
fillRule="evenodd"
clipRule="evenodd"
......@@ -46,12 +40,6 @@ export default IconWrapper(
strokeLinecap={props.strokeLinecap}
strokeLinejoin={props.strokeLinejoin}
/>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M36 24H44H36Z"
fill="#09C8E2"
/>
<path
fillRule="evenodd"
clipRule="evenodd"
......@@ -65,12 +53,6 @@ export default IconWrapper(
strokeLinecap={props.strokeLinecap}
strokeLinejoin={props.strokeLinejoin}
/>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M4 24H11H4Z"
fill="#09C8E2"
/>
<path
fillRule="evenodd"
clipRule="evenodd"
......@@ -84,12 +66,6 @@ export default IconWrapper(
strokeLinecap={props.strokeLinecap}
strokeLinejoin={props.strokeLinejoin}
/>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M24 11V4V11Z"
fill="#09C8E2"
/>
<path
fillRule="evenodd"
clipRule="evenodd"
......
......@@ -19,7 +19,7 @@ export default IconWrapper(
fill="none"
>
<path
d="M12 35.0137H9H4V8.01273C4 6.90868 4.89543 6.01367 6 6.01367H42C43.1046 6.01367 44 6.90868 44 8.01273V35.0137H36"
d="M12 35.0136H9H4V8.01267C4 6.90862 4.89543 6.01361 6 6.01361H42C43.1046 6.01361 44 6.90862 44 8.01267V35.0136H36"
stroke={props.colors[0]}
strokeWidth={props.strokeWidth}
strokeLinecap={props.strokeLinecap}
......
......@@ -18,31 +18,17 @@ export default IconWrapper(
viewBox="0 0 48 48"
fill="none"
>
<path
d="M36 4C31.0294 4 27 8.02944 27 13V44H33V21.4879C33.9383 21.8195 34.9481 22 36 22C39.4829 22 42.5038 20.0216 44 17.1272V8.8728C42.5038 5.97844 39.4829 4 36 4Z"
fill="#09C8E2"
/>
<path
d="M36 4C31.0294 4 27 8.02944 27 13V44H33V21.4879C33.9383 21.8195 34.9481 22 36 22C39.4829 22 42.5038 20.0216 44 17.1272V8.8728C42.5038 5.97844 39.4829 4 36 4Z"
fill={props.colors[1]}
/>
<path
d="M36 4C31.0294 4 27 8.02944 27 13V44H33V21.4879C33.9383 21.8195 34.9481 22 36 22C39.4829 22 42.5038 20.0216 44 17.1272V8.8728C42.5038 5.97844 39.4829 4 36 4Z"
stroke={props.colors[0]}
strokeWidth={props.strokeWidth}
strokeLinecap={props.strokeLinecap}
strokeLinejoin={props.strokeLinejoin}
/>
<path
d="M12 4C16.9706 4 21 8.02944 21 13V44H15V21.4879C14.0617 21.8195 13.0519 22 12 22C8.51707 22 5.49623 20.0216 4 17.1272V8.8728C5.49623 5.97844 8.51707 4 12 4Z"
fill="#09C8E2"
/>
<path
d="M12 4C16.9706 4 21 8.02944 21 13V44H15V21.4879C14.0617 21.8195 13.0519 22 12 22C8.51707 22 5.49623 20.0216 4 17.1272V8.8728C5.49623 5.97844 8.51707 4 12 4Z"
fill={props.colors[1]}
/>
<path
d="M12 4C16.9706 4 21 8.02944 21 13V44H15V21.4879C14.0617 21.8195 13.0519 22 12 22C8.51707 22 5.49623 20.0216 4 17.1272V8.8728C5.49623 5.97844 8.51707 4 12 4Z"
stroke={props.colors[0]}
strokeWidth={props.strokeWidth}
strokeLinecap={props.strokeLinecap}
......
......@@ -18,57 +18,55 @@ export default IconWrapper(
viewBox="0 0 48 48"
fill="none"
>
<g>
<path
d="M14 25C14 19.4772 18.4772 15 24 15C29.5228 15 34 19.4772 34 25V41H14V25Z"
fill={props.colors[1]}
stroke={props.colors[0]}
strokeWidth={props.strokeWidth}
strokeLinejoin={props.strokeLinejoin}
/>
<path
d="M24 5V8"
stroke={props.colors[0]}
strokeWidth={props.strokeWidth}
strokeLinecap={props.strokeLinecap}
strokeLinejoin={props.strokeLinejoin}
/>
<path
d="M35.8916 9.32823L33.9632 11.6264"
stroke={props.colors[0]}
strokeWidth={props.strokeWidth}
strokeLinecap={props.strokeLinecap}
strokeLinejoin={props.strokeLinejoin}
/>
<path
d="M42.2189 20.2876L39.2645 20.8085"
stroke={props.colors[0]}
strokeWidth={props.strokeWidth}
strokeLinecap={props.strokeLinecap}
strokeLinejoin={props.strokeLinejoin}
/>
<path
d="M5.78106 20.2876L8.73548 20.8086"
stroke={props.colors[0]}
strokeWidth={props.strokeWidth}
strokeLinecap={props.strokeLinecap}
strokeLinejoin={props.strokeLinejoin}
/>
<path
d="M12.1084 9.32826L14.0368 11.6264"
stroke={props.colors[0]}
strokeWidth={props.strokeWidth}
strokeLinecap={props.strokeLinecap}
strokeLinejoin={props.strokeLinejoin}
/>
<path
d="M6 41H43"
stroke={props.colors[0]}
strokeWidth={props.strokeWidth}
strokeLinecap={props.strokeLinecap}
strokeLinejoin={props.strokeLinejoin}
/>
</g>
<path
d="M14 25C14 19.4772 18.4772 15 24 15C29.5228 15 34 19.4772 34 25V41H14V25Z"
fill={props.colors[1]}
stroke={props.colors[0]}
strokeWidth={props.strokeWidth}
strokeLinejoin={props.strokeLinejoin}
/>
<path
d="M24 5V8"
stroke={props.colors[0]}
strokeWidth={props.strokeWidth}
strokeLinecap={props.strokeLinecap}
strokeLinejoin={props.strokeLinejoin}
/>
<path
d="M35.8916 9.32817L33.9632 11.6263"
stroke={props.colors[0]}
strokeWidth={props.strokeWidth}
strokeLinecap={props.strokeLinecap}
strokeLinejoin={props.strokeLinejoin}
/>
<path
d="M42.219 20.2875L39.2645 20.8085"
stroke={props.colors[0]}
strokeWidth={props.strokeWidth}
strokeLinecap={props.strokeLinecap}
strokeLinejoin={props.strokeLinejoin}
/>
<path
d="M5.78104 20.2875L8.73546 20.8084"
stroke={props.colors[0]}
strokeWidth={props.strokeWidth}
strokeLinecap={props.strokeLinecap}
strokeLinejoin={props.strokeLinejoin}
/>
<path
d="M12.1084 9.32817L14.0368 11.6263"
stroke={props.colors[0]}
strokeWidth={props.strokeWidth}
strokeLinecap={props.strokeLinecap}
strokeLinejoin={props.strokeLinejoin}
/>
<path
d="M6 41H43"
stroke={props.colors[0]}
strokeWidth={props.strokeWidth}
strokeLinecap={props.strokeLinecap}
strokeLinejoin={props.strokeLinejoin}
/>
</svg>
)
);
......@@ -19,14 +19,14 @@ export default IconWrapper(
fill="none"
>
<path
d="M24 44.3332C34.1252 44.3332 42.3333 36.1251 42.3333 25.9998C42.3333 15.8746 34.1252 7.6665 24 7.6665C13.8747 7.6665 5.66663 15.8746 5.66663 25.9998C5.66663 36.1251 13.8747 44.3332 24 44.3332Z"
d="M24 44.3333C34.1252 44.3333 42.3333 36.1252 42.3333 26C42.3333 15.8747 34.1252 7.66663 24 7.66663C13.8747 7.66663 5.66663 15.8747 5.66663 26C5.66663 36.1252 13.8747 44.3333 24 44.3333Z"
fill={props.colors[1]}
stroke={props.colors[0]}
strokeWidth={props.strokeWidth}
strokeLinejoin={props.strokeLinejoin}
/>
<path
d="M23.7594 15.3534L23.7582 26.3622L31.5305 34.1345"
d="M23.7594 15.3535L23.7582 26.3623L31.5305 34.1346"
stroke={props.colors[2]}
strokeWidth={props.strokeWidth}
strokeLinecap={props.strokeLinecap}
......
支持 Markdown
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册