进行了一些小优化
This commit is contained in:
@@ -69,6 +69,9 @@
|
||||
.zib-widget.padding-10 { padding:10px; }
|
||||
.zib-widget.nobottom.notop { padding-top:0; padding-bottom:0; }
|
||||
|
||||
.user-card__auth-btns { display: inline-flex; flex-wrap: nowrap; align-items: center; justify-content: center; gap: 10px; }
|
||||
.user-card__auth-btns .but { margin: 0; }
|
||||
|
||||
.aksrt-widget-video { position: relative; overflow: hidden; border-radius: var(--aksrt-widget-radius); background: #000; aspect-ratio: 16 / 9; }
|
||||
.aksrt-widget-video--4-3 { aspect-ratio: 4 / 3; }.aksrt-widget-video--1-1 { aspect-ratio: 1; }.aksrt-widget-video--auto { aspect-ratio: auto; }
|
||||
.aksrt-widget-video video, .aksrt-widget-video__player, .aksrt-widget-video .dplayer { width: 100%; height: 100%; }
|
||||
|
||||
@@ -30,7 +30,6 @@ final class UserRenderer {
|
||||
}
|
||||
|
||||
return self::card_box($user_id, [
|
||||
'class' => 'widget',
|
||||
'show_posts' => false,
|
||||
'show_checkin' => true,
|
||||
'show_img_bg' => !isset($i['show_img_bg']) || !empty($i['show_img_bg']),
|
||||
@@ -49,7 +48,6 @@ final class UserRenderer {
|
||||
$post_style = sanitize_key((string) ($i['post_style'] ?? 'mini'));
|
||||
|
||||
return self::card_box((int) $user->ID, [
|
||||
'class' => 'widget',
|
||||
'show_img_bg' => !isset($i['show_img_bg']) || !empty($i['show_img_bg']),
|
||||
'show_posts' => !isset($i['show_posts']) || !empty($i['show_posts']),
|
||||
'limit' => max(0, min(12, (int) ($i['limit'] ?? 6))),
|
||||
@@ -100,14 +98,14 @@ final class UserRenderer {
|
||||
}
|
||||
}
|
||||
|
||||
return '<div class="user-card zib-widget widget">' . $cover
|
||||
return '<div class="user-card zib-widget">' . $cover
|
||||
. '<div class="card-content mt10">'
|
||||
. '<div class="user-content">'
|
||||
. '<div class="user-avatar">' . $avatar . '</div>'
|
||||
. '<div class="user-info mt10">'
|
||||
. '<div class="text-center box-body">'
|
||||
. '<p class="muted-color box-body em12">' . esc_html($title) . '</p>'
|
||||
. '<p>' . $buttons . '</p>'
|
||||
. '<p class="user-card__auth-btns">' . $buttons . '</p>'
|
||||
. $oauth_html
|
||||
. '</div></div></div></div></div>';
|
||||
}
|
||||
@@ -116,11 +114,10 @@ final class UserRenderer {
|
||||
* 登录卡片(legacy zib_get_user_card_box parity)。
|
||||
*
|
||||
* @param int $user_id 卡片用户。
|
||||
* @param array $args class/show_posts/show_checkin/show_img_bg/show_button/button_1,2 与文章模块参数。
|
||||
* @param array $args show_posts/show_checkin/show_img_bg/show_button/button_1,2 与文章模块参数。
|
||||
*/
|
||||
private static function card_box(int $user_id, array $args = []): string {
|
||||
$args = wp_parse_args($args, [
|
||||
'class' => '',
|
||||
'show_posts' => true,
|
||||
'show_checkin' => false,
|
||||
'show_img_bg' => false,
|
||||
@@ -185,7 +182,7 @@ final class UserRenderer {
|
||||
$cover = '<div class="user-cover graphic" style="padding-bottom: 50%;"><img' . aksrt_get_lazy_attr('lazy_cover', $cover_url, 'fit-cover user-cover', aksrt_get_lazy_thumb()) . ' alt="' . esc_attr__('用户封面', 'aksrt') . '"></div>';
|
||||
}
|
||||
|
||||
return '<div class="user-card zib-widget ' . esc_attr((string) $args['class']) . '">' . $cover
|
||||
return '<div class="user-card zib-widget">' . $cover
|
||||
. '<div class="card-content mt10 relative">'
|
||||
. '<div class="user-content">' . $checkin
|
||||
. '<div class="user-avatar">' . $avatar . '</div>'
|
||||
|
||||
Reference in New Issue
Block a user