> For the complete documentation index, see [llms.txt](https://iamtopik.gitbook.io/artifact-html-widget/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://iamtopik.gitbook.io/artifact-html-widget/master.md).

# HTML Widget

### Preview

![Default settings](/files/-LRIy4L-BIHBSN5-En1m)

### Instalation

At the end of your page, right before tag \</body>, insert this code:

```markup
<script async src="https://widget.artifact.cz/main.min.js"></script>
```

In order to insert a deck into your page, you have to insert a DIV element with parameter data-url. You have to fill this parameter with URL of the deck.

```markup
<div class="artifact-deck-widget" data-url="https://playartifact.com/d/ADCJWkTZX05uwGDCRV4XQGy3QGLmqUBg4GQJgGLGgO7AaABR3JlZW4vQmxhY2sgRXhhbXBsZQ__"></div>
```

You can insert multiple decks into single page.

### Advanced setup

Widget supports this data parameters:

* data-url
  * **Mandatory**
  * URL of the artifact deck from playartifact.com
  * you can ALSO insert a deck hash without <https://playartifact.com/d/>
* data-width
  * Width of the widget (in px)
  * Default: 320px
* data-height
  * Height of the widget (in px)
  * Default: 500px
* data-disable-link
  * Options: true / false
  * Disable / enable "Open on playartifact.com" button
  * Default: enabled

### Example with full setup

```markup
<div class="artifact-deck-widget" data-disable-link="true" data-width="300" data-height="400" data-url="https://playartifact.com/d/ADCJWkTZX05uwGDCRV4XQGy3QGLmqUBg4GQJgGLGgO7AaABR3JlZW4vQmxhY2sgRXhhbXBsZQ__"></div>
```

Widget with disabled link, width of 300px, height of 400px.

Full page example: <https://widget.artifact.cz/example.html>

### Resources

* Valve API
* Vanilla Javascript (no jQuery)

### Credits

<topekar@gmail.com>

### License

[The GNU General Public License](https://www.google.cz/url?sa=t\&rct=j\&q=\&esrc=s\&source=web\&cd=1\&cad=rja\&uact=8\&ved=2ahUKEwjL4JuK4dTeAhVhh4sKHd_gAowQFjAAegQIARAB\&url=https%3A%2F%2Fwww.gnu.org%2Flicenses%2Fgpl-3.0.en.html\&usg=AOvVaw10bxkQaeimljqo7-w-lKIy)
