Wiki Tooltips
One script tag gives your site's readers hover cards for Ethyrial items, quests, NPCs, spells, talents, statuses, zones, loot tables, resources and recipes — the same preview the wiki itself shows.
Add it to your page
Drop this anywhere on the page, once:
<script src="https://ethyrial-web.ryan-fec.workers.dev/tooltips.js" defer></script>
Every link to an Ethyrial wiki page — on ethyrial-web.ryan-fec.workers.dev or
ethyrial.com — is picked up automatically. Nothing fetches until a reader actually
hovers or focuses a link, and each data shard is fetched once and cached for the life of the page.
To mark up text that is not a link, add a data-ethyrial attribute naming the type
and slug exactly as they appear in the wiki URL:
<span data-ethyrial="item/attuned-darkshroud-leather" tabindex="0">Darkshroud leather</span>
Configuration
Optional. Set window.ethyrialTooltips before the script tag:
window.ethyrialTooltips = {
selector: 'main', // only elements matching or inside this selector get tooltips
domain: true, // also match root-relative /wiki/... links on your own host
icons: true // set false to hide entity icons in the card
};
| Option | Effect |
|---|---|
selector |
A CSS selector scoping where tooltips activate — a trigger matches when it is the element or sits inside one. Omit it to cover the whole page. |
domain |
true opts your own host in, so root-relative /wiki/<type>/<slug>/ links preview too. A hostname string or array of hostnames additionally matches absolute links to those hosts. |
icons |
false suppresses the painted entity icon; the card renders name-first. Default true. |
Live demo
Hover or tab to any of these. The card is keyboard-reachable, dismisses on Escape, and never intercepts a click — the link still navigates.
- Attuned Darkshroud Leather (item)
- Kill Greater Earth Elementals (quest)
- Aurora Frostfire (NPC)
- Brandish (spell)
- Blossom Isles (zone)
- Axe of the Titan (recipe)
- Ancient Oak (a
data-ethyrialtrigger, no link)
How it works
- Data Cards are read from the same prebuilt shards the wiki uses,
GET /wiki/tip/<type>/<shard>.json. The shard for a slug isdjb2(slug) % 80as two hex digits — the script computes it for you. - Cross-origin
/tooltips.jsand/wiki/tip/*answer withAccess-Control-Allow-Origin: *andCache-Control: public, max-age=300, so browsers may read them from any page and repeat visitors reuse them. - Isolation The script has no dependencies and loads none of our site CSS. Its
styles live in one injected
<style>scoped under theeth-tip-class prefix, so it cannot collide with your stylesheet. - Markup safety Everything the card prints is written through
textContent; entity names can never inject markup into your page.