Skip to content

Commit

Permalink
content updates
Browse files Browse the repository at this point in the history
  • Loading branch information
hakimel committed May 14, 2020
1 parent 790cd22 commit 08adbf7
Show file tree
Hide file tree
Showing 13 changed files with 129 additions and 57 deletions.
2 changes: 2 additions & 0 deletions css/content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
.article {
pre[class*="language-"] {
@apply mx-4 my-2 -mx-4 p-4;
max-height: 50vh;
}

code:not([class*="language-"]):not(.hljs) {
Expand Down Expand Up @@ -148,6 +149,7 @@

pre {
font-size: 28px;
width: 100%;
}

a {
Expand Down
File renamed without changes
Binary file removed images/favicon.ico
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "revealjs.com",
"version": "0.0.1",
"version": "0.1.0",
"description": "The official reveal.js website",
"scripts": {
"test": "mdspell -r -n -a --en-us 'src/*.md' 'src/**/*.md'",
Expand Down
5 changes: 2 additions & 3 deletions src/_data/site.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
"url": "https://revealjs.com",
"author": {
"name": "Hakim El Hattab",
"email": "[email protected]",
"handle": "@revealjs",
"avatar": "/images/blog/author.jpg"
"email": "[email protected]",
"handle": "@hakimel"
},
"images": {
"logo": "/images/logo/logo-black-text.svg",
Expand Down
94 changes: 47 additions & 47 deletions src/_includes/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,53 +48,53 @@ <h2>Slides</h2>
</section>

<section data-auto-animate>
<h2 data-id="code-title">Pretty Code</h2>
<pre data-id="code-animation"><code class="hljs" data-trim data-line-numbers>
import React, { useState } from 'react';

function Example() {
const [count, setCount] = useState(0);

return (
...
);
}
</code></pre>
<p>Code syntax highlighting courtesy of <a href="https://highlightjs.org/usage/">highlight.js</a>.</p>
</section>

<section data-auto-animate>
<h2 data-id="code-title">Even Prettier Animations</h2>
<pre data-id="code-animation"><code class="hljs" data-trim data-line-numbers="|4,8-11|17|22-24">
import React, { useState } from 'react';

function Example() {
const [count, setCount] = useState(0);

return (
&lt;div&gt;
&lt;p&gt;You clicked {count} times&lt;/p&gt;
&lt;button onClick={() =&gt; setCount(count + 1)}&gt;
Click me
&lt;/button&gt;
&lt;/div&gt;
);
}

function SecondExample() {
const [count, setCount] = useState(0);

return (
&lt;div&gt;
&lt;p&gt;You clicked {count} times&lt;/p&gt;
&lt;button onClick={() =&gt; setCount(count + 1)}&gt;
Click me
&lt;/button&gt;
&lt;/div&gt;
);
}
</code></pre>
</section>
<h2 data-id="code-title">Pretty Code</h2>
<pre data-id="code-animation"><code class="hljs" data-trim data-line-numbers>
import React, { useState } from 'react';

function Example() {
const [count, setCount] = useState(0);

return (
...
);
}
</code></pre>
<p>Code syntax highlighting courtesy of <a href="https://highlightjs.org/usage/">highlight.js</a>.</p>
</section>

<section data-auto-animate>
<h2 data-id="code-title">Even Prettier Animations</h2>
<pre data-id="code-animation"><code class="hljs" data-trim data-line-numbers="|4,8-11|17|22-24">
import React, { useState } from 'react';

function Example() {
const [count, setCount] = useState(0);

return (
&lt;div&gt;
&lt;p&gt;You clicked {count} times&lt;/p&gt;
&lt;button onClick={() =&gt; setCount(count + 1)}&gt;
Click me
&lt;/button&gt;
&lt;/div&gt;
);
}

function SecondExample() {
const [count, setCount] = useState(0);

return (
&lt;div&gt;
&lt;p&gt;You clicked {count} times&lt;/p&gt;
&lt;button onClick={() =&gt; setCount(count + 1)}&gt;
Click me
&lt;/button&gt;
&lt;/div&gt;
);
}
</code></pre>
</section>

<section>
<h2>Point of View</h2>
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/_layouts/default.njk
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<link rel="stylesheet" href="/main.css">

{% include "social-meta.njk" %}
{% include "meta.njk" %}

<link rel="icon" type="image/svg+xml" href="{{ site.images.favicon }}">

Expand Down
2 changes: 1 addition & 1 deletion src/_layouts/home.njk
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<link rel="stylesheet" href="/main.css">

{% include "social-meta.njk" %}
{% include "meta.njk" %}

<link rel="icon" type="image/svg+xml" href="{{ site.images.favicon }}">

Expand Down
73 changes: 72 additions & 1 deletion src/auto-animate.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,78 @@ Reveal.on( 'autoanimate', event => {
} );
```

## Example: List Animation
## Example: Animating Between Code Blocks
We support animations between code blocks. Make sure that the code block has `data-line-numbers` enabled and that all blocks have a matching `data-id` value.
```html
<section data-auto-animate>
<pre data-id="code-animation"><code data-trim data-line-numbers>
let planets = [
{ name: 'mars', diameter: 6779 },
]
</code></pre>
</section>
<section data-auto-animate>
<pre data-id="code-animation"><code data-trim data-line-numbers>
let planets = [
{ name: 'mars', diameter: 6779 },
{ name: 'earth', diameter: 12742 },
{ name: 'jupiter', diameter: 139820 }
]
</code></pre>
</section>
<section data-auto-animate>
<pre data-id="code-animation"><code data-trim data-line-numbers>
let circumferenceReducer = ( c, planet ) => {
return c + planet.diameter * Math.PI;
}

let planets = [
{ name: 'mars', diameter: 6779 },
{ name: 'earth', diameter: 12742 },
{ name: 'jupiter', diameter: 139820 }
]

let c = planets.reduce( circumferenceReducer, 0 )
</code></pre>
</section>
```
<div class="reveal reveal-example">
<div class="slides">
<section data-auto-animate>
<pre data-id="code-animation"><code data-trim data-line-numbers>
let planets = [
{ name: 'mars', diameter: 6779 },
]
</code></pre>
</section>
<section data-auto-animate>
<pre data-id="code-animation"><code data-trim data-line-numbers>
let planets = [
{ name: 'mars', diameter: 6779 },
{ name: 'earth', diameter: 12742 },
{ name: 'jupiter', diameter: 139820 }
]
</code></pre>
</section>
<section data-auto-animate>
<pre data-id="code-animation"><code data-trim data-line-numbers>
let circumferenceReducer = ( c, planet ) => {
return c + planet.diameter * Math.PI;
}
&nbsp;
let planets = [
{ name: 'mars', diameter: 6779 },
{ name: 'earth', diameter: 12742 },
{ name: 'jupiter', diameter: 139820 }
]
&nbsp;
let c = planets.reduce( circumferenceReducer, 0 )
</code></pre>
</section>
</div>
</div>

## Example: Animating Between Lists
We match list items individually to let you animate new items being added or removed.
```html/2-4,10,12
<section data-auto-animate>
Expand Down
2 changes: 1 addition & 1 deletion src/demo/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<link rel="stylesheet" href="/main.css">

{% include "social-meta.njk" %}
{% include "meta.njk" %}

<link rel="icon" type="image/png" href="{{ site.images.favicon }}">

Expand Down
2 changes: 1 addition & 1 deletion src/links.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ You can create links from one slide to another. Start by giving your target slid
<a href="#/0">Back to the first</a>
</section>
```
<div class="reveal reveal-example">
<div class="reveal reveal-example" data-config='{"respondToHashChanges": true}'>
<div class="slides">
<section>
<a href="#/grand-finale">Go to the last slide</a>
Expand Down
2 changes: 1 addition & 1 deletion src/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ layout: default

Press the »ESC« or »O« keys to toggle the overview mode on and off. While you're in this mode, you can still navigate between slides, as if you were at 1,000 feet above your presentation.

<picture><img src="/images/overview.png" alt="Slide layout with vertical slides"></picture>
<picture><img src="/images/docs/overview.png" alt="Slide layout with vertical slides"></picture>

## API

Expand Down

0 comments on commit 08adbf7

Please sign in to comment.