incremnt 0.1.12 → 0.1.13
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 +1 -1
- package/src/lib.js +1 -1
- package/src/logo.js +6 -3
package/package.json
CHANGED
package/src/lib.js
CHANGED
|
@@ -71,7 +71,7 @@ export async function runCli(argv, stdout, stderr) {
|
|
|
71
71
|
const isAuthenticated = Boolean(sessionState?.session && !isSessionExpired(sessionState.session));
|
|
72
72
|
|
|
73
73
|
if (!command || options.help) {
|
|
74
|
-
printLogo(stdout);
|
|
74
|
+
await printLogo(stdout);
|
|
75
75
|
stdout.write(`${formatHelp({ isAuthenticated })}\n`);
|
|
76
76
|
return 0;
|
|
77
77
|
}
|
package/src/logo.js
CHANGED
|
@@ -28,7 +28,9 @@ const SHADOW_OFFSET_Y = 1;
|
|
|
28
28
|
const totalLines = 5 + SHADOW_OFFSET_Y;
|
|
29
29
|
const lineLength = rawLines[0].length + SHADOW_OFFSET_X;
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
32
|
+
|
|
33
|
+
export async function printLogo(stdout = process.stdout) {
|
|
32
34
|
// Gradient starts at the 'M' character position
|
|
33
35
|
// I: 0, N: 3, C: 14, R: 21, E: 29, M: 37
|
|
34
36
|
const gradientStartIdx = 37;
|
|
@@ -55,12 +57,12 @@ export function printLogo(stdout = process.stdout) {
|
|
|
55
57
|
lineStr += chalk.rgb(col.r, col.g, col.b)('█');
|
|
56
58
|
}
|
|
57
59
|
} else if (hasBg) {
|
|
60
|
+
const shadowFactor = 0.35;
|
|
58
61
|
if (bgX < gradientStartIdx) {
|
|
59
|
-
lineStr += chalk.rgb(
|
|
62
|
+
lineStr += chalk.rgb(Math.round(255 * shadowFactor), Math.round(255 * shadowFactor), Math.round(255 * shadowFactor))('█');
|
|
60
63
|
} else {
|
|
61
64
|
const factor = Math.max(0, Math.min(1, (bgX - gradientStartIdx) / (rawLines[0].length - gradientStartIdx - 2)));
|
|
62
65
|
const col = interpolateColor(startColor, endColor, factor);
|
|
63
|
-
const shadowFactor = 0.35;
|
|
64
66
|
lineStr += chalk.rgb(Math.round(col.r * shadowFactor), Math.round(col.g * shadowFactor), Math.round(col.b * shadowFactor))('█');
|
|
65
67
|
}
|
|
66
68
|
} else {
|
|
@@ -68,6 +70,7 @@ export function printLogo(stdout = process.stdout) {
|
|
|
68
70
|
}
|
|
69
71
|
}
|
|
70
72
|
stdout.write(lineStr + '\n');
|
|
73
|
+
await sleep(80);
|
|
71
74
|
}
|
|
72
75
|
stdout.write('\n');
|
|
73
76
|
}
|