Skip to content

mobalyticshq/mobalytics-widgets

Repository files navigation

Mobalytics logo

Mobalytics Widgets

Mobalytics Widgets allow you to install useful widgets with data insights for League of Legends to your website.

⭐ Star us on GitHub — it motivates us a lot!

Getting Started

Installation

Add Mobalytics Widgets script section right before closing <body/> tag

<script async src="https://cdn.jsdelivr.net/gh/mobalyticshq/mobalytics-widgets/build/mobalytics-widgets.js"></script>

Widget Host Node

Add host node for the widget (LoL Amumu Champion Build example)

<div data-moba-widget="lol-champion-build" data-moba-champion="amumu"></div>

Result

Done! Here is a minimal code snippet

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<div data-moba-widget="lol-champion-build" data-moba-champion="amumu"></div>
<script async src="https://cdn.jsdelivr.net/gh/mobalyticshq/mobalytics-widgets/build/mobalytics-widgets.js"></script>
</body>
</html>

Installing Script on Your Server

If you want to install the script on your own server instead of using Jsdelivr CDN, use the following link to download.

Widgets

LoL Champion Build Widget

LoL Champion Build Widget

LoL Champion Build Widgets display the most popular champion build on automatically choosen or specified role.

Host Node Settings

Attribute Description
data-moba-widget Widget ID lol-champion-build
data-moba-champion Slug of the champion, follow instructions
to see full slugs list.
data-moba-champion-role Role of the champion, possible values are
ADC, JUNGLE, MID, SUPPORT, TOP.
data-moba-champion-tier-icon Show or hide champion tier icon
ON, OFF.

Example

<div data-moba-widget="lol-champion-build"
     data-moba-champion="amumu"
     data-moba-champion-role="jungle"></div>

LoL Champion Build Compact Widget

LoL Champion Build Compact Widget

LoL Champion Build Compact Widgets display the most popular champion build on automatically chosen or specified role in a compact way.

Host Node Settings

Attribute Description
data-moba-widget Widget ID lol-champion-build-compact
data-moba-champion Slug of the champion, follow instructions
to see full slugs list.
data-moba-champion-role Role of the champion, possible values are
ADC, JUNGLE, MID, SUPPORT, TOP.
data-moba-game-mode Game Mode, possible values are
ARAM, ARENA, SUMMONER_RIFT.
data-moba-champion-tier-icon Show or hide champion tier icon
ON, OFF.

Example

<div data-moba-widget="lol-champion-build-compact"
     data-moba-champion="amumu"
     data-moba-champion-role="jungle"></div>

LoL Champion Tooltip Widget

LoL Champion Tooltip Widget

LoL Champion Tooltip Widget uses links to Mobalytics champion build pages as a host node to show tooltip on hover over these links.

Host Node Settings

Attribute Description
data-moba-tooltip Tooltip ID lol-champion-tooltip

Example

<a target="_blank"
   href="https://mobalytics.gg/lol/champions/khazix/build"
   data-moba-tooltip="lol-champion-tooltip">Khazix link with tooltip</a>

FAQ

How to find champion slug to use in a widget?

  1. Open Mobalytics Champions Page
  2. Navigate to specific champion page e.g "ahri"
  3. Copy champion slug from the page URL

How to find LoL Champion Slug

License

MIT License