====== Markup and Code-Behind Examples for reveal.js ====== ===== Markup ===== ==== Animate Slide Transitions ==== The ''data-auto-animate'' decorator causes automatic display transition styling of matching header markup on slides.

Slide One

Contents

Slide Two

Contents

==== Block Quote ====
Text of block quote.
==== Fragments ==== Show text incrementally on a slide:

Fragments

Hit the next arrow...

... to step through ...

... a fragmented slide.

==== Image Backgrounds ====

Data Backgrounds

==== Scale Image ==== ==== Small Text ==== Nice formatting for long paragraphs. Text of paragraph. ==== Syntax Highlighting ====


printf("Hello!\n");

===== Customization ===== ==== Default Background Image ==== Add this //after// the Reveal.initialize block: for (var slide of document.getElementsByTagName('section')) { if (!(slide.getAttribute('data-background') || slide.getAttribute('data-background-video') || slide.getAttribute('data-background-iframe') || slide.getAttribute('data-background-image'))) { slide.setAttribute('data-background-image', 'img/default-background.png') } } ==== Make Text Stand Out ==== For text that is hard to read, you can make it stand out by enclosing it in a translucent box. First, create a css/custom.js file, and add this style: .background-box-black { background-color: rgba(0, 0, 0, 0.8); color: #fff; padding: 20px; } Include the custom CSS in your index.html: Then, use it in a slide like this:

Some text!

Here's some additional CSS for enhancing text display: .green-bold { color: green; font-weight: bold; } .red-bold { color: red; font-weight: bold; } .blue-bold { color: blue; font-weight: bold; } .simple-quote { background-color: rgba(0, 0, 0, 0.8); font-style: italic; } .force-italic { font-style: italic; }