Creating an Attractive Presentation with HTML5

Tutorials

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:

Live Demo

[sociallocker]

download in package

[/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:

1 <!DOCTYPE html>
2 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
3 <head>
4     <meta charset="utf-8" />
5     <title>HTML5 Presentation demo | Script tutorials</title>
6     <!-- Linking styles -->
7     <link rel="stylesheet" href="css/style.css" type="text/css" media="all" />
8 </head>

Next – floating help navigation (in document body)

01 <nav id="helpers"><!-- Defining the floating helpers of the page -->
02   <button title="Previous" id="nav-prev" class="nav-prev">&lt;-</button>
03   <button title="Jump to slide" id="slide-no">3</button>
04   <button title="Next" id="nav-next" class="nav-next">-&gt;</button>
05   <menu>
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>
09   </menu>
10 </nav>

Here, we predefined several action buttons for future. Now, here are code for presentation slides:

01 <div class="presentation"><!-- Defining the main presentation -->
02   <div id="presentation-counter">Loading...</div>
03   <div class="slides"><!-- Defining slides -->
04     <div class="slide" id="slide1"><!-- Defining single slide -->
05       <section class="middle">
06         <p>HTML5 Presentation demo</p>
07         <p>Press <span id="left-init-key" class="key">&rarr;</span> key to continue.</p>
08       </section>
09       <aside class="note"><!-- hidden notes of slide -->
10         <section>
11           Notes for first slide
12         </section>
13       </aside>
14     </div>
15     <div class="slide" id="slide2">
16       <header>Slides controls</header>
17       <section>
18         <ul>
19           <li><span class="key">&larr;</span> and <span class="key">&rarr;</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>
23         </ul>
24       </section>
25       <aside class="note">
26         <section>
27           Notes for second slide
28         </section>
29       </aside>
30     </div>
31     <div class="slide" id="slide3">
32       <section class="middle">
33         <hgroup>
34           <h1>
35             Slide3
36           </h1>
37           <h2>
38             Slide Title #3
39           </h2>
40         </hgroup>
41         <p>text of slide, text of slide, text of slide, text of slide</p>
42       </section>
43     </div>
44     <div class="slide" id="slide4">
45       ... code for slide 4 ..
46     </div>
47     <div class="slide" id="slide5">
48       ... code for slide 5 ..
49     </div>
50   </div>

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;">
02 </div<!-- hidden note -->
03 <aside id="help" class="sidebar invisible" style="display: hidden;"><!-- Defining sidebar help -->
04   <table>
05     <caption>Help</caption>
06       <tr>
07         <th>Move forward/back</th>
08         <td>&larr;&nbsp;&rarr;</td>
09       </tr>
10       <tr>
11         <th>Move forward</th>
12         <td>spacebar</td>
13       </tr>
14       <tr>
15         <th>Hidden Notes</th>
16         <td>N</td>
17       </tr>
18       <tr>
19         <th>Help</th>
20         <td>H</td>
21       </tr>
22   </table>
23 </aside>

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.


Live Demo

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!

Rate article