Skip to content

Commit f7ffc10

Browse files
author
Marcin Szczepanski
committed
Initial simple README
1 parent 68b0477 commit f7ffc10

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Simple Gallery Plugin for reveal.js
2+
3+
I wanted to show a small gallery inside a reveal.js presentation (slideshow within a slideshow - Inception!). This is a simple plugin that takes a list of images and converts it to an auto-advancing slideshow.
4+
5+
## Installing
6+
7+
* copy `gallery.js` to `plugins/gallery/gallery.js` in your reveal.js presentation
8+
* copy `gallery.css` to `plugins/gallery/gallery.css` or integrate into your CSS your preferred way, customise the styles as required. You will need to set the width and height of the `.gallery` selector to match the natural size of your presentation defined in `reveal.js`
9+
* add the following to the head of `index.html` after other stylesheets are loaded:
10+
```<link rel="stylesheet" href="plugins/gallery/gallery.css">```
11+
* add the following to the bottom of `index.html`, where the other plugins are defined:
12+
```{ src: 'plugin/gallery/gallery.js', async: true, condition: function() { return !!document.querySelector('.gallery'); } }```
13+
* add a gallery somewhere in your slide:
14+
15+
```<ul class="gallery" data-interval="0.7" data-iterations="1">
16+
<li><img src="images/image1.jpg" alt="Caption 1"></li>
17+
<li><img src="images/image2.jpg" alt="Caption 2"></li>
18+
<li><img src="images/image3.jpg" alt="Caption 3"></li>
19+
</ul>```
20+
21+
The gallery plugin will take the alt tags in your images and convert them to `label` elements within the `li`.
22+
23+
## Configuring
24+
25+
There's only really two configurable options at the moment, both set as data elements on the `<ul>`:
26+
27+
* **data-interval** a Number which determines how long each slide is shown for (in seconds) - default is 1.0
28+
* **data-iterations** how many times to loop through the slideshow - default is once and stop on the last slide. Set
29+
to 0 to repeat indefinitely
30+
31+
You can also customise how the labels will look by editing the `label` style in `gallery.css`.

0 commit comments

Comments
 (0)