Skip to content

Commit fe1381c

Browse files
author
Martino
committed
Version 1.0.8
• Add the option to choose the event for Appearance. • Show the complete slides from the overview
1 parent 17ae5b4 commit fe1381c

File tree

8 files changed

+545
-426
lines changed

8 files changed

+545
-426
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020 Martijn De Jongh (Martino)
3+
Copyright (c) 2021 Martijn De Jongh (Martino)
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ You now need to add TWO stylesheets to your presentation.
7777
* The second file is included with Appearance. It adds to the first stylesheet to allow for a non-animated state.
7878

7979
```html
80-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.0.0/animate.min.css">
80+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css">
8181
<link rel="stylesheet" href="plugin/appearance/appearance.css">
8282
```
8383

@@ -104,20 +104,36 @@ There are a few options that you can change from the Reveal.js options. The valu
104104
Reveal.initialize({
105105
// ...
106106
appearance: {
107-
// The baseclass uses the baseclass from Animate.css. Change it if you like
108107
baseclass: 'animated',
109-
// Use a specific class for the visible state.
110108
visibleclass: 'in',
111-
// Change this if you want to see the shown elements if you go back
112109
hideagain: true,
113-
// Base time between appearances
114-
delay: 300
115-
110+
delay: 300,
111+
appearevent: 'slidetransitionend'
116112
},
117113
plugins: [ Appearance ]
118114
});
119115
```
120116

117+
* **`baseclass`**: The baseclass uses the baseclass from Animate.css. Change it if you like.
118+
* **`visibleclass`**: Use a specific class for the visible state.
119+
* **`hideagain`**: Change this (true/false) if you want to see the shown elements if you go back.
120+
* **`delay`**: Base time in ms between appearances.
121+
* **`appearevent`**: Use a specific event at which Appearance starts.
122+
123+
### Changing the 'appearevent'
124+
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.
125+
126+
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:
127+
128+
* *slidetransitionend* (default, Appearance will start animating elements after the transition)
129+
* *slidechanged* (Appearance will start together with the transition)
130+
* *auto* (Appearance will start together with the transition, but only on autoanimate slides, other slides will use *slidetransitionend*)
131+
132+
These same event triggers can be set through the data-attribute `data-appearevent`.
133+
134+
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.
135+
136+
121137

122138
## Now change it
123139

@@ -129,6 +145,7 @@ It is easy to change the effects for Appearance. Here's how to change the delay
129145
<img class="animated fadeInDown" data-src="3.jpg" data-delay="120">
130146
```
131147
or the speed of each animation, using the tempo classes from Animate.css:
148+
132149
```html
133150
<img class="animated fadeInDown slower" data-src="1.jpg">
134151
<img class="animated fadeInDown slow" data-src="2.jpg">
@@ -145,4 +162,4 @@ And if you want to show off what you made with it, please do :-)
145162
## License
146163
MIT licensed
147164

148-
Copyright (C) 2020 Martijn De Jongh (Martino)
165+
Copyright (C) 2021 Martijn De Jongh (Martino)

demo.html

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/reveal.js/dist/reveal.css">
1313
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/reveal.js/dist/theme/black.css">
1414
<link rel="stylesheet" href="css/demo.css">
15-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.0.0/animate.min.css">
15+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css">
1616
<link rel="stylesheet" href="plugin/appearance/appearance.css">
1717
</head>
1818

@@ -70,6 +70,23 @@ <h3>Inside fragments</h3>
7070
<div class="padded"><img class="animated fadeInDown" data-src="img/5.jpg"></div>
7171
</div>
7272
</section>
73+
<section class="center" data-auto-animate>
74+
<h3>Set the event for Appearance</h3>
75+
</section>
76+
<section class="center" data-auto-animate>
77+
<h3>Set the event for Appearance</h3>
78+
<div>
79+
<p class="animated fadeInUp">You can use any of the following events:</p>
80+
</div>
81+
<ul>
82+
<li class="animated bounceInLeft"><em>slidetransitionend</em> (default, after the transition)</li>
83+
<li class="animated bounceInLeft"><em>slidechanged</em> (with the transition)</li>
84+
<li class="animated bounceInLeft"><em>auto</em> (with transition, on autoanimate slides)</li>
85+
</ul>
86+
<div>
87+
<p class="animated fadeInUp">This can also be set per-slide with data-attributes</p><small class="animated fadeInUp">Reveal forces opacity changes on unmatched autoanimate items, while Appearance does the same. To avoid getting animation stutter, make sure that your Appearance items are nested in a parent that does not use an animation class.</small>
88+
</div>
89+
</section>
7390
</section>
7491
<section class="center" data-transition="convex-in fade-out">
7592
<h3>Additional animations:</h3>
@@ -98,12 +115,6 @@ <h3>Thanks</h3>
98115
Reveal.initialize({
99116
transition: "convex",
100117
history: true,
101-
appearance: {
102-
baseclass: "animated",
103-
visibleclass: "in",
104-
hideagain: true,
105-
delay: 300
106-
},
107118
plugins: [
108119
Appearance
109120
]

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "reveal.js-appearance",
3-
"version": "1.0.7",
3+
"version": "1.0.8",
44
"description": "A plugin for Reveal.js 4 that adds appearance effects to elements",
55
"keywords": "reveal, reveal.js, reveal-plugin, plugin, text effects",
66
"homepage": "https://github.com/Martinomagnifico/reveal.js-appearance",
@@ -12,5 +12,5 @@
1212
"reveal.js": "^4.0"
1313
},
1414
"author": "Martijn De Jongh",
15-
"license": "MIT, Copyright (C) 2020 Martijn De Jongh"
15+
"license": "MIT, Copyright (C) 2021 Martijn De Jongh"
1616
}

0 commit comments

Comments
 (0)