reveal.js-appearance 1.1.3 → 1.2.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 +16 -0
- package/LICENSE +1 -1
- package/README.md +141 -52
- package/css/demo.css +106 -4
- package/demo-markdown.html +62 -0
- package/demo.html +312 -92
- package/img/5.jpg +0 -0
- package/markdown.md +156 -0
- package/package.json +7 -2
- package/plugin/appearance/appearance.css +32 -4
- package/plugin/appearance/appearance.esm.js +259 -162
- package/plugin/appearance/appearance.js +487 -390
- package/plugin/appearance/plugin-src.js +225 -34
- package/screenshot.png +0 -0
package/markdown.md
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
# Appearance <!-- .element: class="animate__flipInX slow" -->
|
|
2
|
+
### for Reveal.js <!-- .element: class="animate__flipInX slow" -->
|
|
3
|
+
|
|
4
|
+
Using Markdown <!-- .element: class="animate__flipInX slow" -->
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Why?
|
|
9
|
+
|
|
10
|
+
----
|
|
11
|
+
|
|
12
|
+
In Powerpoint you can make slides with items that appear automatically and sequentially with effects. Appearance is a plugin for Reveal.js that does the same.
|
|
13
|
+
|
|
14
|
+
Appearance is easy to set up. It uses [Animate.css](https://animate.style) by Daniel Eden for the animations, with some changes to allow for a non-animated state.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Examples
|
|
19
|
+
Let's check out what Appearance does:
|
|
20
|
+
|
|
21
|
+
----
|
|
22
|
+
|
|
23
|
+
## Let text appear
|
|
24
|
+
|
|
25
|
+
* Add it to any text element <!-- .element: class="animate__bounceInLeft" -->
|
|
26
|
+
* Like list items, or headers. <!-- .element: class="animate__bounceInLeft" -->
|
|
27
|
+
* It adds some impact. <!-- .element: class="animate__bounceInLeft" -->
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
```html []
|
|
31
|
+
* Add it to any text element <!-- .element: class="animate__bounceInLeft" -->
|
|
32
|
+
* Like list items, or headers. <!-- .element: class="animate__bounceInLeft" -->
|
|
33
|
+
* It adds some impact. <!-- .element: class="animate__bounceInLeft" -->
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
----
|
|
37
|
+
|
|
38
|
+
## Let images appear
|
|
39
|
+
|
|
40
|
+
 <!-- .element: class="animate__flipInX demoimg" -->
|
|
41
|
+
 <!-- .element: class="animate__flipInX demoimg" -->
|
|
42
|
+
 <!-- .element: class="animate__flipInX demoimg" -->
|
|
43
|
+
 <!-- .element: class="animate__flipInX demoimg" -->
|
|
44
|
+
 <!-- .element: class="animate__flipInX demoimg" -->
|
|
45
|
+
|
|
46
|
+
```html []
|
|
47
|
+
 <!-- .element: class="animate__flipInX demoimg" -->
|
|
48
|
+
 <!-- .element: class="animate__flipInX demoimg" -->
|
|
49
|
+
 <!-- .element: class="animate__flipInX demoimg" -->
|
|
50
|
+
 <!-- .element: class="animate__flipInX demoimg" -->
|
|
51
|
+
 <!-- .element: class="animate__flipInX demoimg" -->
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
----
|
|
55
|
+
|
|
56
|
+
## Inside fragments
|
|
57
|
+
|
|
58
|
+
Like this *(click next)<!-- .element: class="animate__fadeInDown animate__faster" -->*:
|
|
59
|
+
<!-- .element: class="animate__fadeInDown" -->
|
|
60
|
+
|
|
61
|
+
 <!-- .element: class="animate__flipInX demoimg" -->
|
|
62
|
+
 <!-- .element: class="animate__flipInX demoimg" -->
|
|
63
|
+
 <!-- .element: class="animate__flipInX demoimg" -->
|
|
64
|
+
 <!-- .element: class="animate__flipInX demoimg" -->
|
|
65
|
+
 <!-- .element: class="animate__flipInX demoimg" -->
|
|
66
|
+
<!-- .element: class="fragment" -->
|
|
67
|
+
|
|
68
|
+
```html []
|
|
69
|
+
 <!-- .element: class="animate__flipInX demoimg" -->
|
|
70
|
+
 <!-- .element: class="animate__flipInX demoimg" -->
|
|
71
|
+
 <!-- .element: class="animate__flipInX demoimg" -->
|
|
72
|
+
 <!-- .element: class="animate__flipInX demoimg" -->
|
|
73
|
+
 <!-- .element: class="animate__flipInX demoimg" -->
|
|
74
|
+
<!-- .element: class="fragment" -->
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Auto-appear
|
|
80
|
+
You can simplify the addition of animation classes:
|
|
81
|
+
|
|
82
|
+
----
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
Sometimes (for example with Markdown), adding classes to elements is a chore.
|
|
86
|
+
|
|
87
|
+
Appearance can automatically add animation classes to specific elements (tags or other selectors) in the presentation (with the option `autoappear`) or per slide (with `data-autoappear`).
|
|
88
|
+
|
|
89
|
+
----
|
|
90
|
+
|
|
91
|
+
### Global auto-appear mode
|
|
92
|
+
* This is list item 1
|
|
93
|
+
* This is list item 2
|
|
94
|
+
|
|
95
|
+
```html []
|
|
96
|
+
### Global auto-appear mode
|
|
97
|
+
* This is list item 1
|
|
98
|
+
* This is list item 2
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
```html []
|
|
102
|
+
<script>
|
|
103
|
+
//...
|
|
104
|
+
appearance: {
|
|
105
|
+
autoappear: true,
|
|
106
|
+
autoelements: {'ul li': 'animate__fadeInLeft'}
|
|
107
|
+
},
|
|
108
|
+
plugins: [ RevealMarkdown, Appearance ]
|
|
109
|
+
</script>
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
This shows how to globally set elements to appear.<!-- .element: class="small" -->
|
|
113
|
+
|
|
114
|
+
----
|
|
115
|
+
|
|
116
|
+
### Local auto-appear
|
|
117
|
+
<!-- .slide: data-autoappear="true" -->
|
|
118
|
+
* This is list item 1
|
|
119
|
+
* This is list item 2
|
|
120
|
+
|
|
121
|
+
```html []
|
|
122
|
+
<!-- .slide: data-autoappear="true" -->
|
|
123
|
+
### Local auto-appear
|
|
124
|
+
* This is list item 1
|
|
125
|
+
* This is list item 2
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
```html []
|
|
129
|
+
<script>
|
|
130
|
+
//...
|
|
131
|
+
appearance: {
|
|
132
|
+
autoappear: false,
|
|
133
|
+
autoelements: {'ul li': 'animate__fadeInLeft'}
|
|
134
|
+
},
|
|
135
|
+
plugins: [ RevealMarkdown, Appearance ]
|
|
136
|
+
</script>
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Local auto-appear uses a data-attribute per slide.<!-- .element: class="small" -->
|
|
140
|
+
|
|
141
|
+
----
|
|
142
|
+
|
|
143
|
+
<!-- .slide: data-autoappear="{'ul li':'animate__fadeInRight','h3':['animate__fadeInDown, animate__slow','100ms']}" -->
|
|
144
|
+
### Local auto-appear, specified
|
|
145
|
+
|
|
146
|
+
You can also add a JSON object to the slide’s auto-appear data-attribute, with specific elements, their animations class/classes and optional delay.<!-- .element: class="small" -->
|
|
147
|
+
|
|
148
|
+
* This is list item 1
|
|
149
|
+
* This is list item 2
|
|
150
|
+
|
|
151
|
+
```html []
|
|
152
|
+
<!-- .slide: data-autoappear="{'ul li':'animate__fadeInRight','h3':['animate__fadeInDown, animate__slow','100ms']}" -->
|
|
153
|
+
### Local auto-appear, specified
|
|
154
|
+
* This is list item 1
|
|
155
|
+
* This is list item 2
|
|
156
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reveal.js-appearance",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
|
+
"main": "plugin/appearance/appearance.js",
|
|
5
|
+
"module": "plugin/appearance/appearance.esm.js",
|
|
4
6
|
"description": "An animation plugin for Reveal.js that animates elements sequentially like in Powerpoint. Perfect for online portfolios or other presentations with images.",
|
|
5
7
|
"keywords": "reveal, reveal.js, reveal-plugin, plugin, text effects, powerpoint",
|
|
6
8
|
"homepage": "https://github.com/Martinomagnifico/reveal.js-appearance",
|
|
@@ -9,8 +11,11 @@
|
|
|
9
11
|
"url": "https://github.com/Martinomagnifico/reveal.js-appearance.git"
|
|
10
12
|
},
|
|
11
13
|
"author": "Martijn De Jongh",
|
|
12
|
-
"license": "MIT, Copyright (C)
|
|
14
|
+
"license": "MIT, Copyright (C) 2023 Martijn De Jongh",
|
|
13
15
|
"peerDependencies": {
|
|
14
16
|
"reveal.js": "^4.2"
|
|
17
|
+
},
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"animate.css": "^4.1.1"
|
|
15
20
|
}
|
|
16
21
|
}
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
****************************************************************
|
|
3
|
+
* @author: Martijn De Jongh (Martino), martijn.de.jongh@gmail.com
|
|
4
|
+
* https://github.com/Martinomagnifico
|
|
5
|
+
*
|
|
6
|
+
* Appearance.js for Reveal.js
|
|
7
|
+
* Version 1.2.0
|
|
8
|
+
*
|
|
9
|
+
* @license
|
|
10
|
+
* MIT licensed
|
|
11
|
+
*
|
|
12
|
+
* Thanks to:
|
|
13
|
+
* - Hakim El Hattab, Reveal.js
|
|
14
|
+
* - Daniel Eden, Animate.css
|
|
15
|
+
*****************************************************************
|
|
16
|
+
*/
|
|
1
17
|
/* Animate.css overrides */
|
|
2
18
|
section:not(.stack):not([data-appearance-can-start]) .animate__animated, section:not(.stack):not([data-appearance-can-start]) .animated {
|
|
3
19
|
opacity: 0;
|
|
@@ -11,7 +27,7 @@ section:not(.stack):not([data-appearance-can-start]) .animate__animated, section
|
|
|
11
27
|
opacity: 1;
|
|
12
28
|
}
|
|
13
29
|
|
|
14
|
-
.fragment:not(.visible) .animate__animated, .fragment:not(.visible) .animated {
|
|
30
|
+
.fragment:not(.visible) .animate__animated, .fragment:not(.visible) .animated, .fragment:not(.visible).animate__animated, .fragment:not(.visible).animated {
|
|
15
31
|
opacity: 0;
|
|
16
32
|
-webkit-animation: none;
|
|
17
33
|
animation: none;
|
|
@@ -288,10 +304,22 @@ span.animate__animated, span.animated {
|
|
|
288
304
|
animation-duration: calc(var(--animate-duration) * 3);
|
|
289
305
|
}
|
|
290
306
|
|
|
291
|
-
.print-pdf
|
|
292
|
-
|
|
307
|
+
.print-pdf .animated, .print-pdf .animate__animated,
|
|
308
|
+
.print-pdf section:not(.stack):not([data-appearance-can-start]) .animated,
|
|
309
|
+
.print-pdf section:not(.stack):not([data-appearance-can-start]) .animate__animated {
|
|
310
|
+
opacity: 1;
|
|
311
|
+
visibility: visible;
|
|
312
|
+
-webkit-animation: none;
|
|
313
|
+
animation: none;
|
|
293
314
|
}
|
|
294
|
-
.print-pdf .
|
|
315
|
+
.print-pdf .reveal .fragment {
|
|
316
|
+
opacity: 1;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
.reveal.sv .animated, .reveal.sv .animate__animated,
|
|
320
|
+
.reveal.sv section:not(.stack):not([data-appearance-can-start]) .animated,
|
|
321
|
+
.reveal.sv section:not(.stack):not([data-appearance-can-start]) .animate__animated {
|
|
322
|
+
opacity: 1;
|
|
295
323
|
visibility: visible;
|
|
296
324
|
-webkit-animation: none;
|
|
297
325
|
animation: none;
|