Skip to content

Commit 98cbd94

Browse files
committed
feat(shape): Add new shape that renders code blocks
1 parent 8298442 commit 98cbd94

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

examples/complex.js

+12
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ Deck.create({
3232
y: 'middle',
3333
font: 'Star Wars'
3434
}
35+
}, {
36+
name: 'Code',
37+
type: 'Code',
38+
options: {
39+
code: `const sentence = 'You can embed your code here';\nconsole.log(sentence);`,
40+
x: 'center',
41+
y: 'middle'
42+
}
3543
}],
3644
animations: [{
3745
name: 'Print',
@@ -95,6 +103,10 @@ Deck.create({
95103
order: [
96104
'FigText::Slide In->Focus'
97105
]
106+
}, {
107+
order: [
108+
'Code'
109+
]
98110
}, {
99111
shapes: [{
100112
name: 'Text',

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"kittik-animation-print": "3.1.0",
2929
"kittik-animation-slide": "2.1.0",
3030
"kittik-cursor": "4.1.0",
31+
"kittik-shape-code": "1.0.0",
3132
"kittik-shape-fig-text": "2.1.0",
3233
"kittik-shape-image": "2.1.0",
3334
"kittik-shape-rectangle": "2.1.0",

src/Slide.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import CodeShape from 'kittik-shape-code';
12
import FigTextShape from 'kittik-shape-fig-text';
23
import ImageShape from 'kittik-shape-image';
34
import RectangleShape from 'kittik-shape-rectangle';
@@ -7,7 +8,7 @@ import FocusAnimation from 'kittik-animation-focus';
78
import PrintAnimation from 'kittik-animation-print';
89
import SlideAnimation from 'kittik-animation-slide';
910

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

1314
/**

0 commit comments

Comments
 (0)