-
Notifications
You must be signed in to change notification settings - Fork 692
/
Copy pathindex.html
292 lines (280 loc) · 12.1 KB
/
index.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.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Spectacle One-Page Example</title>
</head>
<body>
<div id="root"></div>
<!-- TODO: Need to update build script to final solution. Maybe add dev for good?-->
<script type="importmap">
{
"imports": {
"htm": "https://esm.sh/htm@^3?external=react,react-dom&dev",
"spectacle": "https://esm.sh/spectacle@10?external=react,react-dom&bundle&dev",
"broadcast-channel": "https://esm.sh/broadcast-channel@^4.17.0?external=react,react-dom&dev",
"history": "https://esm.sh/history@^5.3.0?external=react,react-dom&dev",
"lodash.clonedeep": "https://esm.sh/lodash.clonedeep@^4.5.0?external=react,react-dom&dev",
"mdast-builder": "https://esm.sh/mdast-builder@^1.1.1?external=react,react-dom&dev",
"mdast-zone": "https://esm.sh/mdast-zone@^4.0.0?external=react,react-dom&dev",
"merge-anything": "https://esm.sh/merge-anything@^3.0.3?external=react,react-dom&dev",
"mousetrap": "https://esm.sh/mousetrap@^1.6.5?external=react,react-dom&dev",
"query-string": "https://esm.sh/query-string@^7.1.3?external=react,react-dom&dev",
"react-fast-compare": "https://esm.sh/react-fast-compare@^3.2.0?external=react,react-dom&dev",
"react-is": "https://esm.sh/react-is@^18.1.0?external=react,react-dom&dev",
"react-spring": "https://esm.sh/react-spring@^9.5.5?external=react,react-dom&dev",
"react-swipeable": "https://esm.sh/react-swipeable@^7.0.0?external=react,react-dom&dev",
"react-syntax-highlighter": "https://esm.sh/react-syntax-highlighter@^15.5.0?external=react,react-dom&dev",
"react-syntax-highlighter/dist/cjs/styles/prism/vs-dark.js": "https://esm.sh/react-syntax-highlighter@^15.5.0/dist/esm/styles/prism/vs-dark.js?external=react,react-dom&dev",
"react-syntax-highlighter/dist/cjs/styles/prism/index.js": "https://esm.sh/react-syntax-highlighter@^15.5.0/dist/esm/styles/prism/index.js?external=react,react-dom&dev",
"rehype-raw": "https://esm.sh/rehype-raw@^5.1.0?external=react,react-dom&dev",
"rehype-react": "https://esm.sh/rehype-react@^6.0.0?external=react,react-dom&dev",
"remark-parse": "https://esm.sh/remark-parse@^8.0.3?external=react,react-dom&dev",
"remark-rehype": "https://esm.sh/remark-rehype@^7.0.0?external=react,react-dom&dev",
"styled-components": "https://esm.sh/styled-components@^5.3.6?external=react,react-dom&dev",
"unified": "https://esm.sh/unified@^9.0.0?external=react,react-dom&dev",
"unist-util-visit": "https://esm.sh/unist-util-visit@^2.0.3?external=react,react-dom&dev",
"use-resize-observer": "https://esm.sh/use-resize-observer@^9.0.2?external=react,react-dom&dev"
}
}
</script>
<script type="module">
import React from 'react';
import ReactDOM from 'react-dom';
import {
FlexBox,
Heading,
SpectacleLogo,
UnorderedList,
CodeSpan,
OrderedList,
ListItem,
Appear,
Slide,
Deck,
Text,
Grid,
Box,
Image,
CodePane,
MarkdownSlide,
MarkdownSlideSet,
Notes,
DefaultTemplate,
SlideLayout
} from 'spectacle';
import htm from 'htm';
const html = htm.bind(React.createElement);
const FitText = Text; // TODO: NEED PUBLISH
const formidableLogo = 'https://avatars2.githubusercontent.com/u/5078602?s=280&v=4';
// SPECTACLE_CLI_THEME_START
const theme = {
fonts: {
header: '"Open Sans Condensed", Helvetica, Arial, sans-serif',
text: '"Open Sans Condensed", Helvetica, Arial, sans-serif'
}
};
// SPECTACLE_CLI_THEME_END
const SlideFragments = () => html`
<${Slide}>
<${Text}>This is a slide fragment.</${Text}>
</${Slide}>
<${Slide}>
<${Text}>This is also a slide fragment.</${Text}>
<${Appear}>
<${Text}>This item shows up!</${Text}>
</${Appear}>
<${Appear}>
<${Text}>This item also shows up!</${Text}>
</${Appear}>
</${Slide}>
`;
const template = html`
<${DefaultTemplate} />`;
const Presentation = () => html`<${Deck} theme=${theme} template=${template}>
<${Slide}>
<${FlexBox} height="100%">
<${SpectacleLogo} size=${500} />
</${FlexBox}>
<${Notes}>Spectacle supports notes per slide.<ol>
<li>Notes can now be HTML markup!</li>
<li>Lists can make it easier to make points.</li>
</ol>
</${Notes}>
</${Slide}>
<${Slide}>
<${FlexBox} height="100%" flexDirection="column">
<${Heading} margin="0px" fontSize="150px">✨<i>Spectacle</i> ✨</${Heading}>
<${Heading} margin="0px" fontSize="h2">A ReactJS Presentation Library</${Heading}>
<${Heading} margin="0px 32px" color="primary" fontSize="h3">Where you can write your decks in JSX, Markdown, or MDX!</${Heading}>
</${FlexBox}>
</${Slide}>
<${Slide} transition=${{
from: {
transform: 'scale(0.5) rotate(45deg)',
opacity: 0
},
enter: {
transform: 'scale(1) rotate(0)',
opacity: 1
},
leave: {
transform: 'scale(0.2) rotate(315deg)',
opacity: 0
}
}} backgroundColor="tertiary" backgroundImage="url(https://github.com/FormidableLabs/dogs/blob/main/src/beau.jpg?raw=true)" backgroundOpacity=${0.5}>
<${Heading}>Custom Backgrounds</${Heading}>
<${UnorderedList}>
<${ListItem}>
<${CodeSpan}>backgroundColor</${CodeSpan}>
</${ListItem}>
<${ListItem}>
<${CodeSpan}>backgroundImage</${CodeSpan}>
</${ListItem}>
<${ListItem}>
<${CodeSpan}>backgroundOpacity</${CodeSpan}>
</${ListItem}>
<${ListItem}>
<${CodeSpan}>backgroundSize</${CodeSpan}>
</${ListItem}>
<${ListItem}>
<${CodeSpan}>backgroundPosition</${CodeSpan}>
</${ListItem}>
<${ListItem}>
<${CodeSpan}>backgroundRepeat</${CodeSpan}>
</${ListItem}>
</${UnorderedList}>
</${Slide}>
<${Slide}>
<${Heading}>Animated Elements</${Heading}>
<${OrderedList}>
<${Appear}>
<${ListItem}>Elements can animate in!</${ListItem}>
</${Appear}>
<${Appear}>
<${ListItem}>Out of order</${ListItem}>
</${Appear}>
<${Appear} priority=${0}>
<${ListItem}>Just identify the order with the prop <${CodeSpan}>priority</${CodeSpan}>!</${ListItem}>
</${Appear}>
</${OrderedList}>
</${Slide}>
<${Slide}>
<${Heading}>This is a Heading</${Heading}>
<${FitText}>This is a <${CodeSpan}>FitText</${CodeSpan}> component</${FitText}>
<${FitText} color="secondary" style=${{
textTransform: 'uppercase',
fontFamily: 'Comic Sans MS'
}}>Shorter fit text</${FitText}>
<${Text}>This is a Text. (Resize this window!)</${Text}>
</${Slide}>
<${Slide}>
<${FlexBox}>
<${Text}>These</${Text}>
<${Text}>Text</${Text}>
<${Text} color="secondary">Items</${Text}>
<${Text} fontWeight="bold">Flex</${Text}>
</${FlexBox}>
<${Grid} gridTemplateColumns="1fr 2fr" gridColumnGap=${15}>
<${Box} backgroundColor="primary">
<${Text} color="secondary">Single-size Grid Item</${Text}>
</${Box}>
<${Box} backgroundColor="secondary">
<${Text}>Double-size Grid Item</${Text}>
</${Box}>
</${Grid}>
<${Grid} gridTemplateColumns="1fr 1fr 1fr" gridTemplateRows="1fr 1fr 1fr" gridRowGap=${1}>
${Array(9).fill('').map((_, index) => html`<${FlexBox} paddingTop=${0} key=${`formidable-logo-${index}`} flex=${1}>
<${Image} src=${formidableLogo} width=${100} />
</${FlexBox}>`)}
</${Grid}>
</${Slide}>
<${SlideFragments} />
<${Slide}>
<${CodePane} language="jsx">
${`
import { createClient, Provider } from 'urql';
const client = createClient({ url: 'https://0ufyz.sse.codesandbox.io' });
const App = () => (
<Provider value={client}>
<Todos />
</Provider>
);
`}
</${CodePane}>
<${Box} height=${20} />
<${CodePane} language="java" showLineNumbers=${false}>
${`
public class NoLineNumbers {
public static void main(String[] args) {
System.out.println("Hello");
}
}
`}
</${CodePane}>
</${Slide}>
<div>
<${Slide}>
<${Heading}>This is a slide embedded in a div</${Heading}>
</${Slide}>
</div>
<${MarkdownSlide} componentProps=${{
color: 'yellow'
}}>
${`
# This is a Markdown Slide
- You can pass props down to all elements on the slide.
- Just use the \`componentProps\` prop.
`}
</${MarkdownSlide}>
<${MarkdownSlide} animateListItems>
${`
# This is also a Markdown Slide
It uses the \`animateListItems\` prop.
- Its list items...
- ...will appear...
- ...one at a time.
`}
</${MarkdownSlide}>
<${Slide}>
<${Grid} gridTemplateColumns="50% 50%" gridTemplateRows="50% 50%" height="100%">
<${FlexBox} alignItems="center" justifyContent="center">
<${Heading}>This is a 4x4 Grid</${Heading}>
</${FlexBox}>
<${FlexBox} alignItems="center" justifyContent="center">
<${Text} textAlign="center">With all the content aligned and justified center.</${Text}>
</${FlexBox}>
<${FlexBox} alignItems="center" justifyContent="center">
<${Text} textAlign="center">It uses Spectacle <${CodeSpan}>
${"<Grid />"}
</${CodeSpan}> and <${CodeSpan}>
${"<FlexBox />"}
</${CodeSpan}> components.</${Text}>
</${FlexBox}>
<${FlexBox} alignItems="center" justifyContent="center">
<${Box} width=${200} height=${200} backgroundColor="secondary" />
</${FlexBox}>
</${Grid}>
</${Slide}>
<${MarkdownSlideSet}>
${`
# This is the first slide of a Markdown Slide Set
---
# This is the second slide of a Markdown Slide Set
`}
</${MarkdownSlideSet}>
<${SlideLayout.List} title="Slide layouts!" items=${['Two-column', 'Lists' , 'And more!' ]} animateListItems />
</${Deck}>
`;
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(html`<${Presentation}/>`);
</script>
</body>
</html>