dynamic medal size

This commit is contained in:
xiaomlove
2022-08-11 18:49:37 +08:00
parent 8071efd487
commit 46d8e3d951
2 changed files with 10 additions and 4 deletions
+10 -3
View File
@@ -3695,7 +3695,9 @@ function get_username($id, $big = false, $link = true, $bold = true, $target = f
$leechwarnpic = "leechwarnedbig";
$warnedpic = "warnedbig";
$disabledpic = "disabledbig";
$style = "style='margin-left: 4pt'";
$marginLeft = '4pt';
$medalSize = '16px';
$style = "style='margin-left: $marginLeft'";
}
else
{
@@ -3703,7 +3705,9 @@ function get_username($id, $big = false, $link = true, $bold = true, $target = f
$leechwarnpic = "leechwarned";
$warnedpic = "warned";
$disabledpic = "disabled";
$style = "style='margin-left: 2pt'";
$marginLeft = '2pt';
$medalSize = '11px';
$style = "style='margin-left: $marginLeft'";
}
$pics = $arr["donor"] == "yes" && ($arr['donoruntil'] === null || $arr['donoruntil'] < '1970' || $arr['donoruntil'] >= date('Y-m-d H:i:s')) ? "<img class=\"".$donorpic."\" src=\"/pic/trans.gif\" alt=\"Donor\" ".$style." />" : "";
@@ -3737,7 +3741,10 @@ function get_username($id, $big = false, $link = true, $bold = true, $target = f
//medal
$medalHtml = '';
foreach ($arr['wearing_medals'] as $medal) {
$medalHtml .= sprintf('<img src="%s" title="%s" class="preview" style="max-height: 16px;max-width: 16px;margin-left: 2pt"/>', $medal['image_large'], $medal['name']);
$medalHtml .= sprintf(
'<img src="%s" title="%s" class="preview" style="max-height: %s;max-width: %s;margin-left: %s"/>',
$medal['image_large'], $medal['name'], $medalSize, $medalSize, $marginLeft
);
}
$href = getSchemeAndHttpHost() . "/userdetails.php?id=$id";
-1
View File
@@ -10,7 +10,6 @@ jQuery(document).ready(function () {
var previewEle = jQuery('#nexus-preview')
jQuery("body").on("mouseover", ".preview", function (e) {
console.log(e)
let src = jQuery(this).attr("src")
if (src) {
previewEle.attr("src", src).css({"display": "block", "left": e.pageX + 5, "top": e.pageY + 5})