You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### 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
Copy file name to clipboardExpand all lines: README.md
+45-12Lines changed: 45 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,18 +4,16 @@
4
4
5
5
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.
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.
The animations will start automatically after or at each slide or fragment change if the HTML is set up to use Appearance.
15
15
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.
19
17
20
18
21
19
## Basics
@@ -79,7 +77,7 @@ If you're using ES modules, you can add it like this:
79
77
```
80
78
81
79
### 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.
83
81
84
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.
85
83
@@ -99,6 +97,15 @@ It is easy to set up your HTML structure for Appearance. Each element that you w
99
97
100
98
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.
101
99
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
+
<h3class="animate__fadeInDown"data-split="words">Let words apear and appear</h3>
106
+
<h3class="animate__fadeInDown"data-split="letters">Let letters apear and appear</h3>
107
+
```
108
+
102
109
103
110
## Now change it
104
111
@@ -125,6 +132,21 @@ You can change the speed of each animation, using the tempo classes from Animate
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
+
<h3class="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
+
128
150
### Changing the 'appearevent'
129
151
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.
130
152
@@ -174,9 +196,17 @@ Reveal.initialize({
174
196
});
175
197
```
176
198
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
178
206
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:
180
210
181
211
```html
182
212
<ul>
@@ -227,10 +257,13 @@ Reveal.initialize({
227
257
228
258
### Local auto-appear, specified
229
259
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.
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.
282
315
283
316
You have two options to migrate to the new version:
0 commit comments