fix(widgets): align user card presentation

This commit is contained in:
2026-08-14 21:41:12 +08:00
parent d1d33e2671
commit 483313e396
2 changed files with 4 additions and 31 deletions
+3 -24
View File
@@ -38,9 +38,9 @@
position: relative;
box-sizing: border-box;
width: 100%;
height: 104px;
min-height: 104px;
max-height: 104px;
height: 139px;
min-height: 139px;
max-height: 139px;
margin: 0;
padding: 0 !important;
overflow: hidden;
@@ -122,27 +122,6 @@
height: 100%;
object-fit: cover;
}
.aksrt-user-card__avatar-wrap > .aksrt-vip-badge {
position: absolute;
right: -5px;
bottom: -3px;
z-index: 2;
display: inline-flex;
align-items: center;
justify-content: center;
width: 28px;
height: 28px;
max-width: none;
padding: 0;
line-height: 1;
}
.aksrt-user-card__avatar-wrap > .aksrt-vip-badge .aksrt-vip-badge__icon {
display: block;
width: 100%;
height: 100%;
max-width: 100%;
object-fit: contain;
}
.aksrt-user-card__name {
display: flex;
align-items: center;
+1 -7
View File
@@ -122,14 +122,11 @@ class WidgetUserCard extends \WP_Widget {
$name_html = function_exists('aksrt_get_user_name')
? aksrt_get_user_name([
'id' => $user_id,
'vip' => false,
'vip' => true,
'follow' => !$is_self,
'class' => 'aksrt-user-card__name-row',
])
: '<a href="' . esc_url($profile_url) . '">' . esc_html($user->display_name) . '</a>';
$vip_badge = function_exists('aksrt_render_vip_badge')
? (string) aksrt_render_vip_badge($user_id, 'sm')
: '';
$checkin_btn = '';
if ($show_checkin && $is_self && function_exists('aksrt_header_user_checkin_btn')) {
$checkin_btn = aksrt_header_user_checkin_btn($user_id, true);
@@ -150,9 +147,6 @@ class WidgetUserCard extends \WP_Widget {
$ph = get_template_directory_uri() . '/assets/img/placeholder.svg';
echo '<a href="' . esc_url($profile_url) . '"><img class="aksrt-lazy lazyload" data-src="' . esc_url($avatar_url) . '" src="' . esc_url($ph) . '" alt="' . esc_attr($user->display_name) . '" loading="lazy" width="76" height="76" /></a>';
echo '</div>';
if ($vip_badge !== '') {
echo $vip_badge; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
echo '</div>';
echo '<h4 class="aksrt-user-card__name user-name">' . $name_html . '</h4>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
if ($bio !== '') {