Tooltips for Dead by Daylight anywhere on the web.
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
In the browser globally
- Insert the script tag in your html head:
<script src="https://cdn.jsdelivr.net/npm/@stephenpoole/hex-tooltip/dist/hex.tooltip.js"></script>
- 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
- Import
hex-tooltip
into your application:
import HexTooltip from "@stephenpoole/hex-tooltip";
- 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}
/>
}
/>
You'll find the type documentation here: Documentation
MIT