Skip to content

Commit 55e9a5c

Browse files
Version 1.3.0
### Added - Added word and character appearances ### Changed - The plugin is totally refactored and uses a promise. - Fix for fragments as Appearance items - Another fix for hidden items in speaker view
1 parent e39dda7 commit 55e9a5c

File tree

130 files changed

+31962
-2316
lines changed

Some content is hidden

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

130 files changed

+31962
-2316
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules/

.npmignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
node_modules/
2+
demo/
3+
src/
4+
5+
.git
6+
.gitignore
7+
.npmignore
8+
gulpfile.js
9+
screenshot.png

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Changelog
22

3+
## [1.3.0] - 2023-10-25
4+
### Added
5+
- Added word and character appearances
6+
7+
### Changed
8+
- The plugin is totally refactored and uses a promise.
9+
- Fix for fragments as Appearance items
10+
- Another fix for hidden items in speaker view
11+
12+
313
## [1.2.1] - 2023-07-22
414
### Added
515
- Fix for hidden items in print and speaker view

README.md

Lines changed: 45 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,16 @@
44

55
An animation plugin for [Reveal.js](https://revealjs.com) that animates elements sequentially like in Powerpoint. Perfect for online portfolios or other presentations with images.
66

7-
[<img src="https://martinomagnifico.github.io/reveal.js-appearance/screenshot.png" width="100%">](https://martinomagnifico.github.io/reveal.js-appearance/demo.html)
7+
[<img src="https://martinomagnifico.github.io/reveal.js-appearance/screenshot.png" width="100%">](https://martinomagnifico.github.io/reveal.js-appearance/demo/demo.html)
88

99
In Powerpoint you can make slides with items that appear automatically with effects. This plugin for Reveal.js tries to achieve the same result. It's easy to set up. It uses Animate.css by Daniel Eden for the animations, with some changes to allow for a non-animated state.
1010

11-
* [Demo](https://martinomagnifico.github.io/reveal.js-appearance/demo.html)
12-
* [Markdown demo](https://martinomagnifico.github.io/reveal.js-appearance/demo-markdown.html)
11+
* [Demo](https://martinomagnifico.github.io/reveal.js-appearance/demo/demo.html)
12+
* [Markdown demo](https://martinomagnifico.github.io/reveal.js-appearance/demo/demo-markdown.html)
1313

1414
The animations will start automatically after or at each slide or fragment change if the HTML is set up to use Appearance.
1515

16-
Version 1.1.1 adds an `autoappear` mode for use in cases where adding animation classes is too much of a hassle, like inside Markdown.
17-
18-
Appearance v1.1.2 brought some **breaking changes**, please refer to the [migration guide](#migration-guide) before updating from v1.1.1 and under. It also changed the internal delay mechanism to use CSS animation delay in combination to adding the trigger on the parent, not each animated element. This will improve the performance.
16+
Version 1.3.0 adds an option to animate the words in a sentence, or the letters in a word.
1917

2018

2119
## Basics
@@ -79,7 +77,7 @@ If you're using ES modules, you can add it like this:
7977
```
8078

8179
### Styling
82-
Since version 1.1.2, 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, 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.
8381

8482
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.
8583

@@ -99,6 +97,15 @@ It is easy to set up your HTML structure for Appearance. Each element that you w
9997

10098
When you are working with Markdown (or in any other case), this can be a chore **so if you do not want to add all these classes**, you can set the option `autoappear` to `true` (see [Autoappear](#autoappear) below) and let Appearance do the heavy work.
10199

100+
#### Animating words and letters
101+
102+
To nicely animate the words in a heading, or the letters of a word, add an animation class to it, and add a data-attribute for the kind of split you want:
103+
104+
```html
105+
<h3 class="animate__fadeInDown" data-split="words">Let words apear and appear</h3>
106+
<h3 class="animate__fadeInDown" data-split="letters">Let letters apear and appear</h3>
107+
```
108+
102109

103110
## Now change it
104111

@@ -125,6 +132,21 @@ You can change the speed of each animation, using the tempo classes from Animate
125132
<img class="animate__fadeInDown animate__faster" data-src="4.jpg">
126133
```
127134

135+
136+
### Changing word and letter animations
137+
138+
For words and letters, the same techniques can be used.
139+
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`.
141+
142+
```html
143+
<h3 class="animate__fadeInDown animate__faster"
144+
data-split="words"
145+
data-delay="80"
146+
data-container-delay="600">Let words apear and appear</h3>
147+
```
148+
149+
128150
### Changing the 'appearevent'
129151
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.
130152

@@ -174,9 +196,17 @@ Reveal.initialize({
174196
});
175197
```
176198

177-
You can add any selector and animation class to this object.
199+
You can add any selector and animation class to this object. You can use a simple JSON object, or more elaborate like this (you can also mix them): `{"ul li": {"animation":"animate__fadeInLeft", "speed":"slow", "delay":"100"}}`. An object like that can contain the following keys:
200+
201+
* animation
202+
* speed
203+
* delay
204+
* split
205+
* container-delay
178206

179-
Now you do not need to add any classes to the markup and it will stay like this:
207+
where the last two keys are specific for word- and letter-animations.
208+
209+
If you choose to write all your animation selectors and properties globally, you no longer need to add any classes to the markup and it can stay like this:
180210

181211
```html
182212
<ul>
@@ -227,10 +257,13 @@ Reveal.initialize({
227257

228258
### Local auto-appear, specified
229259

230-
You can also add a JSON object to the slide’s `data-autoappear`, with specific elements, their animations class as a string or an array with animations class, optional speed class and delay.
260+
You can also add a JSON object to the slide’s `data-autoappear`, with specific elements, their animations class(es) as a string or an object with animations class(es), optional speed and optional delay.
261+
262+
In the example below you can see that mixing strings and objects is perfectly fine. The `ul li` has a simple string for only the animation class(es) while the `h3` uses an object with keys.
231263

232264
```html
233-
<section data-autoappear='{"ul li":"animate__fadeInRight","h3":["animate__fadeInDown, animate__slow","100ms"]}'>
265+
<section data-autoappear='{"ul li":"animate__fadeInRight",
266+
"h3": {"animation":"animate__fadeInDown", "speed":"slow", "delay":"100"}}'>
234267
<h3>Local auto-appear, specified</h3>
235268
<ul>
236269
<li>This is list item 1</li>
@@ -278,7 +311,7 @@ Reveal.initialize({
278311

279312

280313
## Migration guide
281-
Appearance v1.1.2 is an update to stay current with the latest version of Animate.css, which itself brought breaking changes in version 4. Animate.css v4 added a prefix for all of the Animate.css classes, defaulting to `animate__` . Appearance will now automatically add the Animate.css base class (`animate__animated`) to any element with a Animate.css animation class.
314+
Appearance v1.1.2 was an update to stay current with the latest version of Animate.css, which itself brought breaking changes in version 4. Animate.css v4 added a prefix for all of the Animate.css classes, defaulting to `animate__` . Appearance will now automatically add the Animate.css base class (`animate__animated`) to any element with a Animate.css animation class.
282315

283316
You have two options to migrate to the new version:
284317

css/demo.css

Lines changed: 0 additions & 187 deletions
This file was deleted.

demo-markdown.html

Lines changed: 0 additions & 62 deletions
This file was deleted.

0 commit comments

Comments
 (0)