Browse Source

Move the powerup tooltip a bit

tags/v0.1.0
Fen Dweller 5 years ago
parent
commit
43121ee453
No known key found for this signature in database GPG Key ID: E80B35A6F11C3656
1 changed files with 2 additions and 4 deletions
  1. +2
    -4
      gorge.js

+ 2
- 4
gorge.js View File

@@ -1337,12 +1337,10 @@ function powerupTooltip(id, event) {
let tooltip = document.querySelector("#powerup-tooltip"); let tooltip = document.querySelector("#powerup-tooltip");
tooltip.style.setProperty("display", "inline-block"); tooltip.style.setProperty("display", "inline-block");


const count = buildingCount();

fillTooltip("powerup", "name", powerups[id].name); fillTooltip("powerup", "name", powerups[id].name);
fillTooltip("powerup", "desc", powerups[id].description); fillTooltip("powerup", "desc", powerups[id].description);


let xPos = tooltip.parentElement.getBoundingClientRect().x + 450;
let xPos = tooltip.parentElement.getBoundingClientRect().x + 100;


// wow browsers are bad // wow browsers are bad


@@ -1351,7 +1349,7 @@ function powerupTooltip(id, event) {


var height = Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight); var height = Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight);


let yPos = Math.min(event.clientY, height - 200);
let yPos = Math.min(event.clientY - 100, height - 150);


tooltip.style.setProperty("transform", "translate(" + xPos + "px, " + yPos + "px)") tooltip.style.setProperty("transform", "translate(" + xPos + "px, " + yPos + "px)")
} }


Loading…
Cancel
Save