fidelizare-integrate 0.1.0 → 0.2.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fidelizare-integrate",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Asistent de integrare Fidelizare pentru softuri de gestiune si case de marcat. Scaneaza codul, gaseste locul potrivit si propune integrarea API-ului, in siguranta.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/ui/anim.js CHANGED
@@ -1,41 +1,63 @@
1
1
  // Hand-built ASCII animations. No animation libraries: every frame is drawn
2
2
  // with raw ANSI cursor control. Honors --no-anim / non-TTY by degrading to
3
3
  // plain static lines.
4
+ import { readFileSync } from 'fs';
5
+ import { fileURLToPath } from 'url';
4
6
  import { ansi, C, paint, bold, out, isTTY, sleep } from './ansi.js';
5
7
 
6
8
  let ANIM = isTTY && !process.argv.includes('--no-anim');
7
9
  export const setAnim = (v) => { ANIM = v && isTTY; };
8
10
 
9
- // --- The Fix pin logo in ASCII, drawn line by line with a red sweep. ---
10
- const LOGO = [
11
- ' ▄▄███████▄▄ ',
12
- ' ▄██▀▀ ▀▀██▄ ',
13
- ' ██▀ ▟█▙ ▀██ ',
14
- ' ██ ▟█ █▙ ██ ',
15
- ' ██ ▟█ █▙ ██ ',
16
- ' ██▖ ▜█████▛ ▗██ ',
17
- ' ▀██▄▖ ▗▄██▀ ',
18
- ' ▀▀██▄▄▄██▀▀ ',
19
- ' ▀█▀ ',
20
- ' ▀ ',
21
- ];
11
+ const cols = () => process.stdout.columns || 80;
12
+ const visLen = (s) => s.replace(/\x1b\[[0-9;?]*[A-Za-z]/g, '').length;
13
+ const center = (s, w = visLen(s)) => ' '.repeat(Math.max(0, Math.floor((cols() - w) / 2))) + s;
14
+
15
+ let LOGO_LINES = null;
16
+ function loadLogo() {
17
+ if (LOGO_LINES) return LOGO_LINES;
18
+ try {
19
+ LOGO_LINES = readFileSync(fileURLToPath(new URL('./logo.ans', import.meta.url)), 'utf8').replace(/\n+$/, '').split('\n');
20
+ } catch { LOGO_LINES = []; }
21
+ return LOGO_LINES;
22
+ }
23
+
24
+ function topBar() {
25
+ const w = cols();
26
+ const left = ' Fidelizare Integrate';
27
+ const right = 'v0.1.0 · fidelizare.ro ';
28
+ const gap = Math.max(1, w - left.length - right.length);
29
+ out(C.onRed + ansi.bold + left + ' '.repeat(gap) + right + ansi.reset + '\n');
30
+ }
22
31
 
32
+ // Polished startup screen: a top bar, the real logo (rendered from the actual
33
+ // brand image into ANSI), a title, and a short description of what the tool
34
+ // does, then an animated status line. Inspired by the PostHog wizard layout.
23
35
  export async function logoIntro() {
24
36
  if (!ANIM) {
25
37
  out(paint(' Fidelizare', C.red) + paint(' · asistent de integrare\n\n', C.ink));
26
38
  return;
27
39
  }
28
- out(ansi.hideCursor);
40
+ out('\x1b[2J\x1b[H' + ansi.hideCursor); // clear screen, home
41
+ topBar();
29
42
  out('\n');
30
- for (const line of LOGO) {
31
- // colour the filled blocks red, leave spacing dim
32
- out(' ' + paint(line, C.red) + '\n');
33
- await sleep(34);
43
+
44
+ const logo = loadLogo();
45
+ for (const line of logo) {
46
+ out(center(line, 26) + '\n');
47
+ await sleep(26);
34
48
  }
35
- // wordmark types in
36
- out('\n ');
37
- await typewrite('FIDELIZARE', 30, C.red, true);
38
- out(paint(' · asistent de integrare\n\n', C.ink));
49
+ out('\n');
50
+
51
+ const title = ansi.bold + C.red + 'FIDELIZARE' + ansi.reset + paint(' · asistent de integrare', C.ink);
52
+ out(center(title, 'FIDELIZARE · asistent de integrare'.length) + '\n\n');
53
+ await sleep(120);
54
+
55
+ const d1 = 'Iti analizam codul si integram API-ul de fidelizare, in cativa pasi.';
56
+ const d2 = 'Cheile si .env raman pe calculatorul tau, nu pleaca nicaieri.';
57
+ out(center(paint(d1, C.white), d1.length) + '\n');
58
+ await sleep(80);
59
+ out(center(paint(d2, C.dim), d2.length) + '\n\n');
60
+ await sleep(120);
39
61
  out(ansi.showCursor);
40
62
  }
41
63
 
@@ -0,0 +1,13 @@
1
+    ▁▂▂▁  
2
+   ▂▅▆ ▅▅▇▏▇▎▗▃  
3
+  ▗▁▁▁▁▁▁▁▁▁▁▏▍╴▇▖ 
4
+   ▃▄▄▄▖ ▃▄▄▄▄▄ ▍▆▄▆▖  
5
+  ▋┊▆▂▅▃▚▅▁▊▌▇▏▎▍ ▌╴▖ 
6
+  ▌▂▅▃▆▝▅╸▄╸▁▇▉▎▍▌ ▋▊▌ 
7
+  ▇▃▘▇ ┊▝▅▄▘━╸▄ ▌ ▆ ╴▘ 
8
+  ▖╵┕▏▗▃ ▊▝▄▇▄▆▄▆▃╴▘  
9
+  ▝╴╵▁▁╵▄▇▄ ▇ ▌▇▖▇ 
10
+   ▃╵▄ ▄   ╴▃▇ 
11
+   ╺▁▁▂▄ ▁▃▘ 
12
+  ▇▄▁ ▄▇ 
13
+   ▇▇