├── .gitignore ├── README.md ├── china-ex.svg ├── cover.png ├── html ├── index.html ├── 样式.less └── 脚本.js ├── package.json ├── 生成字体子集.js └── 转译.js /.gitignore: -------------------------------------------------------------------------------- 1 | Un/* 2 | *.css 3 | package-lock.json 4 | china-ex-fixed.svg 5 | dist/* 6 | html/字体.woff -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |  2 | # 中国制霸生成器 3 | 中国三十四省级行政区域制霸标记生成工具 4 | 5 | https://lab.magiconch.com/china-ex/ 6 | 7 | 有感兴趣画简化矢量地图的小伙伴欢迎来一起整活儿~ 8 | 9 | ## [全球版在这里!🤗](https://github.com/itorr/world-ex) 10 | 11 | ## 功能 12 | 可以在线标记 居住、短居、游玩、出差、路过 标记后可生成图片进行社区分享 13 | 14 | 标记过的信息会记录到本地存储,有什么新进展再次打开网页更新即可 15 | 16 | ## 说明 17 | 简化地图在保留了地缘相接特征的基础上把省级行政区域尽可能简化成了方框,目标是把省级行政区域之间的关系通过画面展现到一目了然的程度 18 | 19 | 仅三十四省级行政区域可标记,九段线西沙南沙等群岛在地图上有标示 20 | 21 | ## 关于等级 22 | 23 | 我的个人标准 24 | 25 | - 居住:住过年以上 26 | - 短居:住过月以上 27 | - 游玩:旅行过 28 | - 出差:去过但完全没玩 29 | - 路过:汽车火车路过或飞机经停 30 | 31 | ## 提示 32 | 请使用自带浏览器进行保存 33 | 34 | ## 参考 35 | 参考自 https://zhung.com.tw/japanex/ 36 | 37 | ## 衍生 38 | - 吃货制霸 @lvwzhen https://github.com/lvwzhen/foodie-ex 39 | - 美国版、欧洲版 @tenpages https://github.com/tenpages/us-level 40 | - 全球版 @itorr https://github.com/itorr/world-ex 41 | - 普通/简化切换版 @qianphong https://github.com/qianphong/china-ex-ns 42 | - 中国马拉松制霸 @Likenttt https://github.com/Likenttt/china-city-marathon-ex 43 | - 福建版 @action-hong https://github.com/action-hong/china-ex 44 | - 大湾区版 @yusancky https://github.com/yusancky/GBA-ex 45 | - 自定义等级分享版 @kf-liu https://github.com/kf-liu/china-ex-pro 46 | 47 | ## 微博 48 | https://weibo.com/1197780522/MaCGDCt6N 49 | 50 | ## GitHub 51 | https://github.com/itorr/china-ex 52 | 53 | ## 反馈 54 | https://github.com/itorr/china-ex/issues 55 | 56 | ## 使用了 57 | 腾祥嘉丽大圆 58 | 59 | ## 协议 60 | 允许非商用非盈利的利用 61 | -------------------------------------------------------------------------------- /china-ex.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itorr/china-ex/c0662adc22903e0accc0779b3a0c1e5e40b4bd05/cover.png -------------------------------------------------------------------------------- /html/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 |([\s\S]+?)<\/p>/g,addTextFromMatch);
61 |
62 | return texts.join('');
63 | };
64 |
65 | const defaultText = `1234567890:`;
66 | const text = defaultText + getTextFromHTMLFile('html/index.html') + getTextFromHTMLFile('china-ex.svg');
67 | const fontURL = generateFontURL(`JiaLiDaYuanJF`,text);
68 |
69 |
70 | const axios = require('axios');
71 |
72 |
73 | const downFontFile = async _=>{
74 | let r = await axios.get(fontURL,{
75 | responseType: 'arraybuffer'
76 | });
77 | console.log(r.data);
78 | writeFileSync('html/字体.woff',r.data,'binary');
79 | };
80 |
81 | downFontFile();
--------------------------------------------------------------------------------
/转译.js:
--------------------------------------------------------------------------------
1 | const levelsStyleText = `
2 | #countrys>*[level="5"]{fill:#FF7E7E;}
3 | #countrys>*[level="4"]{fill:#FFB57E;}
4 | #countrys>*[level="3"]{fill:#FFE57E;}
5 | #countrys>*[level="2"]{fill:#A8FFBE;}
6 | #countrys>*[level="1"]{fill:#88AEFF;}
7 | #countrys>*[level="w"]{fill:#edd1ff;}
8 | `;
9 |
10 | const replaceSVG = text=>{
11 | text = text.replace(/ transform="matrix\(1 0 0 1 (\d+)(?:\.\d+)? (\d+)(?:\.\d+)?\)" class="(.+)"/g,' x="$1" y="$2" class="$3"')
12 | text = text.replace(//g,'')
13 | text = text.replace(/\n+/g,'\n')
14 | text = text.replace(/ xml:space="preserve"/g,'')
15 | text = text.replace(/ style="enable-background:new 0 0 \d+ \d+;?"/g,'')
16 | text = text.replace(/width="\d+px" height="\d+px"/g,'')
17 | text = text.replace(/ x="0px" y="0px"/g,'')
18 | text = text.replace(/ id="图层_1"/g,'')
19 | text = text.replace(/ version="1.1"/g,'')
20 | text = text.replace(/ xmlns:xlink="http:\/\/www\.w3\.org\/1999\/xlink"/g,'')
21 | text = text.replace(/