mirror of
https://github.com/ful1e5/Bibata_Cursor.git
synced 2025-05-20 02:05:12 -04:00
✨ Remove individual cursor customization
This commit is contained in:
parent
afc78a2873
commit
efe1992d7c
3 changed files with 7 additions and 31 deletions
|
@ -2,7 +2,7 @@ import path from "path";
|
|||
|
||||
import { ColorSchema } from "./types";
|
||||
|
||||
// --------------------------------------- Paths
|
||||
// --------------------------------------- Paths 🔗
|
||||
|
||||
const rawSvgsDir = path.resolve("src", "svg", "raw");
|
||||
const schemesPath = path.resolve("src", "svg");
|
||||
|
@ -23,15 +23,6 @@ const watchColors = {
|
|||
color4: blue // top-left shape color
|
||||
};
|
||||
|
||||
// --------------------------------------- Custimized Corner Colors (Bibata Style) 🚀
|
||||
|
||||
const customize = {
|
||||
"top_right_corner.svg": { base: red },
|
||||
"bottom_right_corner.svg": { base: yellow },
|
||||
"bottom_left_corner.svg": { base: green },
|
||||
"top_left_corner.svg": { base: blue }
|
||||
};
|
||||
|
||||
// --------------------------------------- Schemes🌈
|
||||
const colorSchemes: ColorSchema = {
|
||||
Ice: {
|
||||
|
@ -40,8 +31,7 @@ const colorSchemes: ColorSchema = {
|
|||
watch: {
|
||||
background: white,
|
||||
...watchColors
|
||||
},
|
||||
customize
|
||||
}
|
||||
},
|
||||
Classic: {
|
||||
base: black,
|
||||
|
@ -49,8 +39,7 @@ const colorSchemes: ColorSchema = {
|
|||
watch: {
|
||||
background: black,
|
||||
...watchColors
|
||||
},
|
||||
customize
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -5,6 +5,8 @@ import { staticCursors, animatedCursors, animatedClip } from "../cursors.json";
|
|||
import { schemesPath } from "../color";
|
||||
import { ColorSchema, Configs } from "../types";
|
||||
|
||||
// --------------------------------------- Generate Configs 🛠
|
||||
|
||||
const generateConfigs = (
|
||||
colorSchemes: ColorSchema,
|
||||
dirPrefix: string,
|
||||
|
@ -18,7 +20,7 @@ const generateConfigs = (
|
|||
const configs: Configs = {};
|
||||
|
||||
for (let [schema] of Object.entries(colorSchemes)) {
|
||||
const { base, outline, watch, customize } = colorSchemes[schema];
|
||||
const { base, outline, watch } = colorSchemes[schema];
|
||||
const schemaName = `${dirPrefix}-${schema}`;
|
||||
|
||||
const schemaSvgsPath = path.resolve(schemesPath, schemaName);
|
||||
|
@ -30,16 +32,7 @@ const generateConfigs = (
|
|||
.readFileSync(path.resolve(rawSvgsDir, cursor), "utf-8")
|
||||
.toString();
|
||||
|
||||
// try => replace `customize` colors
|
||||
// onError => replace `schema` main colors
|
||||
try {
|
||||
let { base: b, outline: o } = customize![cursor];
|
||||
if (!b) b = base;
|
||||
if (!o) o = outline;
|
||||
content = content.replace("#00FF00", b).replace("#0000FF", o);
|
||||
} catch (error) {
|
||||
content = content.replace("#00FF00", base).replace("#0000FF", outline);
|
||||
}
|
||||
|
||||
// Save Schema
|
||||
const cursorPath = path.resolve(schemaSvgsPath, cursor);
|
||||
|
|
|
@ -9,12 +9,6 @@ interface ColorSchema {
|
|||
color3: string;
|
||||
color4: string;
|
||||
};
|
||||
customize?: {
|
||||
[name: string]: {
|
||||
outline?: string;
|
||||
base?: string;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue