Created
December 19, 2016 04:23
-
-
Save w3cj/1c5924aa0c37b84f621c46a4a266dfb9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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