Initial commit
This commit is contained in:
20
node/TestCli/node_modules/chalk-animation/examples/demo.js
generated
vendored
Normal file
20
node/TestCli/node_modules/chalk-animation/examples/demo.js
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
const chalkAnimation = require('..');
|
||||
|
||||
const str = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit\n';
|
||||
const cls = `\u001B[2J\u001B[0;0H`;
|
||||
|
||||
const effects = ['rainbow', 'pulse', 'glitch', 'radar', 'neon', 'karaoke'];
|
||||
console.log(cls);
|
||||
console.log(str);
|
||||
|
||||
const i = setInterval(() => {
|
||||
if (effects.length === 0) {
|
||||
clearInterval(i);
|
||||
return;
|
||||
}
|
||||
const e = effects.shift();
|
||||
console.log(cls);
|
||||
setTimeout(() => {
|
||||
chalkAnimation[e](str);
|
||||
}, 500);
|
||||
}, 7000);
|
||||
Reference in New Issue
Block a user