mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
add small title for shorter window
This commit is contained in:
5
.changeset/four-tomatoes-rescue.md
Normal file
5
.changeset/four-tomatoes-rescue.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"create-better-t-stack": patch
|
||||
---
|
||||
|
||||
add small title for shorter window
|
||||
@@ -189,7 +189,7 @@ async function gatherConfig(
|
||||
async function main() {
|
||||
const s = spinner();
|
||||
try {
|
||||
console.clear();
|
||||
process.stdout.write("\x1Bc");
|
||||
renderTitle();
|
||||
intro(chalk.bold("Creating a new Better-T Stack project"));
|
||||
program
|
||||
|
||||
@@ -18,6 +18,20 @@ const catppuccinTheme = {
|
||||
};
|
||||
|
||||
export const renderTitle = () => {
|
||||
const catppuccinGradient = gradient(Object.values(catppuccinTheme));
|
||||
console.log(catppuccinGradient.multiline(TITLE_TEXT));
|
||||
const terminalWidth = process.stdout.columns || 80;
|
||||
const titleLines = TITLE_TEXT.split("\n");
|
||||
const titleWidth = Math.max(...titleLines.map((line) => line.length));
|
||||
|
||||
if (terminalWidth < titleWidth) {
|
||||
const simplifiedTitle = `
|
||||
╔══════════════════╗
|
||||
║ Better T-Stack ║
|
||||
╚══════════════════╝
|
||||
`;
|
||||
console.log(
|
||||
gradient(Object.values(catppuccinTheme)).multiline(simplifiedTitle),
|
||||
);
|
||||
} else {
|
||||
console.log(gradient(Object.values(catppuccinTheme)).multiline(TITLE_TEXT));
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user