Skip to content

The library that powers the extension by the same name. Tooltips for Dead by Daylight anywhere on the web.

License

Notifications You must be signed in to change notification settings

miasmos/hex-tooltip

Repository files navigation

Hex: Tooltip

npm version Known Vulnerabilities Build Status codecov last commit issues

Tooltips for Dead by Daylight anywhere on the web.

Getting Started

Install hex-tooltip and save to your package.json in one easy step.

With npm:

npm install @stephenpoole/hex-tooltip

With yarn:

yarn add @stephenpoole/hex-tooltip

Usage

In the browser globally

  1. Insert the script tag in your html head:
<script src="https://cdn.jsdelivr.net/npm/@stephenpoole/hex-tooltip/dist/hex.tooltip.js"></script>
  1. Pass an HTMLElement containing a tooltip tag: Try it out
<div id="hex-tooltip"><span class="hex-tooltip-959f26b8824a7"></span></div>
HexTooltip.parse(document.getElementById("hex-tooltip"));

In the browser with webpack

  1. Import hex-tooltip into your application:
import HexTooltip from "@stephenpoole/hex-tooltip";
  1. Pass an HTMLElement containing a tooltip tag:
HexTooltip.parse(document.getElementById("hex-tooltip"));

2a. or mount it in your React application

import HexTooltip, { HexTooltipApp, PerkTooltip, PerkModel, DeadByDaylight } from "@stephenpoole/hex-tooltip";

const model = HexTooltip.toModel("Hex: Ruin");
const { rarity, name, description, flavor, owner } = model as PerkModel;

<HexTooltipApp
    title="<span class="hex-tooltip-d9d3e49cb23dd"></span>"
    tooltip={
        <PerkTooltip
            rarity={rarity}
            name={name}
            description={description}
            flavor={flavor}
            owner={owner}
            tier={tier}
        />
    }
/>

Documentation

You'll find the type documentation here: Documentation

License

MIT

About

The library that powers the extension by the same name. Tooltips for Dead by Daylight anywhere on the web.

Topics

Resources

License

Stars

Watchers

Forks