-
Notifications
You must be signed in to change notification settings - Fork 9
/
index.qmd
326 lines (213 loc) · 6.66 KB
/
index.qmd
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
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
---
format:
revealjs:
width: 1280
height: 720
preload-iframes: true
---
# {background-iframe="colored-particles/index.html"}
::: r-fit-text
Having fun with
:::
::: r-fit-text
iFrames
:::
```{r}
source("zip-all-the-things.R")
```
## Why should I use iFrames?
In [Quarto Presentations](https://quarto.org/docs/presentations/revealjs/) one way to add something extra is to use [Slide Backgrounds](https://quarto.org/docs/presentations/revealjs/#slide-backgrounds)
Images and videos are good for some added flair, and they automatically fill the background
Using html elements and javascript to make an animated background, is almost impossible to get right inside your `.qmd` file, but super easy with [iFrame Backgrounds](https://quarto.org/docs/presentations/revealjs/#iframe-backgrounds)
## How to use iFrame Backgrounds
1. Add a folder next to your `.qmd` file
2. In that folder add the following files
- `index.html`
- `script.js` (optional)
- `style.css` (optional)
3. Use the following notation to use (title can be empty)
::: {style="font-family: monospace;"}
\# title {background-iframe="my-iframe/index.html"}
:::
4. Set `preload-iframes: true` in yaml
## Folder Structures
This is my preferred setup for a quarto presentation.
Naming the main file `index.qmd` gives you `index.html` as your output which is a good default for publishing
::: {style="font-family: monospace;"}
awesome-presentation/\
├── index.qmd\
├── index.html\
├── style.scss (only styles index.qmd)\
└── my-iframe/\
\ \ \ ├── index.html\
\ \ \ ├── script.js\
\ \ \ └── style.css (only styles iframe)\
:::
# How to make your own
From [codepen.io](https://codepen.io)
- find one you like
- click `export -> export .zip`
- Copy over the results from the `dist` folder
- trim and modify content to your liking
- Add a README file with references
- Copy over license
## https://particles.js.org/
particles.js is a great library that works perfectly as iFrames, and have amazing customization
::: columns
::: {.column width="50%"}
<iframe src="polygon-mask/index.html" style="width: 100%; aspect-ratio: 1.2;"></iframe>
:::
::: {.column width="50%"}
<iframe src="colored-particles/index.html" style="width: 100%; aspect-ratio: 1.2;"></iframe>
:::
:::
## Gallery
The following slides contain a number of different iframe for you to use, modify and expand on
Clicking the download link should give you a folder with everything you need
Additional entries are welcome at [EmilHvitfeldt/quarto-iframe-examples](https://github.com/EmilHvitfeldt/quarto-iframe-examples)
# {background-iframe="rotating-earth/index.html"}
::: {style="background-color: #ffffffbb; border-radius: 10px; padding: 5px;"}
::: r-fit-text
Rotating Earth
:::
[Download template](rotating-earth.zip)
:::
# {background-iframe="hello-matrix/index.html"}
::: {style="background-color: #ffffffbb; border-radius: 10px; padding: 5px;"}
::: r-fit-text
Hello Matrix
:::
[Download template](hello-matrix.zip)
:::
# {background-iframe="ambient/index.html"}
::: {style="background-color: #ffffff33; border-radius: 10px; padding: 5px;"}
::: r-fit-text
Ambient
:::
[Download template](ambient.zip)
:::
# {background-iframe="glittering-sea/index.html"}
::: {style="background-color: #ffffffbb; border-radius: 10px; padding: 5px;"}
::: r-fit-text
Glittering Sea
:::
[Download template](glittering-sea.zip)
:::
# {background-iframe="moving-waves/index.html"}
::: {style="background-color: #ffffffbb; border-radius: 10px; padding: 5px;"}
::: r-fit-text
Moving Waves
:::
[Download template](moving-waves.zip)
:::
# {background-iframe="grid-worms/index.html"}
::: {style="background-color: #ffffffbb; border-radius: 10px; padding: 5px;"}
::: r-fit-text
Grid Worms
:::
[Download template](grid-worms.zip)
:::
# {background-iframe="meatballs/index.html"}
::: {style="background-color: #ffffffbb; border-radius: 10px; padding: 5px;"}
::: r-fit-text
Meatballs
:::
[Download template](meatballs.zip)
:::
# {background-iframe="tetris/index.html"}
::: {style="background-color: #ffffffbb; border-radius: 10px; padding: 5px;"}
::: r-fit-text
tetris
:::
[Download template](tetris.zip)
:::
# {background-iframe="boids/index.html"}
::: {style="background-color: #ffffffbb; border-radius: 10px; padding: 5px;"}
::: r-fit-text
boids
:::
[Download template](boids.zip)
:::
# {background-iframe="multiple-images/index.html"}
::: {style="background-color: #ffffffbb; border-radius: 10px; padding: 5px;"}
::: r-fit-text
Multiple Floating Images
:::
[Download template](multiple-images.zip)
:::
# {background-iframe="polygon-mask/index.html"}
::: {style="background-color: #ffffff33; border-radius: 10px; padding: 5px;"}
::: r-fit-text
Polygon Mask
:::
[Download template](polygon-mask.zip)
:::
# {background-iframe="colored-particles/index.html"}
::: {style="background-color: #ffffffbb; border-radius: 10px; padding: 5px;"}
::: r-fit-text
Colored Particles
:::
[Download template](colored-particles.zip)
:::
# {background-iframe="logo-fall/index.html"}
::: {style="background-color: #ffffffbb; border-radius: 10px; padding: 5px;"}
::: r-fit-text
Logo Fall
:::
[Download template](logo-fall.zip)
:::
# {background-iframe="center-of-universe/index.html"}
::: {style="background-color: #ffffffbb; border-radius: 10px; padding: 5px;"}
::: r-fit-text
Center of the Universe
:::
[Download template](center-of-universe.zip)
:::
# {background-iframe="css-fireworks/index.html"}
::: {style="color: #FFFFFF"}
::: r-fit-text
css fireworks
:::
[Download template](css-fireworks.zip)
:::
# {background-iframe="flow-field/index.html"}
::: {style="background-color: #ffffffbb; border-radius: 10px; padding: 5px;"}
::: r-fit-text
flow field
:::
[Download template](flow-field.zip)
:::
# {background-iframe="hurra/index.html"}
[Download template](hurra.zip)
:::
# {background-iframe="night-sky/index.html"}
::: {style="color: #ffffffFF;"}
::: r-fit-text
Night Sky
:::
[Download template](night-sky.zip)
:::
# {background-iframe="snowy-landscape/index.html"}
::: {style="background-color: #ffffffbb; border-radius: 10px; padding: 5px;"}
::: r-fit-text
Snowy Landscape
:::
[Download template](snowy-landscape.zip)
:::
# {background-iframe="space-scroller/index.html"}
::: {style="background-color: #ffffffbb; border-radius: 10px; padding: 5px;"}
::: r-fit-text
Space Scroller
:::
[Download template](space-scroller.zip)
:::
# {background-iframe="stars/index.html"}
::: {style="color: #ffffffFF;"}
Stars
[Download template](stars.zip)
:::
# {background-iframe="beach-crusin/index.html"}
::: {style="background-color: #ffffffbb; border-radius: 10px; padding: 5px;"}
Beach Crusin
[Download template](beach-crusin.zip)
:::