reveal.js-appearance 1.0.7 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +55 -0
- package/LICENSE +1 -1
- package/README.md +69 -16
- package/css/demo.css +10 -0
- package/demo.html +46 -13
- package/package.json +3 -3
- package/plugin/appearance/appearance.css +264 -386
- package/plugin/appearance/appearance.esm.js +171 -6
- package/plugin/appearance/appearance.js +322 -157
- package/plugin/appearance/plugin-src.js +112 -11
- package/screenshot.png +0 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## [1.1.1] - 2021-11-27
|
|
5
|
+
### Added
|
|
6
|
+
- Added a new `autoappear` mode, for use in cases where adding animation classes is too much of a hassle, like inside Markdown.
|
|
7
|
+
- Started keeping the changelog.
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
## [1.1.0] - 2021-09-03
|
|
12
|
+
### Added
|
|
13
|
+
- Added Github corner badge
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
- Changed readme
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
## [1.0.9] - 2021-06-30
|
|
21
|
+
### Changed
|
|
22
|
+
- Fixed a bug where '=' was '=='.
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
## [1.0.8] - 2021-06-27
|
|
27
|
+
### Added
|
|
28
|
+
- Choose an event at which Appearance launches its animations
|
|
29
|
+
|
|
30
|
+
### Changed
|
|
31
|
+
- Appearance now shows the complete slides from the overview
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
## [1.0.7] - 2020-06-28
|
|
36
|
+
### Changed
|
|
37
|
+
- Clearing timeouts that are in past slides. This solves 'hanging' Appearance items if you slide back and forth.
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
## [1.0.6] - 2020-06-28
|
|
42
|
+
### Changed
|
|
43
|
+
- Fix bug that hid Appearance items in PDF exports.
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
## [1.0.5] - 2020-05-20
|
|
48
|
+
### Added
|
|
49
|
+
- Added compatibility with the new Reveal.js 4 that changes the way plugins work.
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
## [1.0.4] - 2020-05-20
|
|
54
|
+
### Added
|
|
55
|
+
- The 1.0.4 release is compatible with Reveal.js 3. Reveal versions lower than 4 have no "slidetransitionend" event, so this release also has the Transit.js plugin included (see https://github.com/Martinomagnifico/reveal.js-transit for more information).
|
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
3
|
+
Copyright (c) 2021 Martijn De Jongh (Martino)
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/README.md
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
# Appearance
|
|
2
2
|
|
|
3
|
+
[](#) [](https://github.com/Martinomagnifico/reveal.js-appearance/archive/refs/heads/master.zip)
|
|
4
|
+
|
|
3
5
|
A plugin for [Reveal.js](https://revealjs.com) 4 that adds appearance effects to elements.
|
|
4
6
|
|
|
5
|
-
[](https://martinomagnifico.github.io/reveal.js-appearance/demo.html)
|
|
7
|
+
[](https://martinomagnifico.github.io/reveal.js-appearance/demo.html)
|
|
6
8
|
|
|
7
9
|
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 in a separate CSS file to allow for a non-animated state.
|
|
8
10
|
|
|
@@ -10,13 +12,11 @@ In Powerpoint you can make slides with items that appear automatically with effe
|
|
|
10
12
|
|
|
11
13
|
We do not want the animations to start during the slide transition, so we wait for the slide transition to end. Then the animations will start automatically if the HTML is set up to use Appearance.
|
|
12
14
|
|
|
15
|
+
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.
|
|
13
16
|
|
|
14
17
|
|
|
15
|
-
## Installation
|
|
16
|
-
|
|
17
|
-
The Appearance plugin has been rewritten for Reveal.js version 4.
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
## Installation
|
|
20
20
|
|
|
21
21
|
### Regular installation
|
|
22
22
|
|
|
@@ -26,7 +26,7 @@ Copy the appearance folder to the plugins folder of the reveal.js folder, like t
|
|
|
26
26
|
|
|
27
27
|
This plugin is published to, and can be installed from, npm.
|
|
28
28
|
|
|
29
|
-
```
|
|
29
|
+
```console
|
|
30
30
|
npm install reveal.js-appearance
|
|
31
31
|
```
|
|
32
32
|
The Appearance plugin folder can then be referenced from `node_modules/reveal.js-appearance/plugin/appearance`
|
|
@@ -37,8 +37,6 @@ The Appearance plugin folder can then be referenced from `node_modules/reveal.js
|
|
|
37
37
|
|
|
38
38
|
### JavaScript
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
40
|
There are two JavaScript files for Appearance, a regular one, `appearance.js`, and a module one, `appearance.esm.js`. You only need one of them:
|
|
43
41
|
|
|
44
42
|
#### Regular
|
|
@@ -77,7 +75,7 @@ You now need to add TWO stylesheets to your presentation.
|
|
|
77
75
|
* The second file is included with Appearance. It adds to the first stylesheet to allow for a non-animated state.
|
|
78
76
|
|
|
79
77
|
```html
|
|
80
|
-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.
|
|
78
|
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css">
|
|
81
79
|
<link rel="stylesheet" href="plugin/appearance/appearance.css">
|
|
82
80
|
```
|
|
83
81
|
|
|
@@ -94,6 +92,23 @@ It is easy to set up your HTML structure for Appearance:
|
|
|
94
92
|
<li class="animated bounceInLeft">It adds some attention.</li>
|
|
95
93
|
</ul>
|
|
96
94
|
```
|
|
95
|
+
When you are working with Markdown, 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 Configuration below) and let Appearance do the heavy work. You do not need to add any markup and it will stay like this:
|
|
96
|
+
|
|
97
|
+
```html
|
|
98
|
+
<ul>
|
|
99
|
+
<li>Add it to any text element</li>
|
|
100
|
+
<li>Like list items, or headers.</li>
|
|
101
|
+
<li>It adds some attention.</li>
|
|
102
|
+
</ul>
|
|
103
|
+
```
|
|
104
|
+
or this:
|
|
105
|
+
|
|
106
|
+
```markdown
|
|
107
|
+
* Add it to any text element
|
|
108
|
+
* Like list items, or headers.
|
|
109
|
+
* It adds some attention.
|
|
110
|
+
|
|
111
|
+
```
|
|
97
112
|
|
|
98
113
|
|
|
99
114
|
## Configuration
|
|
@@ -104,20 +119,57 @@ There are a few options that you can change from the Reveal.js options. The valu
|
|
|
104
119
|
Reveal.initialize({
|
|
105
120
|
// ...
|
|
106
121
|
appearance: {
|
|
107
|
-
// The baseclass uses the baseclass from Animate.css. Change it if you like
|
|
108
122
|
baseclass: 'animated',
|
|
109
|
-
// Use a specific class for the visible state.
|
|
110
123
|
visibleclass: 'in',
|
|
111
|
-
// Change this if you want to see the shown elements if you go back
|
|
112
124
|
hideagain: true,
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
125
|
+
delay: 300,
|
|
126
|
+
appearevent: 'slidetransitionend',
|
|
127
|
+
autoappear: false,
|
|
128
|
+
autoelements: false
|
|
116
129
|
},
|
|
117
130
|
plugins: [ Appearance ]
|
|
118
131
|
});
|
|
119
132
|
```
|
|
120
133
|
|
|
134
|
+
* **`baseclass`**: The baseclass uses the baseclass from Animate.css. Change it if you like.
|
|
135
|
+
* **`visibleclass`**: Use a specific class for the visible state.
|
|
136
|
+
* **`hideagain`**: Change this (true/false) if you want to see the shown elements if you go back.
|
|
137
|
+
* **`delay`**: Base time in ms between appearances.
|
|
138
|
+
* **`appearevent`**: Use a specific event at which Appearance starts.
|
|
139
|
+
* **`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 "Using 'autoappear'" mode below.
|
|
140
|
+
* **`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.
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
### Changing the 'appearevent'
|
|
144
|
+
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.
|
|
145
|
+
|
|
146
|
+
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:
|
|
147
|
+
|
|
148
|
+
* *slidetransitionend* (default, Appearance will start animating elements after the transition)
|
|
149
|
+
* *slidechanged* (Appearance will start together with the transition)
|
|
150
|
+
* *auto* (Appearance will start together with the transition, but only on autoanimate slides, other slides will use *slidetransitionend*)
|
|
151
|
+
|
|
152
|
+
These same event triggers can be set through the data-attribute `data-appearevent`.
|
|
153
|
+
|
|
154
|
+
When using Appearance inside an autoanimate slide, and changing the appearevent to `slidechanged` or `auto`, keep in mind that Reveal transforms opacity for all non-autoanimate items, while Appearance does the same on most of the effects. To avoid strange behaviour, wrap these Appearance items in a parent. For example, a list of animated bullet points works well, because the animated class is on the children, not the parent. Separate headings or other elements do not have that, so should be wrapped.
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
### Using 'autoappear' mode
|
|
158
|
+
Sometimes (for example with Markdown), adding classes to elements is a chore. Appearance can automatically add animation classes to specific elements in the presentation.
|
|
159
|
+
|
|
160
|
+
With the option `autoappear` set to `true`, ALL elements in the presentation that have a certain selector will get an animation. These selectors and the animations can be set in the configuration options like this:
|
|
161
|
+
|
|
162
|
+
```javascript
|
|
163
|
+
autoelements: {
|
|
164
|
+
'ul li': 'fadeInLeft',
|
|
165
|
+
'ol li': 'fadeInRight'
|
|
166
|
+
}
|
|
167
|
+
```
|
|
168
|
+
You can add any selector and animation class to this object.
|
|
169
|
+
|
|
170
|
+
With the option `autoappear` set to `false`, the above still works, but only on a data-attribute basis. ONLY elements in the presentation that are inside sections or fragments with a data-attribute of `data-autoappear` will be animated automatically.
|
|
171
|
+
|
|
172
|
+
|
|
121
173
|
|
|
122
174
|
## Now change it
|
|
123
175
|
|
|
@@ -129,6 +181,7 @@ It is easy to change the effects for Appearance. Here's how to change the delay
|
|
|
129
181
|
<img class="animated fadeInDown" data-src="3.jpg" data-delay="120">
|
|
130
182
|
```
|
|
131
183
|
or the speed of each animation, using the tempo classes from Animate.css:
|
|
184
|
+
|
|
132
185
|
```html
|
|
133
186
|
<img class="animated fadeInDown slower" data-src="1.jpg">
|
|
134
187
|
<img class="animated fadeInDown slow" data-src="2.jpg">
|
|
@@ -145,4 +198,4 @@ And if you want to show off what you made with it, please do :-)
|
|
|
145
198
|
## License
|
|
146
199
|
MIT licensed
|
|
147
200
|
|
|
148
|
-
Copyright (C)
|
|
201
|
+
Copyright (C) 2021 Martijn De Jongh (Martino)
|
package/css/demo.css
CHANGED
package/demo.html
CHANGED
|
@@ -8,23 +8,26 @@
|
|
|
8
8
|
<meta name="author" content="Martinomagnifico">
|
|
9
9
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
|
10
10
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
11
|
-
<link rel="stylesheet" href="
|
|
12
|
-
<link rel="stylesheet" href="
|
|
13
|
-
<link rel="stylesheet" href="
|
|
11
|
+
<link rel="stylesheet" href="../dist/reset.css">
|
|
12
|
+
<link rel="stylesheet" href="../dist/reveal.css">
|
|
13
|
+
<link rel="stylesheet" href="../dist/theme/black.css">
|
|
14
14
|
<link rel="stylesheet" href="css/demo.css">
|
|
15
|
-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.
|
|
15
|
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css">
|
|
16
16
|
<link rel="stylesheet" href="plugin/appearance/appearance.css">
|
|
17
17
|
</head>
|
|
18
18
|
|
|
19
19
|
<body>
|
|
20
|
-
<div class="reveal">
|
|
20
|
+
<div class="reveal"><a class="github-corner" href="https://github.com/Martinomagnifico/reveal.js-appearance" target="blank" title="View source on GitHub">
|
|
21
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 55 55">
|
|
22
|
+
<path fill="currentColor" d="M27.5 11.2a16.3 16.3 0 0 0-5.1 31.7c.8.2 1.1-.3 1.1-.7v-2.8c-4.5 1-5.5-2.2-5.5-2.2-.7-1.9-1.8-2.4-1.8-2.4-1.5-1 .1-1 .1-1 1.6.1 2.5 1.7 2.5 1.7 1.5 2.5 3.8 1.8 4.7 1.4.2-1 .6-1.8 1-2.2-3.5-.4-7.3-1.8-7.3-8 0-1.8.6-3.3 1.6-4.4-.1-.5-.7-2.1.2-4.4 0 0 1.4-.4 4.5 1.7a15.6 15.6 0 0 1 8.1 0c3.1-2 4.5-1.7 4.5-1.7.9 2.3.3 4 .2 4.4 1 1 1.6 2.6 1.6 4.3 0 6.3-3.8 7.7-7.4 8 .6.6 1.1 1.6 1.1 3v4.6c0 .4.3.9 1.1.7a16.3 16.3 0 0 0-5.2-31.7"></path>
|
|
23
|
+
</svg></a>
|
|
21
24
|
<div class="slides">
|
|
22
25
|
<section class="center">
|
|
23
26
|
<h1 class="animated flipInX slow">Appearance</h1>
|
|
24
27
|
<h3 class="animated flipInX slow" data-delay="700">for Reveal.js</h3>
|
|
25
28
|
</section>
|
|
26
|
-
<section class="center"><small>In Powerpoint you can make slides with items that appear automatically with effects.
|
|
27
|
-
<p>Let's check out what
|
|
29
|
+
<section class="center"><small>In Powerpoint you can make slides with items that appear automatically with effects. Appearance is a plugin for Reveal.js that does the same. </small><small>Appearance is easy to set up. It uses Animate.css by Daniel Eden for the animations, with some changes in a separate CSS file to allow for a non-animated state. </small>
|
|
30
|
+
<p>Let's check out what Appearance does:</p>
|
|
28
31
|
</section>
|
|
29
32
|
<section class="center">
|
|
30
33
|
<h3>Let text appear</h3>
|
|
@@ -70,9 +73,32 @@
|
|
|
70
73
|
<div class="padded"><img class="animated fadeInDown" data-src="img/5.jpg"></div>
|
|
71
74
|
</div>
|
|
72
75
|
</section>
|
|
76
|
+
<section class="center" data-auto-animate>
|
|
77
|
+
<h3>Change when Appearance starts</h3>
|
|
78
|
+
</section>
|
|
79
|
+
<section class="center" data-auto-animate data-appearevent="auto">
|
|
80
|
+
<h3>Change when Appearance starts</h3>
|
|
81
|
+
<div>
|
|
82
|
+
<p class="animated fadeInUp">You can use any of the following events:</p>
|
|
83
|
+
</div>
|
|
84
|
+
<ul>
|
|
85
|
+
<li class="animated fadeInLeft"><em>slidetransitionend</em> (default, after the transition)</li>
|
|
86
|
+
<li class="animated fadeInLeft"><em>slidechanged</em> (with the transition)</li>
|
|
87
|
+
<li class="animated fadeInLeft"><em>auto</em> (with transition, on autoanimate slides)</li>
|
|
88
|
+
</ul>
|
|
89
|
+
<div><br><small class="animated fadeInUp">This can also be set per-slide with data-attributes.</small></div>
|
|
90
|
+
</section>
|
|
91
|
+
</section>
|
|
92
|
+
<section class="center" data-transition="convex-in fade-out" data-autoappear>
|
|
93
|
+
<h3>Autoappear mode</h3><small>Sometimes (for example with Markdown), adding classes to elements is a chore. Appearance can automatically add animation classes to specific elements in the presentation (with the option <code>autoappear</code>) or per slide (with <code>data-autoappear</code>).</small>
|
|
94
|
+
<ul>
|
|
95
|
+
<li>This is list item 1</li>
|
|
96
|
+
<li>This is list item 2</li>
|
|
97
|
+
<li>This is list item 3</li>
|
|
98
|
+
</ul>
|
|
73
99
|
</section>
|
|
74
100
|
<section class="center" data-transition="convex-in fade-out">
|
|
75
|
-
<h3>Additional animations
|
|
101
|
+
<h3>Additional animations</h3>
|
|
76
102
|
<ul>
|
|
77
103
|
<li class="animated skidLeft" data-delay="300">Appear with .skidLeft</li>
|
|
78
104
|
<li class="animated skidLeftBig" data-delay="1000">Appear with .skidLeftBig</li>
|
|
@@ -85,14 +111,14 @@
|
|
|
85
111
|
<section class="center" data-transition="fade-in">
|
|
86
112
|
<h3>Thanks</h3>
|
|
87
113
|
<ul>
|
|
88
|
-
<li class="animated
|
|
89
|
-
<li class="animated
|
|
90
|
-
<li class="animated
|
|
114
|
+
<li class="animated fadeInLeft">Hakim El Hattab for <a href="https://revealjs.com" target="_blank">Reveal.js</a></li>
|
|
115
|
+
<li class="animated fadeInLeft">Daniel Eden for <a href="https://daneden.github.io/animate.css/" target="_blank">Animate.css</a></li>
|
|
116
|
+
<li class="animated fadeInLeft">David Marby & Nijiko Yonskai for <a href="https://picsum.photos" target="_blank">picsum.photos</a></li>
|
|
91
117
|
</ul>
|
|
92
118
|
</section>
|
|
93
119
|
</div>
|
|
94
120
|
</div>
|
|
95
|
-
<script src="
|
|
121
|
+
<script src="../dist/reveal.js"></script>
|
|
96
122
|
<script src="plugin/appearance/appearance.js"></script>
|
|
97
123
|
<script>
|
|
98
124
|
Reveal.initialize({
|
|
@@ -102,7 +128,14 @@
|
|
|
102
128
|
baseclass: "animated",
|
|
103
129
|
visibleclass: "in",
|
|
104
130
|
hideagain: true,
|
|
105
|
-
delay: 300
|
|
131
|
+
delay: 300,
|
|
132
|
+
appearevent: "slidetransitionend",
|
|
133
|
+
debug: true,
|
|
134
|
+
autoappear: false,
|
|
135
|
+
autoelements: {
|
|
136
|
+
"ul li": "fadeInLeft",
|
|
137
|
+
"ol li": "fadeInLeftRight"
|
|
138
|
+
}
|
|
106
139
|
},
|
|
107
140
|
plugins: [
|
|
108
141
|
Appearance
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reveal.js-appearance",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "A plugin for Reveal.js
|
|
3
|
+
"version": "1.1.1",
|
|
4
|
+
"description": "A plugin for Reveal.js that adds appearance effects to elements",
|
|
5
5
|
"keywords": "reveal, reveal.js, reveal-plugin, plugin, text effects",
|
|
6
6
|
"homepage": "https://github.com/Martinomagnifico/reveal.js-appearance",
|
|
7
7
|
"repository": {
|
|
@@ -12,5 +12,5 @@
|
|
|
12
12
|
"reveal.js": "^4.0"
|
|
13
13
|
},
|
|
14
14
|
"author": "Martijn De Jongh",
|
|
15
|
-
"license": "MIT, Copyright (C)
|
|
15
|
+
"license": "MIT, Copyright (C) 2021 Martijn De Jongh"
|
|
16
16
|
}
|