blyuecode 0.1.2 → 0.1.3
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/dist/ui/Banner.js +30 -11
- package/package.json +1 -1
package/dist/ui/Banner.js
CHANGED
|
@@ -16,6 +16,9 @@ function getVersion() {
|
|
|
16
16
|
return '0.0.0';
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
+
// ─────────────────────────────────────────────
|
|
20
|
+
// BLYUE — 44 cols wide
|
|
21
|
+
// ─────────────────────────────────────────────
|
|
19
22
|
const BLYUE_BIG = [
|
|
20
23
|
'██████╗ ██╗ ██╗ ██╗ ██╗ ██╗ ███████╗',
|
|
21
24
|
'██╔══██╗██║ ╚██╗ ██╔╝ ██║ ██║ ██╔════╝',
|
|
@@ -30,29 +33,45 @@ const BLYUE_SMALL = [
|
|
|
30
33
|
'| _ \\| |__| |_| | |_| | _| ',
|
|
31
34
|
'|___/|____|\\___/ \\___/|___|',
|
|
32
35
|
];
|
|
36
|
+
// ─────────────────────────────────────────────
|
|
37
|
+
// CODE — 33 cols wide, centered with 5-space lead
|
|
38
|
+
// ─────────────────────────────────────────────
|
|
33
39
|
const CODE_BIG = [
|
|
34
|
-
'
|
|
35
|
-
'██╔════╝██╔═══██╗██╔══██╗██╔════╝',
|
|
36
|
-
'██║ ██║ ██║██║ ██║█████╗ ',
|
|
37
|
-
'██║ ██║ ██║██║ ██║██╔══╝ ',
|
|
38
|
-
'╚██████╗╚██████╔╝██████╔╝███████╗',
|
|
39
|
-
'
|
|
40
|
+
' ██████╗ ██████╗ ██████╗ ███████╗',
|
|
41
|
+
' ██╔════╝██╔═══██╗██╔══██╗██╔════╝',
|
|
42
|
+
' ██║ ██║ ██║██║ ██║█████╗ ',
|
|
43
|
+
' ██║ ██║ ██║██║ ██║██╔══╝ ',
|
|
44
|
+
' ╚██████╗╚██████╔╝██████╔╝███████╗',
|
|
45
|
+
' ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝',
|
|
40
46
|
];
|
|
41
47
|
const CODE_SMALL = [
|
|
42
|
-
'█▀▀ █▀█ █▀▄ █▀▀',
|
|
43
|
-
'█▄▄ █▄█ █▄▀ ██▄',
|
|
48
|
+
' █▀▀ █▀█ █▀▄ █▀▀',
|
|
49
|
+
' █▄▄ █▄█ █▄▀ ██▄',
|
|
44
50
|
];
|
|
45
|
-
export const Banner = () => {
|
|
51
|
+
export const Banner = ({ freezeAfter = 3000 }) => {
|
|
46
52
|
const { stdout } = useStdout();
|
|
47
53
|
const width = stdout?.columns ?? 80;
|
|
48
54
|
const wide = width >= 60;
|
|
49
55
|
const blyue = wide ? BLYUE_BIG : BLYUE_SMALL;
|
|
50
56
|
const code = wide ? CODE_BIG : CODE_SMALL;
|
|
51
57
|
const [t, setT] = useState(0);
|
|
58
|
+
const [frozen, setFrozen] = useState(freezeAfter <= 0);
|
|
59
|
+
// Animation tick — 100ms = 10fps, no flicker
|
|
52
60
|
useEffect(() => {
|
|
53
|
-
|
|
61
|
+
if (frozen)
|
|
62
|
+
return;
|
|
63
|
+
const interval = setInterval(() => {
|
|
64
|
+
setT((v) => (v + 1 / 320) % 1); // half-speed gradient
|
|
65
|
+
}, 100);
|
|
54
66
|
return () => clearInterval(interval);
|
|
55
|
-
}, []);
|
|
67
|
+
}, [frozen]);
|
|
68
|
+
// Freeze after N ms so it never redraws during typing
|
|
69
|
+
useEffect(() => {
|
|
70
|
+
if (freezeAfter <= 0)
|
|
71
|
+
return;
|
|
72
|
+
const timer = setTimeout(() => setFrozen(true), freezeAfter);
|
|
73
|
+
return () => clearTimeout(timer);
|
|
74
|
+
}, [freezeAfter]);
|
|
56
75
|
const brand = hueAt(t);
|
|
57
76
|
const version = getVersion();
|
|
58
77
|
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(MakerMark, { color: brand }), _jsx(Text, { children: " " }), blyue.map((line, i) => (_jsx(Text, { color: hueAt((t + i * 0.06) % 1), bold: true, children: line }, 'b' + i))), code.map((line, i) => (_jsx(Text, { color: hueAt((t + i * 0.06 + 0.35) % 1), bold: true, children: line }, 'c' + i))), _jsx(Text, { children: " " }), _jsx(Text, { color: "gray", children: 'a coding agent · v' + version }), _jsx(Text, { children: " " })] }));
|