Skip to content

Commit

Permalink
Use pull request foundation#11435 from ncoden/docs/motion-ui-componen…
Browse files Browse the repository at this point in the history
…ts for v6.5.0

b08a56d docs: move Motion UI Toggler example to its own section
bd4bf11 docs: add a simpler example in Motion UI docs header

Signed-off-by: Nicolas Coden <nicolas@ncoden.fr>
  • Loading branch information
ncoden committed Aug 25, 2018
1 parent 3629d22 commit fa2b9bd
Showing 1 changed file with 42 additions and 22 deletions.
64 changes: 42 additions & 22 deletions docs/pages/motion-ui.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,16 @@ library:
docs: https://github.com/zurb/motion-ui/tree/master/docs
---

Motion UI is a standalone library that powers the transition effects used in a number of Foundation components, including [Toggler](toggler.html), [Reveal](reveal.html), and [Orbit](orbit.html). The transitions are powered by special transition classes that the Motion UI Sass creates. For example, here are two instances of Toggler&mdash;one using fade classes (`.fade-in` and `.fade-out`), and one using slide classes (`.slide-in-down` and `.slide-out-up`).
Motion UI is a standalone library that powers the transition effects used in a number of Foundation components, including [Toggler](toggler.html), [Reveal](reveal.html), and [Orbit](orbit.html).

```html
<div data-toggler data-animate="fade-in fade-out" class="callout secondary">
<p>This panel fades.</p>
</div>

<div data-toggler data-animate="slide-in-down slide-out-up" class="callout secondary">
<p>This panel slides.</p>
</div>
```

<button type="button" class="button" data-toggle="motion-example-1">Fade</button><button type="button" class="button" data-toggle="motion-example-2">Slide</button>
<div class="grid-x grid-margin-x">
<div class="cell small-6">
<div data-toggler data-animate="fade-in fade-out" class="callout secondary ease" id="motion-example-1">
<p>This panel <strong>fades</strong>.</p>
</div>
</div>
<div class="cell small-6">
<div data-toggler data-animate="slide-in-down slide-out-up" class="callout secondary ease" id="motion-example-2">
<p>This panel <strong>slides</strong>.</p>
</div>
<div class="text-center">
<button type="button" class="button" data-toggle="motion-header-example">Animate!</button>
<div data-toggler data-animate="fade-in fade-out" id="motion-header-example" style="display: none;">
<img src="/assets/img/generic/rectangle-7.jpg" style="width: 100%;">
</div>
</div>


---

## Installing
Expand Down Expand Up @@ -78,6 +62,42 @@ Or, another way to start using Motion UI is through a CDN.

---

## Usage in Components

Various Foundation components provide options for to use Motion UI animations when changing state. Here are the options for each plugin that support Motion UI:
- [Orbit](orbit.html): `data-animate`
- [Reveal](reveal.html): `data-animation-in`, `data-animation-out`
- [Toggler](toggler.html): `data-animate`
- [Responsive Toggler](responsive-navigation.html): `data-animate`

For example, here are two instances of Toggler&mdash;one using fade classes (`.fade-in` and `.fade-out`), and one using slide classes (`.slide-in-down` and `.slide-out-up`). See all availaible classes in [build-in transitions](#built-in-transitions) below.

```html
<div data-toggler data-animate="fade-in fade-out" class="callout secondary">
<p>This panel fades.</p>
</div>

<div data-toggler data-animate="slide-in-down slide-out-up" class="callout secondary">
<p>This panel slides.</p>
</div>
```

<button type="button" class="button" data-toggle="motion-example-1">Fade</button><button type="button" class="button" data-toggle="motion-example-2">Slide</button>
<div class="grid-x grid-margin-x">
<div class="cell small-6">
<div data-toggler data-animate="fade-in fade-out" class="callout secondary ease" id="motion-example-1">
<p>This panel <strong>fades</strong>.</p>
</div>
</div>
<div class="cell small-6">
<div data-toggler data-animate="slide-in-down slide-out-up" class="callout secondary ease" id="motion-example-2">
<p>This panel <strong>slides</strong>.</p>
</div>
</div>
</div>

---

## Built-in Transitions

Motion UI includes more than two dozen built-in transition classes. They can be enabled by adding this line to your Sass file, after you've imported the library:
Expand Down

0 comments on commit fa2b9bd

Please # to comment.