mirror of
https://github.com/ful1e5/Bibata_Cursor.git
synced 2025-05-19 17:55:11 -04:00
✨ Remove individual cursor customization
This commit is contained in:
parent
afc78a2873
commit
efe1992d7c
3 changed files with 7 additions and 31 deletions
|
@ -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);
|
||||
}
|
||||
content = content.replace("#00FF00", base).replace("#0000FF", outline);
|
||||
|
||||
// Save Schema
|
||||
const cursorPath = path.resolve(schemaSvgsPath, cursor);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue