Skip to content

Commit 694825c

Browse files
committed
update classic-slides example to show how relative position works
1 parent 474fe47 commit 694825c

File tree

1 file changed

+24
-10
lines changed

1 file changed

+24
-10
lines changed

examples/classic-slides/index.html

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ <h1>Bullet points</h1>
188188
Notation shouldn't be a surprise. We use `data-rotate="30"` attribute, meaning that this
189189
element should be rotated by 30 degrees clockwise.
190190
-->
191-
<div class="step slide" data-rel-x="2200" data-rel-y="600" data-rotate="30">
191+
<div class="step slide" data-rel-position="relative" data-rel-x="2200" data-rel-y="600" data-rel-rotate-z="30">
192192
<h1>A blockquote &amp; image</h1>
193193
<img src="images/3476636111_c551295ca4_b.jpg"
194194
alt="Mother Teresa holding a newborn baby"
@@ -200,10 +200,14 @@ <h1>A blockquote &amp; image</h1>
200200
</blockquote>
201201

202202
<div class="notes">
203+
We use <code>data-rel-position="relative"</code> to make <code>data-rel-rotate-*</code> work,
204+
and make <code>data-rel-x/data-rel-y/data-rel-y</code> be calculated at the coordination related to previous slide.
205+
The relative position and rotation will be inherited by following slides,
206+
so it's not necessary to repeat it again and again.
203207
</div>
204208
</div>
205209

206-
<div class="step slide" data-rel-x="1600" data-rel-y="1600" data-rotate="60">
210+
<div class="step slide">
207211
<h1>More text styles</h1>
208212
<p>As usual, use <em>em</em> to emphasize, <br />
209213
<strong>strong</strong> for strong, <u>u</u> for underline,<br />
@@ -216,7 +220,7 @@ <h1>More text styles</h1>
216220
</div>
217221
</div>
218222

219-
<div class="step slide" data-rel-x="600" data-rel-y="2200" data-rotate="90">
223+
<div id="motions" class="step slide">
220224
<h1>Motion effects 101</h1>
221225
<p>Items on the slide can</p>
222226
<p class="fly-in fly-out">Fly in</p>
@@ -246,22 +250,32 @@ <h1>Motion effects 101</h1>
246250
</div>
247251
</div>
248252

249-
<div id="addons" class="step slide title" data-rel-x="-600" data-rel-y="2200" data-rotate="120">
253+
<div id="zoom" class="step" data-rel-reset data-rel-x="-0.25w" data-rel-y="0.5h" data-scale="0.5">
254+
<div class="notes">
255+
<p>This step zoom in to left bottom of previous slide to see to small text.</p>
256+
<p>It's a empty and transparent.</p>
257+
<p><code>data-rel-reset</code> is used to prevent this step from inheriting the relative positioning from previous slide.</p>
258+
</div>
259+
</div>
260+
261+
<div id="addons" class="step slide title" data-rel-to="motions" data-rel-inherit="motions">
250262
<h2>Add-ons</h2>
251263
<div class="notes">
252264
<p>This version of impress.js includes several add-ons, striving to make this a
253265
full featured presentation app.</p>
266+
<p>The previous step breaks the slide flow, changes the relative position and rotation.</p>
267+
<p>This slide use <code>data-rel-inherit</code> to inherit relative position and rotation from the slide before previous slide, <em>and</em> use <code>data-rel-to</code> to make the relative calculation based on specified slide.</p>
254268
</div>
255269
</div>
256270

257-
<div class="step slide" data-rel-x="-1600" data-rel-y="1600" data-rotate="150" data-autoplay="3">
271+
<div class="step slide" data-autoplay="3">
258272
<h1>Impress.js plugins</h1>
259273
<ul>
260274
<li>A new <a href="https://github.com/impress/impress.js/blob/master/src/plugins/README.md">plugin framework</a> allows for rich extensibility,
261275
without bloating the core rendering library.
262276
<ul>
263277
<li class="substep">Press 'P' to open a presenter console.</li>
264-
<li class="substep">When you move the mouse, navigation controls are visible on your bottom left</li>
278+
<li class="substep">When you move the mouse, navigation controls are visible on your bottom right</li>
265279
<li class="substep">Autoplay makes the slides advance after a timeout</li>
266280
<li class="substep">Relative positioning plugin is often a more convenient way to position your slides when editing. (<a href="https://github.com/impress/impress.js/blob/master/examples/classic-slides/index.html">See html for this presentation.</a>)</li>
267281
</ul>
@@ -277,7 +291,7 @@ <h1>Impress.js plugins</h1>
277291
</div>
278292
</div>
279293

280-
<div class="step slide" data-rel-x="-2200" data-rel-y="600" data-rotate="180">
294+
<div class="step slide">
281295
<h1>Highlight.js</h1>
282296
<pre><code>
283297
// `init` API function that initializes (and runs) the presentation.
@@ -303,7 +317,7 @@ <h1>Highlight.js</h1>
303317
</div>
304318
</div>
305319

306-
<div class="step slide" data-rel-x="-2200" data-rel-y="-600" data-rotate="210">
320+
<div class="step slide">
307321
<h1>Mermaid.js</h1>
308322
<div class="mermaid">
309323
%% This is a comment in mermaid markup
@@ -330,7 +344,7 @@ <h1><a href="http://docs.mathjax.org/en/latest/start.html">MathJax.js</a></h1>
330344
</div>
331345
</div>
332346

333-
<div id="markdown" class="step slide markdown" data-rel-x="-1600" data-rel-y="-1600" data-rotate="240">
347+
<div id="markdown" class="step slide markdown">
334348
# Markdown.js
335349

336350
* [Markdown.js](https://github.com/evilstreak/markdown-js) integration: for authors in a hurry!
@@ -344,7 +358,7 @@ <h1><a href="http://docs.mathjax.org/en/latest/start.html">MathJax.js</a></h1>
344358
* [A more advanced Markdown presentation is here.](../markdown/)
345359
</div>
346360

347-
<div id="acme" class="step slide" data-rel-x="-600" data-rel-y="-2200" data-rotate="270">
361+
<div id="acme" class="step slide">
348362
<ul>
349363
<li>Remember, in <em>impress.js</em> the full power of HTML5, CSS3 &amp; JavaScript is always at your fingertips!</li>
350364
<li>For example, you can use tables, forms, or dynamic charts as you would on any web page:</li>

0 commit comments

Comments
 (0)