mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
replace chalk with picocolors
This commit is contained in:
58
apps/cli/src/utils/render-title.ts
Normal file
58
apps/cli/src/utils/render-title.ts
Normal file
@@ -0,0 +1,58 @@
|
||||
import gradient from "gradient-string";
|
||||
|
||||
export const TITLE_TEXT = `
|
||||
╔════════════════════════════════════════════════════════════╗
|
||||
║ ║
|
||||
║ ██████╗ ███████╗████████╗████████╗███████╗██████╗ ║
|
||||
║ ██╔══██╗██╔════╝╚══██╔══╝╚══██╔══╝██╔════╝██╔══██╗ ║
|
||||
║ ██████╔╝█████╗ ██║ ██║ █████╗ ██████╔╝ ║
|
||||
║ ██╔══██╗██╔══╝ ██║ ██║ ██╔══╝ ██╔══██╗ ║
|
||||
║ ██████╔╝███████╗ ██║ ██║ ███████╗██║ ██║ ║
|
||||
║ ╚═════╝ ╚══════╝ ╚═╝ ╚═╝ ╚══════╝╚═╝ ╚═╝ ║
|
||||
║ ║
|
||||
║ ████████╗ ███████╗████████╗ █████╗ ██████╗██╗ ██╗ ║
|
||||
║ ╚══██╔══╝ ██╔════╝╚══██╔══╝██╔══██╗██╔════╝██║ ██╔╝ ║
|
||||
║ ██║ ███████╗ ██║ ███████║██║ █████╔╝ ║
|
||||
║ ██║ ╚════██║ ██║ ██╔══██║██║ ██╔═██╗ ║
|
||||
║ ██║ ███████║ ██║ ██║ ██║╚██████╗██║ ██╗ ║
|
||||
║ ╚═╝ ╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ║
|
||||
║ ║
|
||||
║ The Modern Full-Stack Framework ║
|
||||
║ ║
|
||||
╚════════════════════════════════════════════════════════════╝
|
||||
`;
|
||||
|
||||
const catppuccinTheme = {
|
||||
rosewater: "#F5E0DC",
|
||||
flamingo: "#F2CDCD",
|
||||
pink: "#F5C2E7",
|
||||
mauve: "#CBA6F7",
|
||||
red: "#F38BA8",
|
||||
maroon: "#E78284",
|
||||
peach: "#FAB387",
|
||||
yellow: "#F9E2AF",
|
||||
green: "#A6E3A1",
|
||||
teal: "#94E2D5",
|
||||
sky: "#89DCEB",
|
||||
sapphire: "#74C7EC",
|
||||
lavender: "#B4BEFE",
|
||||
};
|
||||
|
||||
export const renderTitle = () => {
|
||||
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