Skip to content

Instantly share code, notes, and snippets.

@w3cj
Created December 19, 2016 04:23
Show Gist options
  • Save w3cj/1c5924aa0c37b84f621c46a4a266dfb9 to your computer and use it in GitHub Desktop.
Save w3cj/1c5924aa0c37b84f621c46a4a266dfb9 to your computer and use it in GitHub Desktop.
const figlet = require('figlet');
require('colors');
const fonts = [
'Banner3',
'Larry 3D 2',
'Pebbles',
'JS Bracket Letters',
'Stop',
'Sub-Zero',
'Spliff',
'Small Keyboard',
'Rounded'
];
const lines = ['Time','for CJ to', 'write some', 'code'];
let currentFont = 0;
const randomFont = () => fonts[currentFont];
const itsTimeForCJ = () => {
const font = randomFont();
currentFont++;
if(currentFont > fonts.length) currentFont = 0;
lines.forEach(line => {
const text = figlet.textSync(line, font);
console.log(text.rainbow);
});
};
setTimeout(() => {
setInterval(itsTimeForCJ, 1000);
}, 500);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment