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() {
|
async function main() {
|
||||||
const s = spinner();
|
const s = spinner();
|
||||||
try {
|
try {
|
||||||
console.clear();
|
process.stdout.write("\x1Bc");
|
||||||
renderTitle();
|
renderTitle();
|
||||||
intro(chalk.bold("Creating a new Better-T Stack project"));
|
intro(chalk.bold("Creating a new Better-T Stack project"));
|
||||||
program
|
program
|
||||||
|
|||||||
@@ -18,6 +18,20 @@ const catppuccinTheme = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const renderTitle = () => {
|
export const renderTitle = () => {
|
||||||
const catppuccinGradient = gradient(Object.values(catppuccinTheme));
|
const terminalWidth = process.stdout.columns || 80;
|
||||||
console.log(catppuccinGradient.multiline(TITLE_TEXT));
|
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