omegon 0.10.1 → 0.10.2
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.
|
@@ -23,8 +23,8 @@ import { SERMON } from "./sermon.js";
|
|
|
23
23
|
const CHAR_INTERVAL_MS = 67;
|
|
24
24
|
const WORD_PAUSE_MS = 120;
|
|
25
25
|
|
|
26
|
-
/**
|
|
27
|
-
const
|
|
26
|
+
/** Minimum visible characters (floor for very narrow terminals). */
|
|
27
|
+
const MIN_VISIBLE = 40;
|
|
28
28
|
|
|
29
29
|
// Glitch vocabulary — borrowed from the splash CRT noise aesthetic
|
|
30
30
|
const NOISE_CHARS = "▓▒░█▄▀▌▐▊▋▍▎▏◆■□▪◇┼╬╪╫";
|
|
@@ -40,15 +40,18 @@ const COMBINING_GLITCH = [
|
|
|
40
40
|
// Sermon palette — much dimmer than the spinner verb.
|
|
41
41
|
// The sermon is background thought, not actionable signal.
|
|
42
42
|
// Base text is near the noise floor; glitch accents stay subdued.
|
|
43
|
+
// IMPORTANT: glitch colors must return to SERMON_DIM, never RESET (which
|
|
44
|
+
// snaps to terminal default — often bright white, causing flash).
|
|
43
45
|
const SERMON_DIM = "\x1b[38;2;50;55;65m"; // #323741 — barely visible
|
|
44
|
-
const GLITCH_GLYPH = "\x1b[38;2;55;
|
|
45
|
-
const GLITCH_COLOR = "\x1b[38;2;
|
|
46
|
-
const
|
|
46
|
+
const GLITCH_GLYPH = "\x1b[38;2;55;70;80m"; // #374650 — noise glyphs, only slightly above base
|
|
47
|
+
const GLITCH_COLOR = "\x1b[38;2;45;80;90m"; // #2d505a — very muted teal, close to base
|
|
48
|
+
const RESET_TO_DIM = SERMON_DIM; // return to base after glitch, never full reset
|
|
49
|
+
const RESET = "\x1b[0m"; // only for end-of-line
|
|
47
50
|
|
|
48
|
-
// Glitch probabilities per character per render
|
|
49
|
-
const P_SUBSTITUTE = 0.
|
|
50
|
-
const P_COLOR = 0.
|
|
51
|
-
const P_COMBINING = 0.
|
|
51
|
+
// Glitch probabilities per character per render — kept subtle
|
|
52
|
+
const P_SUBSTITUTE = 0.02;
|
|
53
|
+
const P_COLOR = 0.035;
|
|
54
|
+
const P_COMBINING = 0.01;
|
|
52
55
|
|
|
53
56
|
function randomFrom<T>(arr: readonly T[] | string): T | string {
|
|
54
57
|
return arr[Math.floor(Math.random() * arr.length)];
|
|
@@ -60,14 +63,14 @@ function glitchChar(ch: string): string {
|
|
|
60
63
|
|
|
61
64
|
const r = Math.random();
|
|
62
65
|
|
|
63
|
-
// Substitution — replace with noise glyph, slightly
|
|
66
|
+
// Substitution — replace with noise glyph, only slightly above base
|
|
64
67
|
if (r < P_SUBSTITUTE) {
|
|
65
|
-
return GLITCH_GLYPH + randomFrom(NOISE_CHARS) +
|
|
68
|
+
return GLITCH_GLYPH + randomFrom(NOISE_CHARS) + RESET_TO_DIM;
|
|
66
69
|
}
|
|
67
70
|
|
|
68
|
-
// Color shimmer —
|
|
71
|
+
// Color shimmer — very muted teal, not a flash
|
|
69
72
|
if (r < P_SUBSTITUTE + P_COLOR) {
|
|
70
|
-
return GLITCH_COLOR + ch +
|
|
73
|
+
return GLITCH_COLOR + ch + RESET_TO_DIM;
|
|
71
74
|
}
|
|
72
75
|
|
|
73
76
|
// Combining diacritics — corruption overlay at base dim
|
|
@@ -93,9 +96,9 @@ export function createSermonWidget(
|
|
|
93
96
|
cursor = (cursor + 1) % SERMON.length;
|
|
94
97
|
revealed += ch;
|
|
95
98
|
|
|
96
|
-
// Sliding window — keep
|
|
97
|
-
if (revealed.length >
|
|
98
|
-
revealed = revealed.slice(revealed.length -
|
|
99
|
+
// Sliding window — keep a generous buffer; render() trims to actual width
|
|
100
|
+
if (revealed.length > 300) {
|
|
101
|
+
revealed = revealed.slice(revealed.length - 300);
|
|
99
102
|
}
|
|
100
103
|
|
|
101
104
|
tui.requestRender();
|
|
@@ -111,7 +114,8 @@ export function createSermonWidget(
|
|
|
111
114
|
|
|
112
115
|
return {
|
|
113
116
|
render(width: number): string[] {
|
|
114
|
-
|
|
117
|
+
// Use full terminal width minus a small indent (2 chars)
|
|
118
|
+
const maxW = Math.max(MIN_VISIBLE, width - 4);
|
|
115
119
|
const visible = revealed.length > maxW
|
|
116
120
|
? revealed.slice(revealed.length - maxW)
|
|
117
121
|
: revealed;
|