UNPKG

dragadix

Version:

A flirty, powerful CLI experience built by Aditya πŸ’‹

59 lines (52 loc) β€’ 1.63 kB
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)); }