Skip to content

Commit 87c642f

Browse files
Version 1.3.4
### Changed - Fixed a typo (was srcipt but should be script) - Fixed visible appearance items in print view (#13) - Dependency fixes
1 parent cf1f939 commit 87c642f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+2969
-13477
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
# Changelog
22

33

4+
## [1.3.4] - 2023-07-31
5+
### Changed
6+
- Fixed a typo (was srcipt but should be script)
7+
- Fixed visible appearance items in print view (#13)
8+
- Dependency fixes
9+
10+
### Added
11+
- Added `cssautoload` option to automatically load the CSS file. Can be switched off if you want to load the CSS file yourself with `import` when using bundlers like Webpack or Parcel.
12+
- Added `baseline` effect for use with words and letters, to make them appear from the baseline of the text.
13+
14+
15+
16+
417
## [1.3.3] - 2023-11-18
518
### Added
619
- Added embedded example to the demo’s

README.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,17 @@ If you're using ES modules, you can add it like this:
7777
```
7878

7979
### Styling
80-
The styling of Appearance is automatically inserted, either loaded through NPM or from the plugin folder. Two files are inserted: The first one is Animate.css by Daniel Eden for the basic animations, we add it through a CDN. The second file adds to the first stylesheet to allow for a non-animated state.
80+
The styling of Appearance is automatically inserted **when the appearance folder is manually (or automatically) copied** to the Reveal.js plugin folder.
8181

82-
If you want to change the Appearance style, you can simply make your own style and use that stylesheet instead. Linking to your custom styles can be managed through the `csspath` option of Appearance.
82+
**BUT**: If you are using a bundler like Webpack or Parcel, that uses **import**, you will also need to **import** the CSS file yourself. Depending on your setup this can be something like this:
8383

84+
```
85+
import 'reveal.js-appearance/plugin/appearance/appearance.css';
86+
```
87+
88+
In that case, the `cssautoload` option (in the Reveal appearance options) should be set to `false`, to avoid style loading errors.
89+
90+
> However, if you actually know the correct full path to the CSS file, then you can still use the `csspath` option and keep `cssautoload` set to `true`.
8491
8592

8693
### HTML
@@ -137,10 +144,12 @@ You can change the speed of each animation, using the tempo classes from Animate
137144

138145
For words and letters, the same techniques can be used.
139146

140-
Note that the data-delay also gets copied to the smaller elements in it, which means that there is no more 'whole sentence' or 'whole word' to delay. By default, the whole element then gets the delay (depending on if it is following other animations) as defined in the `delay` option in the Configuration, but it can be overriden by an optional `data-container-delay`.
147+
Note that the data-delay also gets copied to the smaller elements in it, which means that there is no more 'whole sentence' or 'whole word' to delay. By default, the whole element then gets the delay (depending on if it is following other animations) as defined in the `delay` option in the Configuration, but it can be overriden by an optional `data-container-delay`.
148+
149+
Also note the (optional) `baseline` class here, which makes the words appear from the baseline of the text.
141150

142151
```html
143-
<h3 class="animate__fadeInDown animate__faster"
152+
<h3 class="animate__fadeInUp animate__faster baseline"
144153
data-split="words"
145154
data-delay="80"
146155
data-container-delay="600">Let words apear and appear</h3>
@@ -150,7 +159,7 @@ Note that the data-delay also gets copied to the smaller elements in it, which m
150159
### Changing the 'appearevent'
151160
When you navigate from slide to slide, you can set transition effects in Reveal. These effects take some time. That's why, by default, Appearance only starts when the slide transition has ended.
152161

153-
There are cases however, where there is hardly any transition, for example, when going from an autoanimate slide to another. Reveal then suppresses the user-set transition to a short opacity change. Starting *together with* the transition might then be nicer. You can use any of the following events:
162+
There are cases however, where there is hardly any transition, for example, when going from an autoanimate slide to another. Reveal then suppresses the user-set transition to a short opacity change. Starting *together with* the transition might then be nicer. You can use any of the following events:
154163

155164
* *slidetransitionend* (default, Appearance will always start animating elements after the transition)
156165
* *slidechanged* (Appearance will always start together with the transition)
@@ -285,6 +294,7 @@ Reveal.initialize({
285294
appearevent: 'slidetransitionend',
286295
autoappear: false,
287296
autoelements: false,
297+
cssautoload: true,
288298
csspath: '',
289299
animatecsspath: {
290300
link : 'https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css',
@@ -302,6 +312,7 @@ Reveal.initialize({
302312
* **`appearevent`**: Use a specific event at which Appearance starts.
303313
* **`autoappear`**: Use this when you do not want to add classes to each item that you want to appear, and just let Appearance add animation classes to (all of) the provided elements in the presentation. See "Autoappear" mode above.
304314
* **`autoelements`**: These are the elements that `autoappear` will target. Each element has a selector and an animation class. If `autoappear` is off, the elements will still get animation if the section contains a `data-autoappear` attribute.
315+
* **`cssautoload`**: Appearance will load the CSS if this is set to `true`. If you import reveal.js-appearance from npm, you will need to import the CSS file yourself. If you use 'import', then csspath should be set to `false`. If you know the path to the CSS file, you can use the `csspath` option and keep cssautoload set to `true`.
305316
* **`csspath`**: Appearance will automatically load the styling of the plugin. If you want to customise the styling, you can link to your own CSS file here.
306317
* **`animatecsspath`**: Appearance will also automatically load the styling of Animate.css via a CDN. Note that Animate.css has two links, the first (CDN) one is for version 4, the second (old) one is the version 3 compatibility CDN link.
307318
* **`compatibility`**: This setting can let you use your current markup. However, because this also uses the Animate.css compatibility CSS, and it is likely that they will not support this in the future, please update your markup as shown above.

demo/assets/css/demo.css

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ p.code, p code, small code, .small code, li code {
8787
--r-main-font-size: 36px;
8888
--r-block-margin: 1.8rem;
8989
--code-full-bg: #142433;
90-
--code-rgba-bg: rgba(50, 65, 80, 0.4);
90+
--code-rgba-bg: rgba(91, 102, 112, 0.3);
9191
}
9292

9393
.reveal .slides ul li, .reveal .slides ol li {
@@ -100,6 +100,12 @@ p.code, p code, small code, .small code, li code {
100100
--r-link-color-hover: #0373bd;
101101
}
102102

103+
.demoembed {
104+
width: 768px;
105+
height: 400px;
106+
margin: 64px auto;
107+
}
108+
103109
.reveal.embedded {
104110
border: 4px solid transparent;
105111
border-radius: 8px;
@@ -111,7 +117,6 @@ p.code, p code, small code, .small code, li code {
111117
border-color: #42affa;
112118
box-shadow: 0 4px 16px rgba(5, 21, 37, 0.3);
113119
}
114-
115120
.reveal.embedded .progress {
116121
background: rgba(66, 175, 250, 0.3);
117122
font-size: 10px;
@@ -151,7 +156,7 @@ a.github-corner.bottom {
151156
margin-top: auto;
152157
top: calc(100% - 70px);
153158
}
154-
.reveal.embedded a.github-corner {
159+
.reveal.embedded a.github-corner, .reveal-viewport.reveal-scroll a.github-corner {
155160
display: none;
156161
}
157162
a.github-corner svg {

demo/demo-markdown.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
center: true,
5050
controlsTutorial: false,
5151
appearance: {
52-
debug: false,
5352
appearparents: true,
5453
hideagain: true,
5554
appearevent: 'auto',

demo/demo.html

Lines changed: 74 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,11 @@ <h3>Change the animation speed</h3><small>Use the speed classes from Animate.css
161161
&lt;img class=&quot;animate__fadeInDown animate__faster&quot; src=&quot;assets/img/5.jpg&quot;&gt;</code></pre>
162162
</section>
163163
<section>
164-
<h3>Change the settings for words or letters</h3><small>For words and letters, just set the speed and delay as described above. The smaller parts will inherit these settings. Set a <code>data-container-delay="*"</code> for a different delay for the container, compared to the standard <code>delay = 300</code> from the options. </small><br><br>
165-
<h3 class="animate__fadeInDown" data-split="words">Split into words</h3>
166-
<h3 class="animate__fadeInDown animate__faster" data-split="letters" data-delay="75" data-container-delay="800">Split into letters</h3><br>
167-
<pre><code class="hljs html" data-line-numbers>&lt;h3 class=&quot;animate__fadeInDown&quot; data-split=&quot;words&quot;&gt;Split into words&lt;/h3&gt;
168-
&lt;h3 class=&quot;animate__fadeInDown animate__faster&quot; data-split=&quot;letters&quot; data-delay=&quot;75&quot; data-container-delay=&quot;800&quot;&gt;Split into letters&lt;/h3&gt;</code></pre>
164+
<h3>Change the settings for words or letters</h3><small>For words and letters, just set the speed and delay as described above. The smaller parts will inherit these settings. Set a <code>data-container-delay="*"</code> for a different delay for the container, compared to the standard <code>delay = 300</code> from the options. Add a <code>baseline</code> class for a nice baseline effect.</small><br><br>
165+
<h3 class="animate__fadeInUp baseline" data-split="words">Split into words</h3>
166+
<h3 class="animate__fadeInUp animate__faster" data-split="letters" data-delay="75" data-container-delay="800">Split into letters</h3><br>
167+
<pre><code class="hljs html" data-line-numbers>&lt;h3 class=&quot;animate__fadeInUp baseline&quot; data-split=&quot;words&quot;&gt;Split into words&lt;/h3&gt;
168+
&lt;h3 class=&quot;animate__fadeInUp animate__faster&quot; data-split=&quot;letters&quot; data-delay=&quot;75&quot; data-container-delay=&quot;800&quot;&gt;Split into letters&lt;/h3&gt;</code></pre>
169169
</section>
170170
<section data-auto-animate>
171171
<h3>Change when Appearance starts</h3>
@@ -244,10 +244,10 @@ <h3>Local auto-appear, specified</h3><small>You can also add a JSON object to th
244244
&lt;/ul&gt;
245245
&lt;/section&gt;</code></pre>
246246
</section>
247-
<section data-autoappear="{&quot;h3&quot;: {&quot;animation&quot;:&quot;animate__fadeInDown&quot;, &quot;speed&quot;:&quot;fast&quot;, &quot;delay&quot;:&quot;180&quot;, &quot;split&quot;:&quot;words&quot;, &quot;container-delay&quot;:&quot;200ms&quot;}, &quot;h4&quot;: {&quot;animation&quot;:&quot;animate__fadeInDown&quot;, &quot;split&quot;:&quot;letters&quot;, &quot;delay&quot;:&quot;80&quot;}}">
247+
<section data-autoappear="{&quot;h3&quot;: {&quot;animation&quot;:&quot;animate__fadeInDown&quot;, &quot;speed&quot;:&quot;fast&quot;, &quot;delay&quot;:&quot;180&quot;, &quot;split&quot;:&quot;words&quot;, &quot;container-delay&quot;:&quot;200ms&quot;}, &quot;h4&quot;: {&quot;animation&quot;:&quot;animate__fadeInUp baseline&quot;, &quot;split&quot;:&quot;letters&quot;, &quot;delay&quot;:&quot;80&quot;}}">
248248
<h3>Local auto-appear, specified and split</h3><small>And you can do the same for any animations that you would like to have on lines and words.</small>
249249
<h4>Appearance</h4>
250-
<pre><code class="hljs html" data-line-numbers>&lt;section data-autoappear='{"h3": {"animation":"animate__fadeInDown", "speed":"fast", "delay":"180", "split":"words", "container-delay":"500ms"}, "h4": {"animation":"animate__fadeInDown", "split":"letters", "delay":"80"}}'&gt;
250+
<pre><code class="hljs html" data-line-numbers>&lt;section data-autoappear='{"h3": {"animation":"animate__fadeInDown", "speed":"fast", "delay":"180", "split":"words", "container-delay":"500ms"}, "h4": {"animation":"animate__fadeInUp baseline", "split":"letters", "delay":"80"}}'&gt;
251251
&lt;h3&gt;Local auto-appear, specified and split&lt;/h3&gt;
252252
&lt;h4&gt;Appearance&lt;/h4&gt;
253253
&lt;/section&gt;</code></pre>
@@ -263,6 +263,7 @@ <h2>Options</h2>
263263
<li>appearevent</li>
264264
<li>autoappear</li>
265265
<li>autoelements</li>
266+
<li>cssautoload</li>
266267
<li>csspath</li>
267268
<li>animatecsspath</li>
268269
<li>compatibility</li>
@@ -274,106 +275,118 @@ <h2>Options</h2>
274275
<h4>Option 1: hideagain</h4>
275276
<p class="small">The <code>hideagain</code> option will hide elements (that have appeared on the slide) again when moving away from that slide. </p>
276277
<pre><code class="hljs js" data-line-numbers="4">Reveal.initialize({
277-
...
278-
appearance: {
279-
hideagain: true
280-
},
281-
plugins: [ Appearance ]
278+
...
279+
appearance: {
280+
hideagain: true
281+
},
282+
plugins: [ Appearance ]
282283
})</code></pre>
283284
</section>
284285
<section>
285286
<h4>Option 2: delay</h4>
286287
<p class="small">The <code>delay</code> option is the base time in ms between appearances. This value governs any elements that do not have an Animate.css speed class assigned to it, or are not inside a slide which includes delay in a data-autoappear attribute.</p>
287288
<pre><code class="hljs js" data-line-numbers="4">Reveal.initialize({
288-
...
289-
appearance: {
290-
delay: 300
291-
},
292-
plugins: [ Appearance ]
289+
...
290+
appearance: {
291+
delay: 300
292+
},
293+
plugins: [ Appearance ]
293294
})</code></pre>
294295
</section>
295296
<section>
296297
<h4>Option 3: appearevent</h4>
297298
<p class="small">You can change when Appearance starts with any of the following events: <code>slidetransitionend</code> (default, after the transition), <code>slidechanged</code> (with the transition) and <code>auto</code> (with transition, on autoanimate slides). This can be overridden per-slide with data-attributes, like this: <code>data-appearevent="auto"</code>.</p>
298299
<pre><code class="hljs js" data-line-numbers="4">Reveal.initialize({
299-
...
300-
appearance: {
301-
appearevent: slidetransitionend
302-
},
303-
plugins: [ Appearance ]
300+
...
301+
appearance: {
302+
appearevent: slidetransitionend
303+
},
304+
plugins: [ Appearance ]
304305
})</code></pre>
305306
</section>
306307
<section>
307308
<h4>Option 4: autoappear</h4>
308309
<p class="small">The <code>autoappear</code> option works together with the <code>autoelements</code> option. When it is set to <code>true</code>, any elements in the autoelements option will animate with the declared animation when the slide or fragment opens. See <a href="#/autoappear"><code>autoappear</code></a>.</p>
309310
<pre><code class="hljs js" data-line-numbers="4,5">Reveal.initialize({
310-
...
311-
appearance: {
312-
autoappear: false,
313-
autoelements: false
314-
},
315-
plugins: [ Appearance ]
311+
...
312+
appearance: {
313+
autoappear: false,
314+
autoelements: false
315+
},
316+
plugins: [ Appearance ]
316317
})</code></pre>
317318
</section>
318319
<section>
319320
<h4>Option 5: autoelements</h4>
320321
<p class="small">These are the elements that <code>autoappear</code> will target. Each element has a selector and an animation class. If autoappear is off, the elements will still get animation if the section contains a data-autoappear attribute.</p>
321322
<pre><code class="hljs js" data-line-numbers="4,5">Reveal.initialize({
322-
...
323-
appearance: {
324-
autoappear: false,
325-
autoelements: false
326-
},
327-
plugins: [ Appearance ]
323+
...
324+
appearance: {
325+
autoappear: false,
326+
autoelements: false
327+
},
328+
plugins: [ Appearance ]
328329
})</code></pre>
329330
</section>
331+
<section class="center">
332+
<h4>Option 6: cssautoload</h4>
333+
<p>Appearance will load the CSS if this is set to <code>true</code>.</p>
334+
<pre><code class="hljs js" data-line-numbers="4">Reveal.initialize({
335+
...
336+
appearance: {
337+
cssautoload: true
338+
},
339+
plugins: [ Appearance ]
340+
})</code></pre>
341+
<p class="small">If you import reveal.js-appearance from npm, you will need to import the CSS file yourself. If you use 'import', then <code>csspath</code> should be set to <code>false</code>. If you know the path to the CSS file, you can use the <code>csspath</code> option and keep <code>cssautoload</code> set to <code>true</code>.</p>
342+
</section>
330343
<section>
331-
<h4>Option 6: csspath</h4>
344+
<h4>Option 7: csspath</h4>
332345
<p class="small">Appearance will automatically load the styling of the plugin. If you want to customise the styling, you can link to your own CSS file here.</p>
333346
<pre><code class="hljs js" data-line-numbers="4,5">Reveal.initialize({
334-
...
335-
appearance: {
336-
csspath: ''
337-
},
338-
plugins: [ Appearance ]
347+
...
348+
appearance: {
349+
csspath: ''
350+
},
351+
plugins: [ Appearance ]
339352
})</code></pre>
340353
</section>
341354
<section>
342-
<h4>Option 7: animatecsspath</h4>
355+
<h4>Option 8: animatecsspath</h4>
343356
<p class="small">Appearance will also automatically load the styling of Animate.css via a CDN. Note that Animate.css has two links, the first (CDN) one is for version 4, the second (old) one is the version 3 compatibility CDN link.</p>
344357
<pre><code class="hljs js" data-line-numbers="4-7">Reveal.initialize({
345-
...
346-
appearance: {
347-
animatecsspath: {
348-
link : 'https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css',
349-
compat : 'https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.compat.css',
350-
}
351-
},
352-
plugins: [ Appearance ]
358+
...
359+
appearance: {
360+
animatecsspath: {
361+
link : 'https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css',
362+
compat : 'https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.compat.css',
363+
}
364+
},
365+
plugins: [ Appearance ]
353366
})</code></pre>
354367
</section>
355368
<section>
356-
<h4>Option 8: compatibility</h4>
369+
<h4>Option 9: compatibility</h4>
357370
<p class="small">This setting is about the breaking changes in Animate.css (used by Appearance). See the migration guide in the Readme for more info. </p>
358371
<p class="small">Setting <code>'compatibility: true'</code> can let you use your old markup.</p>
359372
<pre><code class="hljs js" data-line-numbers="4">Reveal.initialize({
360-
...
361-
appearance: {
362-
compatibility: false
363-
},
364-
plugins: [ Appearance ]
373+
...
374+
appearance: {
375+
compatibility: false
376+
},
377+
plugins: [ Appearance ]
365378
})</code></pre>
366379
</section>
367380
<section>
368-
<h4>Option 9: compatibilitybaseclass</h4>
381+
<h4>Option 10: compatibilitybaseclass</h4>
369382
<p class="small">This setting is about the breaking changes in Animate.css (used by Appearance). See the migration guide in the Readme for more info. </p>
370383
<p class="small">This is the baseclass to use if you don't change your markup.</p>
371384
<pre><code class="hljs js" data-line-numbers="4">Reveal.initialize({
372-
...
373-
appearance: {
374-
compatibilitybaseclass: 'animated'
375-
},
376-
plugins: [ Appearance ]
385+
...
386+
appearance: {
387+
compatibilitybaseclass: 'animated'
388+
},
389+
plugins: [ Appearance ]
377390
})</code></pre>
378391
</section>
379392
</section>
@@ -411,7 +424,6 @@ <h3>Credits</h3>
411424
center: true,
412425
controlsTutorial: false,
413426
appearance: {
414-
debug: true,
415427
appearparents: true,
416428
hideagain: true,
417429
appearevent: 'auto',

demo/dist/reveal.css

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

demo/dist/reveal.esm.js

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

demo/dist/reveal.esm.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/dist/reveal.js

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

demo/dist/reveal.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)