many styling fixes, esp. for both landscape & portrait mobile UX tooltips & navbar; core.settings now permits another device on local net to access dev server
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
@@ -9,10 +9,13 @@ function initGameKitTooltips() {
|
||||
token.addEventListener('mouseenter', () => {
|
||||
const rect = token.getBoundingClientRect();
|
||||
portal.innerHTML = tooltip.innerHTML;
|
||||
portal.style.left = Math.round(rect.left + rect.width / 2) + 'px';
|
||||
portal.classList.add('active');
|
||||
const halfW = portal.offsetWidth / 2;
|
||||
const rawLeft = rect.left + rect.width / 2;
|
||||
const clampedLeft = Math.max(halfW + 8, Math.min(rawLeft, window.innerWidth - halfW - 8));
|
||||
portal.style.left = Math.round(clampedLeft) + 'px';
|
||||
portal.style.top = Math.round(rect.top) + 'px';
|
||||
portal.style.transform = 'translate(-50%, calc(-100% - 0.5rem))';
|
||||
portal.classList.add('active');
|
||||
});
|
||||
|
||||
token.addEventListener('mouseleave', () => {
|
||||
|
||||
@@ -51,6 +51,21 @@ class Wallet(models.Model):
|
||||
writs = models.IntegerField(default=0)
|
||||
esteem = models.IntegerField(default=0)
|
||||
|
||||
def tooltip_name(self):
|
||||
return "Wallet"
|
||||
|
||||
def tooltip_description(self):
|
||||
return f"{self.writs} writs · {self.esteem} esteem"
|
||||
|
||||
def tooltip_shoptalk(self):
|
||||
return None
|
||||
|
||||
def tooltip_expiry(self):
|
||||
return None
|
||||
|
||||
def tooltip_text(self):
|
||||
return f"{self.tooltip_name()}: {self.tooltip_description()}"
|
||||
|
||||
class Token(models.Model):
|
||||
COIN = "coin"
|
||||
FREE = "Free"
|
||||
|
||||
Reference in New Issue
Block a user