From 8f32e236f934c311b66a1c4ef9acb6e4547ae28b Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Tue, 28 May 2019 12:19:06 +0200 Subject: [PATCH] update code example on chromeless page --- chromeless.html | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/chromeless.html b/chromeless.html index 34cef7a1..0d70561b 100644 --- a/chromeless.html +++ b/chromeless.html @@ -224,20 +224,20 @@

Pretty Code

-

-function linkify( selector ) {
-  if( supports3DTransforms ) {
+					

+import React, { useState } from 'react';
 
-    var nodes = document.querySelectorAll( selector );
+function Example() {
+  const [count, setCount] = useState(0);
 
-    for( var i = 0, len = nodes.length; i < len; i++ ) {
-      var node = nodes[i];
-
-      if( !node.className ) {
-        node.className += ' roll';
-      }
-    }
-  }
+  return (
+    <div>
+      <p>You clicked {count} times</p>
+      <button onClick={() => setCount(count + 1)}>
+        Click me
+      </button>
+    </div>
+  );
 }
 					

Code syntax highlighting courtesy of highlight.js.

@@ -394,10 +394,9 @@ Reveal.addEventListener( 'customevent', function() { // More info https://github.com/hakimel/reveal.js#dependencies dependencies: [ - { src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } }, { src: 'plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } }, { src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } }, - { src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } }, + { src: 'plugin/highlight/highlight.js' }, { src: 'plugin/search/search.js', async: true }, { src: 'plugin/zoom-js/zoom.js', async: true }, { src: 'plugin/notes/notes.js', async: true }