Skip to content

Commit

Permalink
feat(shape): Add new shape that renders code blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
ghaiklor committed May 10, 2016
1 parent 8298442 commit 98cbd94
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
12 changes: 12 additions & 0 deletions examples/complex.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ Deck.create({
y: 'middle',
font: 'Star Wars'
}
}, {
name: 'Code',
type: 'Code',
options: {
code: `const sentence = 'You can embed your code here';\nconsole.log(sentence);`,
x: 'center',
y: 'middle'
}
}],
animations: [{
name: 'Print',
Expand Down Expand Up @@ -95,6 +103,10 @@ Deck.create({
order: [
'FigText::Slide In->Focus'
]
}, {
order: [
'Code'
]
}, {
shapes: [{
name: 'Text',
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"kittik-animation-print": "3.1.0",
"kittik-animation-slide": "2.1.0",
"kittik-cursor": "4.1.0",
"kittik-shape-code": "1.0.0",
"kittik-shape-fig-text": "2.1.0",
"kittik-shape-image": "2.1.0",
"kittik-shape-rectangle": "2.1.0",
Expand Down
3 changes: 2 additions & 1 deletion src/Slide.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import CodeShape from 'kittik-shape-code';
import FigTextShape from 'kittik-shape-fig-text';
import ImageShape from 'kittik-shape-image';
import RectangleShape from 'kittik-shape-rectangle';
Expand All @@ -7,7 +8,7 @@ import FocusAnimation from 'kittik-animation-focus';
import PrintAnimation from 'kittik-animation-print';
import SlideAnimation from 'kittik-animation-slide';

const SHAPES = {FigText: FigTextShape, Image: ImageShape, Rectangle: RectangleShape, Text: TextShape};
const SHAPES = {Code: CodeShape, FigText: FigTextShape, Image: ImageShape, Rectangle: RectangleShape, Text: TextShape};
const ANIMATIONS = {Focus: FocusAnimation, Print: PrintAnimation, Slide: SlideAnimation};

/**
Expand Down

0 comments on commit 98cbd94

Please sign in to comment.