light.gg

Welcome to light.gg!

Let's Go Not Now

Destiny 2 Item Tooltips β

Have a Destiny 2 fansite that you'd like to show game information on, but don't want to jump through the hoops of parsing the API yourself?

We have you covered.

By including a simple script in your site's HTML, you will be able to show tooltips similar to those you see here:

Felwinter's Lie

Installation

  1. Add the following HTML to the <head> section of your page:
    <script>window['lggTT'] = { }</script>
    <script type="text/javascript" src="https://light.gg/tooltips.js" async></script>
    
  2. Add links to light.gg pages - that's all it takes

Demo

Check out a working demo of the tooltip builder here. It shows how the tooltip manifests with different entity types, different positions on the page, different languages, etc.

Supported Entities

The following Destiny API entities are currently supported:

Language Support

There are multiple ways to swap the language used by the tooltip builder away from its default of English. These are listed in order of precedence, meaning each subsequent way of specifying the language will override the previous.

  1. Explicitly specifying the language you want all tooltips to use with the 'lang' option. See below for full details.
    <script>window['lggTT'] = { lang: 'fr' }</script>
    
  2. Linking to a page that is already in another language, such as
    https://www.light.gg/db/fr/items/1179141605
    
  3. Specifying what language you want on a link-by-link basis, using the 'lang' querystring parameter, such as
    https://www.light.gg/db/fr/items/1179141605?lang=ko
    

Configuration & Customization

The tooltip builder has several options to help you customize the tooltips that show up on your site. Each of these options can be configured by adding them to the lggTT object in your installation script. You can set as many or as few of these options as you like - they all have their default values specified below.

darkMode

Type: boolean

Default: false

<script>window['lggTT'] = { darkMode: true }</script>

Switches the tooltips to a dark theme

lang

Type: string

Default: en

<script>window['lggTT'] = { lang: 'fr' }</script>

Switches the language used in the tooltips that appear. Use the code for the appropriate language from the table below.

Available languages:
Language Code
English (Default) en
Deutsch de
Español es
Español mexicano es-mx
Français fr
Italiano it
日本語 ja
한국어 ko
Polski pl
Português do Brasil pt-br
Русский ru
文言 zh-cht

recolorLinks

Type: boolean

Default: true

<script>window['lggTT'] = { recolorLinks: false }</script>

When true, the tooltip builder will recolor all links that show tooltips to match their rarity (such as purple for Legendary, gold for Exotic, etc), where possible.

Capped at the first 50 links per page

renameLinks

Type: boolean

Default: false

<script>window['lggTT'] = { renameLinks: true }</script>

When true, the tooltip builder will change the innerText of all links that show tooltips to match the proper name for the entity the tooltip is tied to. Note that this option takes the 'lang' setting (see above) into account when deciding what name to use.

Capped at the first 50 links per page

showDescription

Type: boolean

Default: true

<script>window['lggTT'] = { showDescription: false }</script>

Specifies whether or not to include the entity's description text as part of the tooltip. This usually only manifests on things like Bounties, Quests, Triumphs, etc.

showIcon

Type: boolean

Default: true

<script>window['lggTT'] = { showIcon: false }</script>

Specifies whether or not to include the entity's icon as part of the tooltip.

showLoreExerpt

Type: boolean

Default: true

<script>window['lggTT'] = { showLoreExerpt: false }</script>

Specifies whether or not to include a short exerpt of the lore. Only applies to lore triumphs.

showObtainedFrom

Type: boolean

Default: true

<script>window['lggTT'] = { showObtainedFrom: false }</script>

Specifies whether or not to include the entity's collectible hint as to where it can be obtained. Only applies to items.

showPerks

Type: boolean

Default: true

<script>window['lggTT'] = { showPerks: false }</script>

Specifies whether or not to include the entity's key perks as part of the tooltip. Only applies to items.

showTriumphObjectives

Type: boolean

Default: true

<script>window['lggTT'] = { showTriumphObjectives: false }</script>

Specifies whether or not to include a list of the objectives required to complete a triumph. Only applies to triumphs.