Skip to content

Commit

Permalink
2.7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
fisheva committed Dec 16, 2024
1 parent 0b0a26e commit 8527b6a
Show file tree
Hide file tree
Showing 27 changed files with 75,446 additions and 62,330 deletions.
Binary file added eva-theme-2.7.4.vsix
Binary file not shown.
22 changes: 13 additions & 9 deletions html/index copy.html
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,11 @@
tokenColors: [],
};

let scopes = {
console.log("light", light);
console.log("dark", dark);


let scope = {
"keyword.operator.new": {
"name": "",
"foreground": {
Expand Down Expand Up @@ -12847,16 +12851,16 @@
}
}
}
function scopes2token(type,file) {
function scope2token(type,file) {
let token = [];
file = type == 'light' ? file.replace('-Light', '') : file.replace('-Dark', '');
for (let i in scopes) {
for (let i in scope) {
let obj = {
name: scopes[i].name,
name: scope[i].name,
scope: i,
settings: {
foreground: scopes[i].foreground[type],
fontStyle: scopes[i].fontStyle[file] || '',
foreground: scope[i].foreground[type],
fontStyle: scope[i].fontStyle[file] || '',
},
};
token.push(obj);
Expand All @@ -12878,12 +12882,12 @@
for (let i in output) {
if (i.indexOf("Light") > -1) {
light.name = i.replace(/-/g, " ");
output[i] = { ...light, type: "light", tokenColors:scopes2token("light",i) };
output[i] = { ...light, type: "light", tokenColors:scope2token("light",i) };
} else {
dark.name = i.replace(/-/g, " ");
output[i] = { ...dark, type: "dark", tokenColors:scopes2token("dark",i) };
output[i] = { ...dark, type: "dark", tokenColors:scope2token("dark",i) };
}
}

console.log("output========",output);
</script>
</script>
13 changes: 5 additions & 8 deletions html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2239,7 +2239,6 @@
},
},
];
console.log("Eva_Light 11111: ", Eva_Light);

let all_theme = {
Eva_Light,
Expand All @@ -2250,12 +2249,10 @@
};

for (let i in all_theme) {
all_theme[i] = convert(all_theme[i], i);
all_theme[i] = disperse(all_theme[i], i);
}
console.log("all_theme.Eva_Light: ", all_theme.Eva_Light);

let json = {};
console.log("Eva_Light after: ", Eva_Light);

for (let i = 0; i < all_theme.Eva_Light.length; i++) {
let scope = all_theme.Eva_Light[i].scope;
Expand All @@ -2277,7 +2274,7 @@

console.log("json: ", json);

function convert(token, name) {
function disperse(token, name) {
let theme = [],
scope = [],
same = [];
Expand All @@ -2302,10 +2299,10 @@
}
}
}
console.log(name, theme);
// console.log(name, theme);
// console.log("scope", scope);
// console.log("same", same);
console.log("===============");
// console.log("===============");
return theme;
}
</script>
</script>
51 changes: 51 additions & 0 deletions index/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@

const fs = require("fs");
const {parse} = require("jsonc-parser");

let light_content = fs.readFileSync("../jsonc/lightUI.jsonc", "utf-8"),dark_content = fs.readFileSync("../jsonc/darkUI.jsonc", "utf-8"), syntax_content = fs.readFileSync("../jsonc/syntax.jsonc", "utf-8");

let light = parse(light_content), dark = parse(dark_content), syntax = parse(syntax_content);

console.log("light========",light);
// let light = require('../json/lightUI.json'), dark = require('../json/darkUI.json'), syntax = require('../json/syntax.json');

let output = {
"Eva-Light": {},
"Eva-Light-Italic": {},
"Eva-Light-Bold": {},
"Eva-Light-Italic-Bold": {},
"Eva-Dark": {},
"Eva-Dark-Italic": {},
"Eva-Dark-Bold": {},
"Eva-Dark-Italic-Bold": {},
};

for (let i in output) {
if (i.indexOf("Light") > -1) {
light.name = i.replace(/-/g, " ");
output[i] = { ...light, type: "light", tokenColors:scope2token("light",i) };
} else {
dark.name = i.replace(/-/g, " ");
output[i] = { ...dark, type: "dark", tokenColors:scope2token("dark",i) };
}
}

console.log("output========",output);


function scope2token(type,file) {
let token = [];
file = type == 'light' ? file.replace('-Light', '') : file.replace('-Dark', '');
for (let i in syntax) {
let obj = {
name: syntax[i].name,
scope: i,
settings: {
foreground: syntax[i].foreground[type],
fontStyle: syntax[i].fontStyle[file] || '',
},
};
token.push(obj);
}
return token;
}
74 changes: 74 additions & 0 deletions index/index2.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<script>
// const fs = require("fs");
// const {parse} = require("jsonc-parser");

// let light_content = fs.readFileSync("../jsonc/lightUI.jsonc", "utf-8"),dark_content = fs.readFileSync("../jsonc/darkUI.jsonc", "utf-8"), syntax_content = fs.readFileSync("../jsonc/syntax.jsonc", "utf-8");

// let light = parse(light_content), dark = parse(dark_content), syntax = parse(syntax_content);

// let light = require('../jsonc/lightUI.jsonc'), dark = require('../jsonc/darkUI.jsonc'), syntax = require('../json/syntax.json');

let light, dark, syntax;
fetch("../jsonc/lightUI.jsonc")
.then((response) => response.json())
.then((data) => {
console.log(data);
})
.catch((error) => console.error("Error:", error));
import light from "../jsonc/lightUI.jsonc";
import dark from "../jsonc/darkUI.jsonc";
import syntax from "../jsonc/syntax.jsonc";

console.log("light========", light);

let output = {
"Eva-Light": {},
"Eva-Light-Italic": {},
"Eva-Light-Bold": {},
"Eva-Light-Italic-Bold": {},
"Eva-Dark": {},
"Eva-Dark-Italic": {},
"Eva-Dark-Bold": {},
"Eva-Dark-Italic-Bold": {},
};

for (let i in output) {
if (i.indexOf("Light") > -1) {
light.name = i.replace(/-/g, " ");
output[i] = {
...light,
type: "light",
tokenColors: scope2token("light", i),
};
} else {
dark.name = i.replace(/-/g, " ");
output[i] = {
...dark,
type: "dark",
tokenColors: scope2token("dark", i),
};
}
}

console.log("output========", output);

function scope2token(type, file) {
let token = [];
file =
type == "light"
? file.replace("-Light", "")
: file.replace("-Dark", "");
for (let i in syntax) {
let obj = {
name: syntax[i].name,
scope: i,
settings: {
foreground: syntax[i].foreground[type],
fontStyle: syntax[i].fontStyle[file] || "",
},
};
token.push(obj);
}
return token;
}
</script>
21 changes: 21 additions & 0 deletions index/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions index/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "js",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"jsonc-parser": "^3.3.1"
}
}
Loading

0 comments on commit 8527b6a

Please sign in to comment.