Skip to content

Commit aad7a82

Browse files
committed
revealjs - document custom fragments
towards quarto-dev/quarto-cli#4795
1 parent 726a2f9 commit aad7a82

File tree

4 files changed

+59
-0
lines changed

4 files changed

+59
-0
lines changed

_freeze/site_libs/revealjs/dist/theme/quarto-6a1c7f42864bf5c93bea5e6c4397857a.css

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/presentations/revealjs/advanced.qmd

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,33 @@ Appears second
464464
:::
465465
```
466466

467+
### Custom Fragments
468+
469+
Custom effects can be created by specifying CSS styles for `.fragment.effectname` and `.fragment.effectname.visible`. The `visible` class is applied to each fragment as they are navigated through during the presentation. A `custom` class can be added to each fragment to tell reveal.js to avoid applying its default fade-in fragment styles.
470+
471+
For example, the following defines a fragment style where elements are initially blurred but become focused when stepped through.
472+
473+
``` {.markdown .reveal-demo code-preview="demo/mini/fragments-custom.qmd"}
474+
::: {.fragment .custom .blur}
475+
First item to be unblurred
476+
:::
477+
478+
::: {.fragment .custom .blur}
479+
Second one to be revealed
480+
:::
481+
```
482+
483+
with this CSS for the style associated with `blur` class.
484+
````css
485+
.reveal .slides section .fragment.blur {
486+
filter: blur(5px);
487+
}
488+
489+
.reveal .slides section .fragment.blur.visible {
490+
filter: none
491+
}
492+
````
493+
467494
## Parallax Background
468495

469496
If you want to use a parallax scrolling background, add the `parallax-background-image` and `parallax-background-size` options. For example:
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.reveal .slides section .fragment.blur {
2+
filter: blur(5px);
3+
}
4+
5+
.reveal .slides section .fragment.blur.visible {
6+
filter: none
7+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
format:
3+
revealjs:
4+
css: custom-blur.css
5+
---
6+
7+
### Advance the slide to see custom fragment style (from blurred to focus)
8+
9+
<br/>
10+
11+
::: {.fragment .custom .blur}
12+
First item to be unblurred
13+
:::
14+
15+
::: {.fragment .custom .blur}
16+
Second one to be revealed
17+
:::

0 commit comments

Comments
 (0)