antigravity-rtl 1.0.6 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +67 -1
- package/package.json +13 -3
package/index.js
CHANGED
|
@@ -7,6 +7,7 @@ import picocolors from 'picocolors';
|
|
|
7
7
|
import ora from 'ora';
|
|
8
8
|
import prompts from 'prompts';
|
|
9
9
|
import * as asar from '@electron/asar';
|
|
10
|
+
import figlet from 'figlet';
|
|
10
11
|
|
|
11
12
|
const __filename = fileURLToPath(import.meta.url);
|
|
12
13
|
const __dirname = path.dirname(__filename);
|
|
@@ -14,7 +15,72 @@ const { blue, cyan, green, red, yellow, bold } = picocolors;
|
|
|
14
15
|
|
|
15
16
|
const pkgPath = path.join(__dirname, 'package.json');
|
|
16
17
|
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
|
|
17
|
-
|
|
18
|
+
|
|
19
|
+
function printBanner() {
|
|
20
|
+
try {
|
|
21
|
+
const fullArt = figlet.textSync('Antigravity RTL', { font: 'RubiFont' }).split('\n');
|
|
22
|
+
|
|
23
|
+
// Hex colors for the multi-color gradient
|
|
24
|
+
const hexColors = [
|
|
25
|
+
'#3387FF',
|
|
26
|
+
'#F25041',
|
|
27
|
+
'#DFAC2A',
|
|
28
|
+
'#91C45B'
|
|
29
|
+
];
|
|
30
|
+
|
|
31
|
+
// Parse hex to RGB
|
|
32
|
+
const colors = hexColors.map(hex => {
|
|
33
|
+
const bigint = parseInt(hex.replace('#', ''), 16);
|
|
34
|
+
return {
|
|
35
|
+
r: (bigint >> 16) & 255,
|
|
36
|
+
g: (bigint >> 8) & 255,
|
|
37
|
+
b: bigint & 255
|
|
38
|
+
};
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
const applyGradient = (text) => {
|
|
42
|
+
let result = '';
|
|
43
|
+
const len = text.length;
|
|
44
|
+
for (let i = 0; i < len; i++) {
|
|
45
|
+
const char = text[i];
|
|
46
|
+
if (char === ' ' || char === '\n') {
|
|
47
|
+
result += char;
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
const factor = len > 1 ? i / (len - 1) : 0;
|
|
51
|
+
|
|
52
|
+
// Find current segment in the multi-color transition
|
|
53
|
+
const segments = colors.length - 1;
|
|
54
|
+
const segmentFloat = factor * segments;
|
|
55
|
+
const segmentIdx = Math.min(Math.floor(segmentFloat), segments - 1);
|
|
56
|
+
const segmentFactor = segmentFloat - segmentIdx;
|
|
57
|
+
|
|
58
|
+
const cStart = colors[segmentIdx];
|
|
59
|
+
const cEnd = colors[segmentIdx + 1];
|
|
60
|
+
|
|
61
|
+
const r = Math.round(cStart.r + segmentFactor * (cEnd.r - cStart.r));
|
|
62
|
+
const g = Math.round(cStart.g + segmentFactor * (cEnd.g - cStart.g));
|
|
63
|
+
const b = Math.round(cStart.b + segmentFactor * (cEnd.b - cStart.b));
|
|
64
|
+
|
|
65
|
+
result += `\x1b[38;2;${r};${g};${b}m${char}\x1b[0m`;
|
|
66
|
+
}
|
|
67
|
+
return result;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
console.log('');
|
|
71
|
+
for (const line of fullArt) {
|
|
72
|
+
if (!line.trim()) continue;
|
|
73
|
+
console.log(applyGradient(line));
|
|
74
|
+
}
|
|
75
|
+
console.log('');
|
|
76
|
+
console.log(`\x1b[2m RTL & UI Patcher for Antigravity | v${pkg.version}\x1b[0m\n`);
|
|
77
|
+
} catch (err) {
|
|
78
|
+
// Fallback banner in case figlet has issues loading
|
|
79
|
+
console.log(bold(cyan(`\n✨ Antigravity Smart RTL Patcher v${pkg.version}\n`)));
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
printBanner();
|
|
18
84
|
|
|
19
85
|
function getDefaultPath() {
|
|
20
86
|
if (os.platform() === 'darwin') {
|
package/package.json
CHANGED
|
@@ -1,20 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "antigravity-rtl",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "A smart RTL (Right-to-Left) patcher with UI settings for the Antigravity application.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
8
|
},
|
|
9
|
-
"keywords": [
|
|
9
|
+
"keywords": [
|
|
10
|
+
"antigravity",
|
|
11
|
+
"rtl",
|
|
12
|
+
"persian",
|
|
13
|
+
"arabic",
|
|
14
|
+
"hebrew",
|
|
15
|
+
"patcher",
|
|
16
|
+
"electron",
|
|
17
|
+
"asar"
|
|
18
|
+
],
|
|
10
19
|
"author": "mmnaderi",
|
|
11
20
|
"license": "MIT",
|
|
12
21
|
"dependencies": {
|
|
13
22
|
"@electron/asar": "^4.2.0",
|
|
23
|
+
"figlet": "^1.11.0",
|
|
14
24
|
"ora": "^9.4.1",
|
|
15
25
|
"picocolors": "^1.1.1",
|
|
16
26
|
"prompts": "^2.4.2"
|
|
17
27
|
},
|
|
18
28
|
"type": "module",
|
|
19
29
|
"bin": "index.js"
|
|
20
|
-
}
|
|
30
|
+
}
|