Skip to content

Commit 31bc51a

Browse files
committed
revealjs/demo-hugo: checkpoint
Signed-off-by: lucasew <[email protected]>
1 parent 6eca375 commit 31bc51a

File tree

3 files changed

+32
-4
lines changed

3 files changed

+32
-4
lines changed

revealjs/demo-hugo/content/demo.md

+25-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Teste
2+
title: Demonstração das funcionalidades
33
logo:
44
src: https://blog-do-lucao.vercel.app/apple-touch-icon.png
55
alt: Lucão
@@ -14,6 +14,7 @@ logo:
1414
- Tem que ser num formato mais padrão tipo PNG ou JPG senão o hugo reclama que não sabe lidar
1515

1616
----
17+
%auto-animate%
1718

1819
## Funciona código
1920

@@ -27,6 +28,7 @@ public class Main {
2728
```
2829

2930
---
31+
%auto-animate%
3032

3133
## Funciona código
3234

@@ -70,3 +72,25 @@ pkgs.mkShell {
7072
## Animações
7173

7274
<p color="red">AAAA</p>
75+
76+
---
77+
<style>
78+
img.block {
79+
width: 100px; height: 100px;
80+
margin: auto;
81+
}
82+
</style>
83+
84+
%auto-animate%
85+
86+
# Animações
87+
88+
<img class="block" style="background-color: red"></img>
89+
90+
---
91+
%auto-animate%
92+
93+
# Animações
94+
95+
<img class="block" style="background-color: blue; margin-top: 100px"></img>
96+

revealjs/demo-hugo/layouts/partials/reveal-katex.html

+4-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@
1717

1818
<script>
1919
(function () {
20-
function render() {
21-
renderMathInElement(document.body, {delimiters: [{left: '$$', right: '$$', display: true}, {left: '$', right: '$', display: false}]});
20+
async function render(event) {
21+
requestAnimationFrame(() => {
22+
renderMathInElement(event.currentSlide, {delimiters: [{left: '$$', right: '$$', display: true}, {left: '$', right: '$', display: false}]});
23+
})
2224
}
2325
Reveal.on('slidechanged', render)
2426
Reveal.on('ready', render)

revealjs/demo-hugo/layouts/partials/reveal-mermaid.html

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
let processed = mermaidElem.getAttribute('data-processed');
1515
if (!processed){
1616
// https://github.com/mermaid-js/mermaid/issues/311#issuecomment-332557344
17-
mermaid.init(undefined, mermaidElem);
17+
requestAnimationFrame(() {
18+
mermaid.init(undefined, mermaidElem);
19+
})
1820
}
1921
});
2022
};

0 commit comments

Comments
 (0)