Attractive Presentation with HTML5. Today we will prepare something new – presentation. And we will using all interesting what can give us HTML5. Presentation itself will contain 5 easy slides. We will able to use navigation arrow keys for sliding, spacebar, display notes, sidebar with some custom content. Here are new html5 tags which we going to use: nav, menu, section, aside, header and hgroup. Sure, that now is time to check our demo.
Here are links to demo and downloadable package:
[sociallocker]
[/sociallocker]
So, download the example files and lets start coding !
Step 1. HTML
index.html
All layout consist of 4 main sections: header, floating help navigation, main slides area and sidebar. Here are code for header area:
4 | <meta charset="utf-8" /> |
5 | <title>HTML5 Presentation demo | Script tutorials</title> |
7 | <link rel="stylesheet" href="css/style.css" type="text/css" media="all" /> |
Next – floating help navigation (in document body)
02 | <button title="Previous" id="nav-prev" class="nav-prev"><-</button> |
03 | <button title="Jump to slide" id="slide-no">3</button> |
04 | <button title="Next" id="nav-next" class="nav-next">-></button> |
06 | <button type="checkbox" data-command="notes" title="View Notes">Notes</button> |
07 | <button type="checkbox" data-command="help" title="View Help">Help</button> |
08 | <button type="checkbox" data-command="back" title="Back to tutorial">Back</button> |
Here, we predefined several action buttons for future. Now, here are code for presentation slides:
01 | <div class="presentation"> |
02 | <div id="presentation-counter">Loading...</div> |
04 | <div class="slide" id="slide1"> |
05 | <section class="middle"> |
06 | <p>HTML5 Presentation demo</p> |
07 | <p>Press <span id="left-init-key" class="key">→</span> key to continue.</p> |
15 | <div class="slide" id="slide2"> |
16 | <header>Slides controls</header> |
19 | <li><span class="key">←</span> and <span class="key">→</span> to move forward/back.</li> |
20 | <li><span class="key">spacebar</span> to move forward.</li> |
21 | <li><span class="key">N</span> to toggle hidden notes.</li> |
22 | <li><span class="key">H</span> to toggle help.</li> |
27 | Notes for second slide |
31 | <div class="slide" id="slide3"> |
32 | <section class="middle"> |
41 | <p>text of slide, text of slide, text of slide, text of slide</p> |
44 | <div class="slide" id="slide4"> |
45 | ... code for slide 4 .. |
47 | <div class="slide" id="slide5"> |
48 | ... code for slide 5 .. |
You can add more and more slides in end by same rules. And now – code for sidebar:
01 | <div id="hidden-note" class="invisible" style="display: none;"> |
03 | <aside id="help" class="sidebar invisible" style="display: hidden;"> |
05 | <caption>Help</caption> |
07 | <th>Move forward/back</th> |
08 | <td>← →</td> |
Thats all
Step 2. CSS
css/style.css
Resulting file of our demo is pretty big. So I decided not publish all this code here. But you always can download this in our package.
Step 3. JS
js/script.js
This file big enough too (330 lines). Hope that this is ok if it will available in package too.
Conclusion
I hope that today you were impressed and you like presentation. As you can see – all pretty customizable. I wish you luck in creating own presentations!