mirror of
https://github.com/ful1e5/Bibata_Cursor.git
synced 2025-05-24 20:14:29 -04:00
⚡ Bibata-Original bitmaps
This commit is contained in:
parent
e86dec5163
commit
89eba25a9d
4 changed files with 79 additions and 8 deletions
|
@ -67,7 +67,6 @@ class BitmapsGenerator {
|
|||
|
||||
const out = path.resolve(this.bitmapsDir, `${key}.png`);
|
||||
|
||||
console.log("Saving", key, "...");
|
||||
await svg.screenshot({ omitBackground: true, path: out });
|
||||
await page.close();
|
||||
}
|
||||
|
@ -149,7 +148,6 @@ class BitmapsGenerator {
|
|||
const number = frameNumber(index, options.framePadding);
|
||||
const frame = `${key}-${number}.png`;
|
||||
|
||||
console.log("Saving", frame, "...");
|
||||
this.saveFrameImage(frame, img);
|
||||
|
||||
prevImg = img;
|
||||
|
|
|
@ -8,7 +8,7 @@ const svgDir = path.resolve(root, "svg", "modern");
|
|||
|
||||
const main = async () => {
|
||||
for (const { themeName, color } of config) {
|
||||
console.log("Preparing bitmaps of", themeName, "...");
|
||||
console.log("=>", themeName);
|
||||
|
||||
const bitmapsDir = path.resolve(root, "bitmaps", themeName);
|
||||
const svg = new SVGHandler.SvgDirectoryParser(svgDir);
|
||||
|
@ -17,11 +17,15 @@ const main = async () => {
|
|||
const browser = await png.getBrowser();
|
||||
|
||||
for (let { key, content } of svg.getStatic()) {
|
||||
console.log(" -> Saving", key, "...");
|
||||
|
||||
content = SVGHandler.colorSvg(content, color);
|
||||
await png.generateStatic(browser, content, key);
|
||||
}
|
||||
|
||||
for (let { key, content } of svg.getAnimated()) {
|
||||
console.log(" -> Saving", key, "...");
|
||||
|
||||
content = SVGHandler.colorSvg(content, color);
|
||||
await png.generateAnimated(browser, content, key);
|
||||
}
|
||||
|
|
40
bitmapper/packages/original/src/config.ts
Normal file
40
bitmapper/packages/original/src/config.ts
Normal file
|
@ -0,0 +1,40 @@
|
|||
import { Colors } from "bibata-core/src/types";
|
||||
|
||||
interface Config {
|
||||
themeName: string;
|
||||
color: Colors;
|
||||
}
|
||||
|
||||
const black = "#000000";
|
||||
const white = "#FFFFFF";
|
||||
const amber = "#FF8300";
|
||||
const richBlack = "#001524";
|
||||
|
||||
const config: Config[] = [
|
||||
{
|
||||
themeName: "Bibata-Original-Amber",
|
||||
color: {
|
||||
base: amber,
|
||||
outline: white,
|
||||
watch: {
|
||||
background: richBlack,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
themeName: "Bibata-Original-Classic",
|
||||
color: {
|
||||
base: black,
|
||||
outline: white,
|
||||
},
|
||||
},
|
||||
{
|
||||
themeName: "Bibata-Original-Ice",
|
||||
color: {
|
||||
base: white,
|
||||
outline: black,
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
export { config };
|
|
@ -1,8 +1,37 @@
|
|||
import { main } from "bibata-core";
|
||||
import path from "path";
|
||||
|
||||
const hmm = async () => {
|
||||
main();
|
||||
console.log("Bibata Original");
|
||||
import { BitmapsGenerator, SVGHandler } from "bibata-core";
|
||||
import { config } from "./config";
|
||||
|
||||
const root = path.resolve(__dirname, "../../../../");
|
||||
const svgDir = path.resolve(root, "svg", "modern");
|
||||
|
||||
const main = async () => {
|
||||
for (const { themeName, color } of config) {
|
||||
console.log("=>", themeName);
|
||||
|
||||
const bitmapsDir = path.resolve(root, "bitmaps", themeName);
|
||||
const svg = new SVGHandler.SvgDirectoryParser(svgDir);
|
||||
|
||||
const png = new BitmapsGenerator(bitmapsDir);
|
||||
const browser = await png.getBrowser();
|
||||
|
||||
for (let { key, content } of svg.getStatic()) {
|
||||
console.log(" -> Saving", key, "...");
|
||||
|
||||
content = SVGHandler.colorSvg(content, color);
|
||||
await png.generateStatic(browser, content, key);
|
||||
}
|
||||
|
||||
for (let { key, content } of svg.getAnimated()) {
|
||||
console.log(" -> Saving", key, "...");
|
||||
|
||||
content = SVGHandler.colorSvg(content, color);
|
||||
await png.generateAnimated(browser, content, key);
|
||||
}
|
||||
|
||||
await browser.close();
|
||||
}
|
||||
};
|
||||
|
||||
hmm();
|
||||
main();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue