@iconkadeh/icons 1.1.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/css/all/all.css +28273 -28282
- package/css/bold/all.css +7200 -7202
- package/css/bold/rounded.css +3600 -3601
- package/css/bold/straight.css +3600 -3601
- package/css/brands/all.css +3 -4
- package/css/iconkadeh-bold-rounded.woff +0 -0
- package/css/iconkadeh-bold-rounded.woff2 +0 -0
- package/css/iconkadeh-bold-straight.woff +0 -0
- package/css/iconkadeh-bold-straight.woff2 +0 -0
- package/css/iconkadeh-regular-rounded.woff +0 -0
- package/css/iconkadeh-regular-rounded.woff2 +0 -0
- package/css/iconkadeh-regular-straight.woff +0 -0
- package/css/iconkadeh-regular-straight.woff2 +0 -0
- package/css/iconkadeh-solid-rounded.woff +0 -0
- package/css/iconkadeh-solid-rounded.woff2 +0 -0
- package/css/iconkadeh-solid-straight.woff +0 -0
- package/css/iconkadeh-solid-straight.woff2 +0 -0
- package/css/iconkadeh-thin-rounded.woff +0 -0
- package/css/iconkadeh-thin-rounded.woff2 +0 -0
- package/css/iconkadeh-thin-straight.woff +0 -0
- package/css/iconkadeh-thin-straight.woff2 +0 -0
- package/css/regular/all.css +7198 -7200
- package/css/regular/rounded.css +3600 -3601
- package/css/regular/straight.css +3598 -3599
- package/css/solid/all.css +7139 -7141
- package/css/solid/rounded.css +3558 -3559
- package/css/solid/straight.css +3581 -3582
- package/css/thin/all.css +6733 -6735
- package/css/thin/rounded.css +3359 -3360
- package/css/thin/straight.css +3374 -3375
- package/package.json +1 -1
- package/utils/update-fonts.js +0 -90
package/package.json
CHANGED
package/utils/update-fonts.js
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
const fs = require("fs");
|
|
2
|
-
const https = require("https");
|
|
3
|
-
const path = require("path");
|
|
4
|
-
|
|
5
|
-
const CSS_FOLDER = path.resolve(__dirname, "../css");
|
|
6
|
-
const FONTS_FOLDER = path.resolve(__dirname, "../css");
|
|
7
|
-
const CDN_URL = Buffer.from("aHR0cHM6Ly9jZG4tdWljb25zLmZsYXRpY29uLmNvbS8yLjQuMg==", "base64").toString("utf8");
|
|
8
|
-
|
|
9
|
-
const ICON_STYLES = ["bold", "regular", "solid", "thin"];
|
|
10
|
-
const ICON_FAMILIES = ["rounded", "straight"];
|
|
11
|
-
const WEBFONT_EXTENSIONS = ["eot", "woff2", "woff"];
|
|
12
|
-
|
|
13
|
-
function updateStyles() {
|
|
14
|
-
for (const style of ICON_STYLES) {
|
|
15
|
-
for (const family of ICON_FAMILIES) {
|
|
16
|
-
const url = `/uicons-${style}-${family}/css/uicons-${style}-${family}.css`;
|
|
17
|
-
const localPath = `/${style}/${family}.css`;
|
|
18
|
-
const remoteId = `uicons-${style}-${style === 'brands' ? '' : style + '-'}${family}`;
|
|
19
|
-
const remoteCleanId = `uicons-${style}-${family}`;
|
|
20
|
-
const localId = `iconkadeh-${style}-${family}`;
|
|
21
|
-
|
|
22
|
-
updateFont(url, localPath, remoteCleanId, localId);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function updateBrands() {
|
|
28
|
-
const url = `/uicons-brands/css/uicons-brands.css`;
|
|
29
|
-
const localPath = `/brands/all.css`;
|
|
30
|
-
|
|
31
|
-
updateFont(url, localPath, "uicons-brands", "iconkadeh-brands");
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function updateCssFile(url, filePath, remoteId, localId) {
|
|
35
|
-
const fullUrl = CDN_URL + url;
|
|
36
|
-
const fullFilePath = path.join(CSS_FOLDER, filePath);
|
|
37
|
-
|
|
38
|
-
fs.mkdirSync(path.dirname(fullFilePath), { recursive: true });
|
|
39
|
-
|
|
40
|
-
https.get(fullUrl, res => {
|
|
41
|
-
let content = "";
|
|
42
|
-
|
|
43
|
-
res.on("data", data => content += data);
|
|
44
|
-
|
|
45
|
-
res.on("end", () => {
|
|
46
|
-
const regexpr = new RegExp(`${CDN_URL}/${remoteId}/webfonts`, "g");
|
|
47
|
-
let newContent = content.replace(regexpr, "..");
|
|
48
|
-
|
|
49
|
-
newContent = newContent.replace(new RegExp(remoteId, "g"), localId);
|
|
50
|
-
|
|
51
|
-
fs.writeFileSync(fullFilePath, newContent, "utf8");
|
|
52
|
-
console.log(`Updated: ${filePath}`);
|
|
53
|
-
});
|
|
54
|
-
}).on("error", err => {
|
|
55
|
-
console.error(`Error downloading CSS: ${err.message}`);
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
function downloadWebFont(remoteId, localId) {
|
|
60
|
-
const fontUrlBase = `${CDN_URL}/${remoteId}/webfonts`;
|
|
61
|
-
|
|
62
|
-
for (const ext of WEBFONT_EXTENSIONS) {
|
|
63
|
-
const remoteFileName = `${remoteId}.${ext}`;
|
|
64
|
-
const localFileName = `${localId}.${ext}`;
|
|
65
|
-
const fontUrl = `${fontUrlBase}/${remoteFileName}`;
|
|
66
|
-
const targetPath = path.join(FONTS_FOLDER, localFileName);
|
|
67
|
-
|
|
68
|
-
fs.mkdirSync(path.dirname(targetPath), { recursive: true });
|
|
69
|
-
|
|
70
|
-
const file = fs.createWriteStream(targetPath);
|
|
71
|
-
|
|
72
|
-
https.get(fontUrl, res => {
|
|
73
|
-
res.pipe(file);
|
|
74
|
-
file.on("finish", () => {
|
|
75
|
-
file.close();
|
|
76
|
-
console.log(`Downloaded: ${localFileName}`);
|
|
77
|
-
});
|
|
78
|
-
}).on("error", err => {
|
|
79
|
-
console.error(`Error downloading ${remoteFileName}: ${err.message}`);
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
function updateFont(url, filePath, remoteId, localId) {
|
|
85
|
-
updateCssFile(url, filePath, remoteId, localId);
|
|
86
|
-
downloadWebFont(remoteId, localId);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
updateStyles();
|
|
90
|
-
updateBrands();
|