| @@ -460,7 +460,7 @@ function createHelperUpgrades() { | |||||
| "desc": text.desc, | "desc": text.desc, | ||||
| "icon": [ | "icon": [ | ||||
| { icon: "fa-hand-holding", color: "black" }, | { icon: "fa-hand-holding", color: "black" }, | ||||
| { icon: buildings[helper].icon, color: "red" } | |||||
| { icon: buildings[helped].icon, color: "red", transform: "scale(0.5, 0.5) translate(0, -30px)" } | |||||
| ], | ], | ||||
| "cost": { | "cost": { | ||||
| "food": buildings[helper].cost.food * 25 * counter + buildings[helped].cost.food * 50 * counter | "food": buildings[helper].cost.food * 25 * counter + buildings[helped].cost.food * 50 * counter | ||||
| @@ -360,14 +360,26 @@ button { | |||||
| box-shadow: inset 0px 0px 0px 2px black; | box-shadow: inset 0px 0px 0px 2px black; | ||||
| } | } | ||||
| .upgrade-button > .fas { | |||||
| width: 100px; | |||||
| height: 100px; | |||||
| font-size: 60px; | |||||
| transform: translate(-50px, 10px); | |||||
| .upgrade-button > .upgrade-icon-holder { | |||||
| width: 80px; | |||||
| height: 80px; | |||||
| opacity: 0.8; | opacity: 0.8; | ||||
| pointer-events: none; | pointer-events: none; | ||||
| position: absolute; | position: absolute; | ||||
| display: flex; | |||||
| transform: translate(0, 10px); | |||||
| } | |||||
| [class^="fa-"], [class*=" fa-"] { | |||||
| display: inline-block; | |||||
| height: 100%; | |||||
| width: 100%; | |||||
| } | |||||
| .upgrade-icon-holder > .fas { | |||||
| position: absolute; | |||||
| font-size: 60px; | |||||
| text-align: center; | |||||
| } | } | ||||
| .upgrade-button:hover { | .upgrade-button:hover { | ||||
| @@ -863,19 +863,26 @@ function createUpgrades() { | |||||
| button.classList.add("hidden"); | button.classList.add("hidden"); | ||||
| button.id = "upgrade-" + key; | button.id = "upgrade-" + key; | ||||
| const holder = document.createElement("div"); | |||||
| holder.classList.add("upgrade-icon-holder"); | |||||
| button.appendChild(holder); | |||||
| if (typeof(value.icon) == "object") { | if (typeof(value.icon) == "object") { | ||||
| value.icon.forEach(icon => { | value.icon.forEach(icon => { | ||||
| let upgradeIcon = document.createElement("i"); | let upgradeIcon = document.createElement("i"); | ||||
| upgradeIcon.classList.add("fas"); | upgradeIcon.classList.add("fas"); | ||||
| upgradeIcon.classList.add(icon.icon); | upgradeIcon.classList.add(icon.icon); | ||||
| upgradeIcon.style.color = icon.color; | upgradeIcon.style.color = icon.color; | ||||
| button.appendChild(upgradeIcon); | |||||
| holder.appendChild(upgradeIcon); | |||||
| if (icon.transform) { | |||||
| upgradeIcon.style.transform = icon.transform; | |||||
| } | |||||
| }) | }) | ||||
| } else { | } else { | ||||
| let upgradeIcon = document.createElement("i"); | let upgradeIcon = document.createElement("i"); | ||||
| upgradeIcon.classList.add("fas"); | upgradeIcon.classList.add("fas"); | ||||
| upgradeIcon.classList.add(value.icon); | upgradeIcon.classList.add(value.icon); | ||||
| button.appendChild(upgradeIcon); | |||||
| holder.appendChild(upgradeIcon); | |||||
| } | } | ||||