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:
<script>window['lggTT'] = { }</script> <script type="text/javascript" src="https://light.gg/tooltips.js" async></script>
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.
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.
<script>window['lggTT'] = { lang: 'fr' }</script>
https://www.light.gg/db/fr/items/1179141605
https://www.light.gg/db/fr/items/1179141605?lang=ko
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.
<script>window['lggTT'] = { darkMode: true }</script>
Switches the tooltips to a dark theme
<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.
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 |
<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
<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
<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.
<script>window['lggTT'] = { showIcon: false }</script>
Specifies whether or not to include the entity's icon as part of the tooltip.
<script>window['lggTT'] = { showLoreExerpt: false }</script>
Specifies whether or not to include a short exerpt of the lore. Only applies to lore triumphs.
<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.
<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.
<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.