dragadix
Version:
A flirty, powerful CLI experience built by Aditya π
59 lines (52 loc) β’ 1.63 kB
JavaScript
import inquirer from "inquirer";
import chalk from "chalk";
import figlet from "figlet";
import { config } from "../config.js";
export async function startFunZone() {
const answer = await inquirer.prompt([
{
type: "list",
name: "fun",
message: chalk.cyan("Wanna play with me, babe? π"),
choices: [
"π Random Flirty Line",
"π Dev Joke",
"πΌοΈ ASCII Art",
"β©οΈ Return to Main Menu"
],
}
]);
switch (answer.fun) {
case "π Random Flirty Line":
showFlirtyLine();
break;
case "π Dev Joke":
showDevJoke();
break;
case "πΌοΈ ASCII Art":
showASCIIArt();
break;
default:
return;
}
await inquirer.prompt([{ type: "input", name: "return", message: chalk.gray("β©οΈ Press Enter to go back") }]);
await startFunZone();
}
function showFlirtyLine() {
const lines = config?.fun?.flirtyLines || ["You're cute even when your code crashes π"];
const pick = lines[Math.floor(Math.random() * lines.length)];
console.log(chalk.yellowBright(`\nπ ${pick}\n`));
}
function showDevJoke() {
const jokes = [
"Why do programmers prefer dark mode? Because light attracts bugs. π",
"I told my code I loved itβ¦ it dumped core. π",
"Why did the async function break up with await? It was tired of waiting π’"
];
const joke = jokes[Math.floor(Math.random() * jokes.length)];
console.log(chalk.blue(`\nπ ${joke}\n`));
}
function showASCIIArt() {
const art = figlet.textSync("DragAdi", { font: "Ghost" });
console.log(chalk.magenta(art));
}