mirror of
https://github.com/ful1e5/Bibata_Cursor.git
synced 2025-05-24 12:07:02 -04:00
💅 Code refactor
This commit is contained in:
parent
027b2be19b
commit
6c44d15642
3 changed files with 26 additions and 25 deletions
|
@ -1,5 +1,4 @@
|
|||
import path from "path";
|
||||
import fs from "fs";
|
||||
|
||||
import { BitmapsGenerator, SVGHandler } from "bibata-core";
|
||||
import { Colors } from "bibata-core/src/types";
|
||||
|
@ -24,21 +23,13 @@ const main = async () => {
|
|||
const png = new BitmapsGenerator(bitmapsDir);
|
||||
const browser = await png.getBrowser();
|
||||
|
||||
for (const svg of SVG.getStatic()) {
|
||||
const key = `${path.basename(svg, ".svg")}.png`;
|
||||
|
||||
let content = fs.readFileSync(svg, "utf-8");
|
||||
for (let { key, content } of SVG.getStatic()) {
|
||||
content = SVGHandler.colorSvg(content, color);
|
||||
|
||||
await png.generateStatic(browser, content, key);
|
||||
}
|
||||
|
||||
for (const svg of SVG.getAnimated()) {
|
||||
const key = `${path.basename(svg, ".svg")}.png`;
|
||||
|
||||
let content = fs.readFileSync(svg, "utf-8");
|
||||
for (let { key, content } of SVG.getAnimated()) {
|
||||
content = SVGHandler.colorSvg(content, color);
|
||||
|
||||
await png.generateAnimated(browser, content, key);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue