feat(frontend): replace lazy loading with zibll lazysizes

This commit is contained in:
kate522 committed 2026-08-18 01:33:38 +08:00
1 parent 02571eecd6
commit 435ee1daa7
78 files changed
+1515 -909

No files matched your search

@@ -52,7 +52,7 @@ if ($vip_level >= 1 && !empty($vip_settings['levels'][$vip_level]['name'])) {
$level_icon_url = esc_url((string) ($vip_settings['levels'][$vip_level]['img_icon'] ?? ''));
$level_icon = $level_icon_url !== ''
? '<img class="aksrt-vip-level-icon" src="' . $level_icon_url . '" alt="" loading="lazy" decoding="async">'
? '<img' . aksrt_get_lazy_attr('lazy_other', $level_icon_url, 'aksrt-vip-level-icon') . ' alt="" decoding="async">'
: '<i class="fas fa-crown" aria-hidden="true"></i>';
if (class_exists('\AKSRT\Settings\Settings')) {
$paid_display = \AKSRT\Settings\Settings::get_paid_content_settings();
@@ -63,7 +63,7 @@ $day_max = \AKSRT\User\Level::day_max();
<div class="uc-level-road__item<?php echo esc_attr($state); ?>">
<div class="uc-level-road__icon">
<?php $icon = \AKSRT\User\Level::get_level_icon_url($level); ?>
<?php if ($icon !== '') : ?><img src="<?php echo esc_url($icon); ?>" alt="" loading="lazy"><?php else : ?><span>LV<?php echo esc_html((string) $level); ?></span><?php endif; ?>
<?php if ($icon !== '') : ?><img<?php echo aksrt_get_lazy_attr('lazy_other', (string) $icon); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> alt=""><?php else : ?><span>LV<?php echo esc_html((string) $level); ?></span><?php endif; ?>
</div>
<strong><?php echo esc_html($name); ?></strong>
<small><?php echo esc_html((string) $need); ?> EXP</small>
@@ -48,7 +48,7 @@ if ($vip_level > 0) {
$sidebar_level = $vip_level > 0 ? $vip_level : $expired_level;
$sidebar_icon_url = esc_url((string) ($vip_levels[$sidebar_level]['img_icon'] ?? ''));
$sidebar_icon = $sidebar_icon_url !== ''
? '<img class="aksrt-vip-level-icon" src="' . $sidebar_icon_url . '" alt="" loading="lazy" decoding="async">'
? '<img' . aksrt_get_lazy_attr('lazy_other', $sidebar_icon_url, 'aksrt-vip-level-icon') . ' alt="" decoding="async">'
: '<i class="fas fa-crown" aria-hidden="true"></i>';
?>
<a class="uc-sidebar-vip" href="<?php echo esc_url($vip_url); ?>" data-tab="vip">
@@ -92,7 +92,7 @@ if ($level > 0) {
$status_icon_url = esc_url((string) ($levels[$vip_level_number]['img_icon'] ?? ''));
$status_icon = $status_icon_url !== ''
? '<img class="aksrt-vip-level-icon" src="' . $status_icon_url . '" alt="" loading="lazy" decoding="async">'
? '<img' . aksrt_get_lazy_attr('lazy_other', $status_icon_url, 'aksrt-vip-level-icon') . ' alt="" decoding="async">'
: '<i class="fas fa-crown"></i>';
$status_html = '<div class="uc-vip-status" role="status">'
. '<div class="uc-vip-status__heading">'
@@ -124,7 +124,7 @@ foreach ([1, 2] as $lv) {
$vip_attr = $lv;
$lv_icon_url = esc_url((string) ($levels[$lv]['img_icon'] ?? ''));
$lv_icon = $lv_icon_url !== ''
? '<img class="aksrt-vip-level-icon" src="' . $lv_icon_url . '" alt="" loading="lazy" decoding="async">'
? '<img' . aksrt_get_lazy_attr('lazy_other', $lv_icon_url, 'aksrt-vip-level-icon') . ' alt="" decoding="async">'
: '<i class="fas fa-crown" aria-hidden="true"></i>';
if (str_starts_with($btn_type, 'renew_')) {
$renew_lv = (int) substr($btn_type, 6);