codex-rtl 1.0.1 → 1.1.5

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.
Files changed (2) hide show
  1. package/bin/index.js +69 -1
  2. package/package.json +2 -1
package/bin/index.js CHANGED
@@ -8,6 +8,7 @@ import ora from 'ora';
8
8
  import prompts from 'prompts';
9
9
  import * as asar from '@electron/asar';
10
10
  import { execSync } from 'child_process';
11
+ import figlet from 'figlet';
11
12
 
12
13
  const __filename = fileURLToPath(import.meta.url);
13
14
  const __dirname = path.dirname(__filename);
@@ -15,7 +16,74 @@ const { blue, cyan, green, red, yellow, bold } = picocolors;
15
16
 
16
17
  const pkgPath = path.join(__dirname, '..', 'package.json');
17
18
  const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
18
- console.log(bold(cyan(`\n✨ Codex Smart RTL Patcher v${pkg.version}\n`)));
19
+
20
+ function printBanner() {
21
+ try {
22
+ const fullArt = figlet.textSync('Codex RTL', { font: 'RubiFont' }).split('\n');
23
+
24
+ // Hex colors for the multi-color gradient
25
+ const hexColors = [
26
+ '#3126FF',
27
+ '#5770FF',
28
+ '#6F94FF',
29
+ '#7081FF',
30
+ '#BBA3FF',
31
+ '#C1C3FF'
32
+ ];
33
+
34
+ // Parse hex to RGB
35
+ const colors = hexColors.map(hex => {
36
+ const bigint = parseInt(hex.replace('#', ''), 16);
37
+ return {
38
+ r: (bigint >> 16) & 255,
39
+ g: (bigint >> 8) & 255,
40
+ b: bigint & 255
41
+ };
42
+ });
43
+
44
+ const applyGradient = (text) => {
45
+ let result = '';
46
+ const len = text.length;
47
+ for (let i = 0; i < len; i++) {
48
+ const char = text[i];
49
+ if (char === ' ' || char === '\n') {
50
+ result += char;
51
+ continue;
52
+ }
53
+ const factor = len > 1 ? i / (len - 1) : 0;
54
+
55
+ // Find current segment in the multi-color transition
56
+ const segments = colors.length - 1;
57
+ const segmentFloat = factor * segments;
58
+ const segmentIdx = Math.min(Math.floor(segmentFloat), segments - 1);
59
+ const segmentFactor = segmentFloat - segmentIdx;
60
+
61
+ const cStart = colors[segmentIdx];
62
+ const cEnd = colors[segmentIdx + 1];
63
+
64
+ const r = Math.round(cStart.r + segmentFactor * (cEnd.r - cStart.r));
65
+ const g = Math.round(cStart.g + segmentFactor * (cEnd.g - cStart.g));
66
+ const b = Math.round(cStart.b + segmentFactor * (cEnd.b - cStart.b));
67
+
68
+ result += `\x1b[38;2;${r};${g};${b}m${char}\x1b[0m`;
69
+ }
70
+ return result;
71
+ };
72
+
73
+ console.log('');
74
+ for (const line of fullArt) {
75
+ if (!line.trim()) continue;
76
+ console.log(applyGradient(line));
77
+ }
78
+ console.log('');
79
+ console.log(`\x1b[2m RTL & UI Patcher for Codex | ${pkg.version}\x1b[0m\n`);
80
+ } catch (err) {
81
+ // Fallback banner in case figlet has issues loading
82
+ console.log(bold(cyan(`\n✨ Codex Smart RTL Patcher v${pkg.version}\n`)));
83
+ }
84
+ }
85
+
86
+ printBanner();
19
87
 
20
88
  function handleMacPermissionError(err) {
21
89
  if (os.platform() === 'darwin') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codex-rtl",
3
- "version": "1.0.1",
3
+ "version": "1.1.5",
4
4
  "description": "A smart RTL (Right-to-Left) patcher with UI settings for the Codex application.",
5
5
  "main": "./bin/index.js",
6
6
  "bin": {
@@ -35,6 +35,7 @@
35
35
  "homepage": "https://github.com/mmnaderi/codex-rtl#readme",
36
36
  "dependencies": {
37
37
  "@electron/asar": "^4.2.0",
38
+ "figlet": "^1.11.0",
38
39
  "ora": "^9.4.1",
39
40
  "picocolors": "^1.1.1",
40
41
  "prompts": "^2.4.2"