Improved tooltips

This commit is contained in:
Eduard Urbach 2018-04-18 13:42:38 +02:00
parent a219e11f8f
commit 40324d445a
4 changed files with 4 additions and 3 deletions

View File

@ -8,7 +8,7 @@ component Inventory(inventory *arn.Inventory, viewUser *arn.User, user *arn.User
if slot.ItemID == "" if slot.ItemID == ""
.inventory-slot.mountable(draggable="false", data-index=index) .inventory-slot.mountable(draggable="false", data-index=index)
else else
.inventory-slot.mountable(title=slot.Item().Name, draggable="true", data-index=index, data-item-id=slot.ItemID, data-consumable=slot.Item().Consumable) .inventory-slot.tip.mountable(aria-label=slot.Item().Name, draggable="true", data-index=index, data-item-id=slot.ItemID, data-consumable=slot.Item().Consumable)
.shop-item-icon .shop-item-icon
Icon(slot.Item().Icon) Icon(slot.Item().Icon)
if slot.Quantity > 1 if slot.Quantity > 1

View File

@ -25,7 +25,7 @@ component SoundTrackPage(track *arn.SoundTrack, user *arn.User)
.soundtrack-anime-list .soundtrack-anime-list
each anime in track.Anime() each anime in track.Anime()
a.soundtrack-anime-list-item(href=anime.Link(), title=anime.Title.ByUser(user)) a.soundtrack-anime-list-item.tip(href=anime.Link(), aria-label=anime.Title.ByUser(user))
img.soundtrack-anime-list-item-image.lazy(data-src=anime.ImageLink("small"), data-webp="true", data-color=anime.AverageColor(), alt=anime.Title.ByUser(user)) img.soundtrack-anime-list-item-image.lazy(data-src=anime.ImageLink("small"), data-webp="true", data-color=anime.AverageColor(), alt=anime.Title.ByUser(user))
if len(track.Links) > 0 if len(track.Links) > 0

View File

@ -256,7 +256,7 @@ export default class AnimeNotifier {
return return
} }
let itemName = element.title let itemName = element.getAttribute("aria-label")
if(element.dataset.consumable !== "true") { if(element.dataset.consumable !== "true") {
return this.statusMessage.showError(itemName + " is not a consumable item.") return this.statusMessage.showError(itemName + " is not a consumable item.")

View File

@ -14,6 +14,7 @@ const tip-transform-visible = rotate(0.02deg) translateX(-50%) translateY(-100%)
pointer-events none pointer-events none
opacity 0 opacity 0
transform tip-transform-hidden transform tip-transform-hidden
font-size 0.92rem
color text-color color text-color
text-shadow none text-shadow none
padding 0.2rem 0.7rem padding 0.2rem 0.7rem