Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <!-- See http://lab.hakim.se/reveal-js/ for a more in-depth demo -->
<!-- and https://github.com/hakimel/reveal.js/ for a reference -->

<!-- Wrap the entire slide show in a div using the "reveal" class. -->
<div class="reveal">
  <!-- Wrap all slides in a single "slides" class -->
  <div class="slides">
    <!-- Each section element contains an individual slide -->
    <!-- Nested sections produce vertically connected slides -->
    <section id="title">
      <section>
        <h1>Presentation title</h1>
        <p class="fragment fade-up">We're going to talk about some aspect of...  </p>
        <div class="fragment fade-up"><h2 class="fragment shrink">compression</h2></div>	
      </section>
      <section>
        <h4>This presentation is for assessment in<br/> 
          Unit 2 of Computing and App Design at FCC 2017
        </h4>
      </section>
    </section>

    <section id="show-a-link">
      <h1>A Kodak test image</h1>
      <!--  Note the use of data-src to aid Lazy Loading of large external media -->
      <!--  https://github.com/hakimel/reveal.js#lazy-loading    -->
      <img data-src="http://r0k.us/graphics/kodak/kodak/kodim08.png" num="08" height="300px" id="test-img">
      <p>Source: 
        <a href="http://r0k.us/graphics/kodak/">http://r0k.us/graphics/kodak/</a>
      </p>
      <p>This is much less contraversial than 
        <a href="https://en.wikipedia.org/wiki/Lenna">Lenna...</a>
      </p>
      <aside class="notes">
        Speaker notes are added like this
      </aside>
    </section>

    <section>
      <h1>Code & Math Slide</h1>
      <p>Some code follows </p>
      <pre><code>
    $(function () {
      $('a').click(function(event) {
        alert('Thanks for visiting!'');
      });
    });
  </code></pre>
      <p> Test inline maths: $e^{\mathrm{i} x} = \cos(x) + \mathrm{i} \sin(x)$  </p>
    </section>
    <section>
      <h1> Internal links </h1>
      <p>Back to the <a href="#/title">top</a>? </p>
    </section>

    <section>
      <section>
        <h1>The End</h1>
        <p>Any Questions?</p>	
      </section>
      <section>
        <h3>References</h3>
        <ul>
          <li> <a href="https://code.org/educate/csp/unit2">Code.org CSP Unit 2</a></li>
          <li> <a href="http://csfieldguide.org.nz/en/chapters/coding-compression.html">CS Field Guide: Compression</a></li>
          <li> <a href="https://en.wikipedia.org/wiki/Lenna">Wikipedia: Lenna</a></li>
          <li> <a href="http://r0k.us/graphics/kodak/">Kodak Lossless True Color Image Suite</a></li>
        </ul>
      </section>
    </section>
  </div>
</div>
              
            
!

CSS

              
                
              
            
!

JS

              
                var cdn = 'https://cdnjs.cloudflare.com/ajax/libs/reveal.js/3.4.1/';
Reveal.initialize({
  controls: true,
  progress: true,
  history: true,
  center: true,
  help: true, // Show help overlay when ? is pressed
  transition: 'convex', // default / none / slide / concave / convex / zoom
  transitionSpeed: 'default', // default / fast / slow
  backgroundTransition: 'default', // default / none / fade / slide / convex / concave/ zoom
  dependencies: [ // Comment in/out as needed
    { src: cdn+'lib/js/classList.js', // Cross-browser shim that fully implements classList
      condition: function() { return !document.body.classList; } },
    // { src: cdn+'plugin/markdown/marked.js',   // Interpret Markdown in <section> elements [1]
    //   condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
    // { src: cdn+'plugin/markdown/markdown.min.js', // Interpret Markdown in <section> elements [2]
    //   condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
    { src: cdn+'plugin/highlight/highlight.min.js', async: true,  // Syntax highlighting <code> elements
      callback: function() { hljs.initHighlightingOnLoad(); } },
    { src: cdn+'plugin/zoom-js/zoom.min.js', async: true}, // Alt+click zoom on elements
    { src: cdn+'plugin/notes/notes.min.js', async: true}, // Speaker notes
		{ src: cdn+'plugin/math/math.min.js', async: true }  // MathJax
  ], 
  math: {
		mathjax: 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js',
		config: 'TeX-AMS_HTML-full'  // See https://docs.mathjax.org/en/latest/config-files.html
	},
});

// Probably should link these to smaller test images / faster site! 
var kImg = document.getElementById("test-img");
kImg.onclick = function() {
  var newNum = Number(kImg.getAttribute("num")) + 1;
  kImg.setAttribute("num", newNum);
  // kImg.setAttribute("data-src", kodakImg(newNum));
  kImg.src = kodakImg(newNum);
}

// Randomize inital image on document load -- too late?
// Reveal.addEventListener( 'ready', function( event ) {
//   kImg.src = kodakImg(Math.round(Math.random()*24));
// } );

function kodakImg(n) {
  // Images are numbered 01, 02, ..., 24
  var num = n < 1 ? n + 23 : n-1;
  num = (num % 24) + 1;
  num = ((num < 10) ? "0" : "") + String(num); // Pad to two digits with a zero
  return "http://r0k.us/graphics/kodak/kodak/kodim"+num+".png"
}
              
            
!
999px

Console