@haxtheweb/create
Version:
CLI for all things HAX the web
70 lines (60 loc) โข 3.87 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.communityStatement = communityStatement;
exports.haxIntro = haxIntro;
exports.merlinSays = merlinSays;
var _art = require("./art.js");
var p = _interopRequireWildcard(require("@clack/prompts"));
var _picocolors = _interopRequireDefault(require("picocolors"));
var _promises = require("node:timers/promises");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
async function haxIntro() {
console.clear();
await (0, _promises.setTimeout)(10);
console.clear();
p.intro(`${_picocolors.default.bgBlack(_picocolors.default.underline(_picocolors.default.gray(`Never`)))}`);
await (0, _promises.setTimeout)(100);
p.intro(`${_picocolors.default.bgBlack(_picocolors.default.red(` stop `))}`);
await (0, _promises.setTimeout)(300);
p.intro(`${_picocolors.default.bgBlack(_picocolors.default.white(` never`))}`);
await (0, _promises.setTimeout)(300);
p.intro(`${_picocolors.default.bgBlack(_picocolors.default.cyan(` stopping `))}`);
await (0, _promises.setTimeout)(500);
let colors = ['blue', 'yellow', 'red', 'magenta'];
for (let i in _art.characters) {
if (i < _art.characters.length - 1) {
console.clear();
p.intro(`${_picocolors.default.bgBlack(_picocolors.default[colors[i]](`Better future loading..`))}`);
p.intro(_picocolors.default.bgBlack(_picocolors.default[colors[i]](_art.characters[i])));
let rockets = '';
for (let step = 0; step < i; step++) {
rockets += "๐๐๐";
}
p.intro(rockets);
await (0, _promises.setTimeout)(Math.random() * 400 + 150);
}
}
console.clear();
p.intro(_picocolors.default.bgBlack(_picocolors.default.green(_art.characters.pop())));
p.intro(`${_picocolors.default.bgGreen(_picocolors.default.black(` The Web : CLI `))}
${merlinSays('Welcome wary web wanderer')}`);
}
// standard community statement so we can leverage on cancel executions
function communityStatement() {
p.outro(`
๐ง HAX @ Penn State: ${_picocolors.default.underline(_picocolors.default.cyan('https://hax.psu.edu'))}
๐ฎ Ideas to HAX Harder, Better, Faster, Stronger: ${_picocolors.default.underline(_picocolors.default.white('https://github.com/haxtheweb/issues/issues'))}
๐ Share on LinkedIn: ${_picocolors.default.underline(_picocolors.default.cyan('https://bit.ly/hax-the-linkedin'))}
๐งต Tweet on X: ${_picocolors.default.underline(_picocolors.default.white('https://bit.ly/hax-the-x'))}
๐ฌ Join Community: ${_picocolors.default.underline(_picocolors.default.cyan('https://bit.ly/hax-discord'))}
๐ก ${_picocolors.default.bold(_picocolors.default.white(`Never. Stop. Innovating.`))}
`);
}
// standardize merlin statements visually
function merlinSays(text) {
return `${_picocolors.default.yellow(_picocolors.default.bgBlack(` ๐ง Merlin: `))} ${_picocolors.default.bgBlack(_picocolors.default.green(` ${text} `))}`;
}