Skip to content

Commit 7505838

Browse files
committed
Use autoplay and toolbar plugins in the main impress demo
For all the other features, see demos under extras/
1 parent ff036a5 commit 7505838

File tree

3 files changed

+64
-10
lines changed

3 files changed

+64
-10
lines changed

DOCUMENTATION.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ Define the pixel based position in which the **center** of the [Step Element](#s
8282
</div>
8383
```
8484

85+
**Note:** The introduction of the [rel](src/plugins/rel/README.md) plugin includes a slight backward incompatible change.
86+
Previously the default value for `data-x`, `data-y` and `data-z` was zero. The `rel` plugin changes the default to inherit
87+
the value of the previous slide. This means, you need to explicitly set these values to zero, if they ever were non-zero.
88+
89+
8590
#### 3D Rotation (data-rotate-x, data-rotate-y, data-rotate-z)
8691

8792
You can not only position a [Step Element](#step-element) in 3D, but also rotate it around any axis.

css/impress-demo.css

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ a:focus {
268268
}
269269

270270
#title h1 {
271-
font-size: 190px;
271+
font-size: 180px;
272272

273273
-webkit-transform: translateZ(50px);
274274
-moz-transform: translateZ(50px);
@@ -294,6 +294,7 @@ a:focus {
294294
line-height: 1;
295295
}
296296

297+
#big strong,
297298
#big b {
298299
display: block;
299300
font-size: 250px;
@@ -527,6 +528,35 @@ a:focus {
527528
cursor: pointer;
528529
}
529530

531+
/*
532+
This version of impress.js supports plugins, and in particular, a UI toolbar
533+
plugin that allows easy navigation between steps and autoplay.
534+
*/
535+
.impress-enabled div#impress-toolbar {
536+
position: fixed;
537+
right: 1px;
538+
bottom: 1px;
539+
opacity: 0.6;
540+
}
541+
.impress-enabled div#impress-toolbar > span {
542+
margin-right: 10px;
543+
}
544+
545+
/*
546+
With help from the mouse-timeout plugin, we can hide the toolbar and
547+
have it show only when you move/click/touch the mouse.
548+
*/
549+
body.impress-mouse-timeout div#impress-toolbar {
550+
display: none;
551+
}
552+
553+
/*
554+
In fact, we can hide the mouse cursor itself too, when mouse isn't used.
555+
*/
556+
body.impress-mouse-timeout {
557+
cursor: none;
558+
}
559+
530560

531561
/*
532562
Now, when we have all the steps styled let's give users a hint how to navigate
@@ -682,9 +712,9 @@ a:focus {
682712
683713
So use it wisely ... or don't use at all.
684714
*/
685-
.impress-enabled { pointer-events: none }
686-
.impress-enabled #impress { pointer-events: auto }
687-
715+
.impress-enabled { pointer-events: none }
716+
.impress-enabled #impress { pointer-events: auto }
717+
.impress-enabled #impress-toolbar { pointer-events: auto }
688718
/*
689719
There is one funny thing I just realized.
690720

index.html

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,12 @@
143143
But as I said, you won't need it for now, so don't worry - there are some simple but interesting things
144144
right around the corner of this tag ;)
145145
146+
----------
147+
Plugins: We set the default time for autoplay plugin to 6 seconds. Autoplay will automatically advance
148+
to next slide after a timeout expires.
149+
146150
-->
147-
<div id="impress">
151+
<div id="impress" data-autoplay="7">
148152

149153
<!--
150154
@@ -162,8 +166,11 @@
162166
163167
It will not be rotated or scaled.
164168
169+
--------
170+
Plugins: For first slide, set the autoplay time to a custom 10 seconds.
171+
165172
-->
166-
<div id="bored" class="step slide" data-x="-1000" data-y="-1500">
173+
<div id="bored" class="step slide" data-x="-1000" data-y="-1500" data-autoplay="10">
167174
<q>Aren’t you just <b>bored</b> with all those slides-based presentations?</q>
168175
</div>
169176

@@ -256,8 +263,12 @@ <h1>impress.js<sup>*</sup></h1>
256263
So basically every step element has one of three classes: `future`, `present` and `past`.
257264
Only one current step has the `present` class.
258265
266+
Note: data-x/y/z attributes, if not defined, by default will inherit the value of the
267+
previous step. So to get back to 0 on the z-axis, we must set it to 0.
268+
See src/plugins/rel/README.md for more information.
269+
259270
-->
260-
<div id="ing" class="step" data-x="3500" data-y="-850" data-rotate="270" data-scale="6">
271+
<div id="ing" class="step" data-x="3500" data-y="-850" data-z="0" data-rotate="270" data-scale="6">
261272
<p>by <b class="positioning">positioning</b>, <b class="rotating">rotating</b> and <b class="scaling">scaling</b> them on an infinite canvas</p>
262273
</div>
263274

@@ -267,7 +278,7 @@ <h1>impress.js<sup>*</sup></h1>
267278

268279
<div id="source" class="step" data-x="6300" data-y="2000" data-rotate="20" data-scale="4">
269280
<p>want to know more?</p>
270-
<q><a href="http://github.com/bartaz/impress.js">use the source</a>, Luke!</q>
281+
<q><a href="http://github.com/henrikingo/impress.js">use the source</a>, Luke!</q>
271282
</div>
272283

273284
<div id="one-more-thing" class="step" data-x="6000" data-y="4000" data-scale="2">
@@ -306,11 +317,18 @@ <h1>impress.js<sup>*</sup></h1>
306317
CSS transfrom docs: https://developer.mozilla.org/en/CSS/transform
307318
308319
-->
309-
<div id="overview" class="step" data-x="3000" data-y="1500" data-scale="10">
320+
<div id="overview" class="step" data-x="3000" data-y="1500" data-z="0" data-scale="10">
310321
</div>
311322

312323
</div>
313324

325+
<!--
326+
This is a UI plugin. You can read more about plugins in src/plugins/README.md.
327+
For now, I'll just tell you that this adds some graphical controls to navigate the
328+
presentation. In the CSS file you can style them as you want. We've put them bottom right.
329+
-->
330+
<div id="impress-toolbar"></div>
331+
314332
<!--
315333
316334
Hint is not related to impress.js in any way.
@@ -336,7 +354,8 @@ <h1>impress.js<sup>*</sup></h1>
336354
337355
-->
338356
<div class="hint">
339-
<p>Use a spacebar or arrow keys to navigate</p>
357+
<p>Use a spacebar or arrow keys to navigate. <br/>
358+
Press 'P' to launch speaker console.</p>
340359
</div>
341360
<script>
342361
if ("ontouchstart" in document.documentElement) {

0 commit comments

Comments
 (0)