forked from FormidableLabs/spectacle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
one-page.html
292 lines (287 loc) · 11.5 KB
/
one-page.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width initial-scale=1 user-scalable=no" />
<title>Spectacle</title>
<link href="https://fonts.googleapis.com/css?family=Lobster+Two:400,700" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Open+Sans+Condensed:300,700" rel="stylesheet" type="text/css">
<link href="https://unpkg.com/normalize.css@7/normalize.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="root"></div>
<script src="https://unpkg.com/prop-types@15/prop-types.js"></script>
<script src="https://unpkg.com/react@16/umd/react.production.min.js"></script>
<script src="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js"></script>
<script src="https://unpkg.com/@babel/standalone/babel.js"></script>
<script src="https://unpkg.com/spectacle@^4/dist/spectacle.js"></script>
<script src="https://unpkg.com/spectacle@^4/lib/one-page.js"></script>
<script type="text/spectacle">
() => {
// --------------------------------------------------------------------
// Code stuff to use in the presentation.
// (We can't link in / require files, but we can approximate here.)
// --------------------------------------------------------------------
// Customize the default theme.
const { themes: { defaultTheme } } = Spectacle;
const theme = defaultTheme({
primary: "#ff4081"
});
// Example source code for a source code slide.
const exampleDeck = `
return (
<Deck transition={['zoom','slide']} transitionDuration={800}>
<Slide bgColor="primary">
<Heading size={1} fit caps>
React Presentations
</Heading>
<Heading size={2} fit caps>
Written In React
</Heading>
</Slide>
<Slide bgColor="black">
<Heading size={1} fit textColor="primary" textFont="secondary">
Wait What?
</Heading>
</Slide>
<Slide bgColor="primary" textColor="black" align="center top">
<Heading size={1} textColor="black" textFont="primary">
Thats right
</Heading>
<List>
<ListItem>Inline style based theme system</ListItem>
<ListItem>Autofit Text</ListItem>
<ListItem>PDF Export</ListItem>
</List>
</Slide>
</Deck>
)
`.trim();
// Interactive code.
const { Component } = React;
const { Heading } = Spectacle;
class Interactive extends Component {
constructor() {
super();
this.state = {
count: 0
};
this.handleClick = this.handleClick.bind(this);
}
handleClick() {
this.setState({
count: this.state.count + 1
});
}
render() {
const styles = {
padding: 20,
background: "black",
minWidth: 300,
marginTop: 20,
textTransform: "uppercase",
border: "none",
color: "white",
outline: "none",
fontWeight: "bold",
fontSize: "2em"
};
return (
<div>
{this.state.count < 5 ?
<div>
<Heading size={5} textColor="black">
The button has been clicked {this.state.count} times
</Heading>
<button style={styles} type="button" onClick={this.handleClick}>Click Me</button>
</div> :
<Heading size={5} fit caps textColor="black">Easy there pal</Heading>
}
</div>
);
}
}
// --------------------------------------------------------------------
// The presentation!
// --------------------------------------------------------------------
return (
<Deck transition={["zoom", "slide"]} theme={theme} transitionDuration={500}>
<Slide transition={["zoom"]} bgColor="primary">
<Heading size={1} fit caps lineHeight={1} textColor="black">
Spectacle
</Heading>
<Heading size={1} fit caps>
A ReactJS Presentation Library
</Heading>
<Heading size={1} fit caps textColor="black">
Where You Can Write Your Decks In JSX
</Heading>
<Link href="https://github.com/FormidableLabs/spectacle">
<Text bold caps textColor="tertiary">View on Github</Text>
</Link>
<Text textSize="1.5em" margin="20px 0px 0px" bold>Hit Your Right Arrow To Begin!</Text>
</Slide>
<Slide id="wait-what" transition={["slide"]} bgColor="black" notes="You can even put notes on your slide. How awesome is that?">
<Image src={"https://github.com/FormidableLabs/spectacle/raw/master/example/assets/kat.png"} margin="0px auto 40px" height="293px"/>
<Heading size={2} caps fit textColor="primary" textFont="primary">
Wait what?
</Heading>
</Slide>
<Slide transition={["zoom", "fade"]} bgColor="primary" notes="<ul><li>talk about that</li><li>and that</li></ul>">
<CodePane
lang="jsx"
source={exampleDeck}
margin="20px auto"
/>
</Slide>
<Slide>
<ComponentPlayground
theme="dark"
/>
</Slide>
<Slide transition={["slide"]} bgImage={"https://cdn.rawgit.com/FormidableLabs/spectacle/master/example/assets/city.jpg"} bgDarken={0.75}>
<Appear fid="1">
<Heading size={1} caps fit textColor="primary">
Full Width
</Heading>
</Appear>
<Appear fid="2">
<Heading size={1} caps fit textColor="tertiary">
Adjustable Darkness
</Heading>
</Appear>
<Appear fid="3">
<Heading size={1} caps fit textColor="primary">
Background Imagery
</Heading>
</Appear>
</Slide>
<Slide transition={["zoom", "fade"]} bgColor="primary">
<Heading caps fit>Flexible Layouts</Heading>
<Layout>
<Fill>
<Heading size={4} caps textColor="secondary" bgColor="white" margin={10}>
Left
</Heading>
</Fill>
<Fill>
<Heading size={4} caps textColor="secondary" bgColor="white" margin={10}>
Right
</Heading>
</Fill>
</Layout>
</Slide>
<Slide transition={["slide"]} bgColor="black">
<BlockQuote>
<Quote>Wonderfully formatted quotes</Quote>
<Cite>Ken Wheeler</Cite>
</BlockQuote>
</Slide>
<Slide transition={["spin", "zoom"]} bgColor="tertiary">
<Heading caps fit size={1} textColor="primary">
Inline Markdown
</Heading>
<Markdown>
{`
![Markdown Logo](https://cdn.rawgit.com/FormidableLabs/spectacle/master/example/assets/markdown.png)
You can write inline images, [Markdown Links](http://commonmark.org), paragraph text and most other markdown syntax
* Lists too!
* With ~~strikethrough~~ and _italic_
* And let's not forget **bold**
`}
</Markdown>
</Slide>
{
MarkdownSlides`
#### Create Multiple Slides in Markdown
All the same tags and elements supported in <Markdown /> are supported in MarkdownSlides.
---
Slides are separated with **three dashes** and can be used _anywhere_ in the deck. The markdown can either be:
* A Tagged Template Literal
* Imported Markdown from another file
`
}
<Slide transition={["slide", "spin"]} bgColor="primary">
<Heading caps fit size={1} textColor="tertiary">
Smooth
</Heading>
<Heading caps fit size={1} textColor="secondary">
Combinable Transitions
</Heading>
</Slide>
<SlideSet>
<Slide transition={["fade"]} bgColor="secondary" textColor="primary">
<List>
<Appear><ListItem>Inline style based theme system</ListItem></Appear>
<Appear><ListItem>Autofit text</ListItem></Appear>
<Appear><ListItem>Flexbox layout system</ListItem></Appear>
<Appear><ListItem>PDF export</ListItem></Appear>
<Appear><ListItem>And...</ListItem></Appear>
</List>
</Slide>
<Slide transition={["slide"]} bgColor="primary">
<Heading size={1} caps fit textColor="tertiary">
Your presentations are interactive
</Heading>
<Interactive/>
</Slide>
</SlideSet>
<Slide transition={["slide"]} bgColor="primary"
notes="Hard to find cities without any pizza"
>
<Heading size={4} caps textColor="secondary" bgColor="white" margin={10}>
Pizza Toppings
</Heading>
<Layout>
<Table>
<TableHeader>
<TableRow>
<TableHeaderItem/>
<TableHeaderItem>2011</TableHeaderItem>
<TableHeaderItem>2013</TableHeaderItem>
<TableHeaderItem>2015</TableHeaderItem>
</TableRow>
</TableHeader>
<TableBody>
<TableRow>
<TableItem>None</TableItem>
<TableItem>61.8%</TableItem>
<TableItem>39.6%</TableItem>
<TableItem>35.0%</TableItem>
</TableRow>
<TableRow>
<TableItem>Pineapple</TableItem>
<TableItem>28.3%</TableItem>
<TableItem>54.5%</TableItem>
<TableItem>61.5%</TableItem>
</TableRow>
<TableRow>
<TableItem>Pepperoni</TableItem>
<TableItem/>
<TableItem>50.2%</TableItem>
<TableItem>77.2%</TableItem>
</TableRow>
<TableRow>
<TableItem>Olives</TableItem>
<TableItem/>
<TableItem>24.9%</TableItem>
<TableItem>55.9%</TableItem>
</TableRow>
</TableBody>
</Table>
</Layout>
</Slide>
<Slide transition={["spin", "slide"]} bgColor="tertiary">
<Heading size={1} caps fit lineHeight={1.5} textColor="primary">
Made with love in Seattle by
</Heading>
<Link href="http://www.formidable.com">
<Image width="100%" src={"https://cdn.rawgit.com/FormidableLabs/spectacle/master/example/assets/formidable-logo.svg"}/>
</Link>
</Slide>
</Deck>
);
}
</script>
</body>
</html>