Skip to content

Commit

Permalink
feat(animation): Add basic print animation
Browse files Browse the repository at this point in the history
  • Loading branch information
ghaiklor committed Dec 6, 2015
1 parent 8e6047a commit 86dfe4d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"charm": "1.0.0",
"commander": "2.9.0",
"keypress": "0.2.1",
"kittik-animation-print": "1.0.0",
"kittik-cursor": "1.0.2",
"kittik-shape-rectangle": "1.0.1",
"kittik-shape-text": "1.0.1"
Expand Down
11 changes: 10 additions & 1 deletion src/Presentation.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import keypress from 'keypress';
import { Cursor } from 'kittik-cursor';
import Print from 'kittik-animation-print';
import { Slide } from './Slide';

/**
Expand All @@ -10,7 +11,7 @@ import { Slide } from './Slide';
* @version 1.0.0
*/
export class Presentation {
_cursor = Cursor.create([process.stdout], [process.stdin]).reset().hide();
_cursor = Cursor.create([new Print().enable(), process.stdout], [process.stdin]).reset().hide();
_currentSlideIndex = 0;
_slides = [];

Expand All @@ -27,8 +28,16 @@ export class Presentation {
process.stdin.setEncoding('utf8');

process.stdin.on('keypress', this._onKeyPress.bind(this));
}

/**
* Run the presentation.
*
* @returns {Presentation}
*/
run() {
this.renderSlide();
return this;
}

/**
Expand Down

0 comments on commit 86dfe4d

Please sign in to comment.