# Your own markup

Keep your own headings and text and let a .rupaplay file add the design, animation and control.

Export the animation as a `.rupaplay` file and copy its markup (the export dialog has **Copy markup**). The page keeps
your `h1`, `p` and `div`, and the player adds the design, the animation and the control.

```html
<script type="module" src="https://cdn.jsdelivr.net/npm/@rupamotion/player@0.1.0/dist/element.js"></script>

<rupa-player src="/hero.rupaplay" markup="keep">
	<div class="hero-root">
		<h1 class="hero-title">Your own, editable heading</h1>
		<p class="hero-text">Text a search engine reads without JavaScript.</p>
	</div>
</rupa-player>
```

Or from code, on any element that holds your markup:

```js
import { mountFile } from "@rupamotion/player/file";

const result = await mountFile(document.querySelector("#hero"), "/hero.rupaplay", { markup: "keep" });
if (result.error) console.warn(result.error.code, result.error.message);
else result.player.play("exit");
```

## The markup option

`markup` says what happens to the markup inside the root:

- `keep` (the default of `mountFile` and `<RupaPlayer>`) keeps it and animates what matches the classes of the file.
- `replace` writes the markup of the file.
- `auto` (the default of `<rupa-player>`) writes the markup of the file into an empty root, keeps a root that has every
  class of the file, and replaces any other.

**The classes in the markup are addresses. Do not rename them**: the animation finds its elements by them.

Below, the page holds the markup and the `.rupaplay` file adds the rest:

```js
import { mountFile } from "@rupamotion/player/file";

const { player } = await mountFile(document.querySelector("#event-hero"), "/event-hero.rupaplay", { markup: "keep" });
player.play("drift");
```
