diff --git a/install/generator-cyphernode/generators/app/index.js b/install/generator-cyphernode/generators/app/index.js index 3a3e5d1..5cd4308 100644 --- a/install/generator-cyphernode/generators/app/index.js +++ b/install/generator-cyphernode/generators/app/index.js @@ -23,16 +23,34 @@ const sleep = function(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } +const easeOutCubic = function(t, b, c, d) { + return c*((t=t/d-1)*t*t+1)+b; +} + const splash = async function() { let frames = []; fs.readdirSync(path.join(__dirname,'splash')).forEach(function(file) { frames.push(fs.readFileSync(path.join(__dirname,'splash',file))); }); + const frame0 = frames[0]; + + const frame0lines = frame0.toString().split('\n'); + const frame0lineCount = frame0lines.length; + const steps = 10; + process.stdout.write(clear); - process.stdout.write(reset); - process.stdout.write(frames[0]); + await sleep(150); + + for( let i=0; i<=steps; i++ ) { + const pos = easeOutCubic( i, 0, frame0lineCount, steps ) | 0; + process.stdout.write(reset); + for( let l=frame0lineCount-pos; l