From be4f23fd6f8afce067e8c80f9d8d24c9ad719f26 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 19 Jul 2026 00:48:46 +0800 Subject: [PATCH] feat(credits): check-in details modal + history; oneline/tilt widgets Add zibll-like check-in details remote modal (REST/AJAX), history endpoint, header details link, and keep oneline posts + tilt showcase widgets from this batch. --- assets/css/frontend/widget-batch3f.css | 121 +++++++++++ assets/js/enhancements2.js | 4 + inc/helpers/aksrt-header-userbox.php | 19 +- .../user-center-renderers/credits-signin.php | 3 - src/AKSRT/Credits/Signin.php | 190 +++++++++++++++++- 5 files changed, 331 insertions(+), 6 deletions(-) diff --git a/assets/css/frontend/widget-batch3f.css b/assets/css/frontend/widget-batch3f.css index 5ad9a74d..9f1b0d1d 100644 --- a/assets/css/frontend/widget-batch3f.css +++ b/assets/css/frontend/widget-batch3f.css @@ -155,3 +155,124 @@ } .aksrt-tilt__img img { width: 100%; height: 100%; object-fit: cover; display: block; } .aksrt-tilt__img.is-empty { background: linear-gradient(135deg, #dbeafe, #ede9fe); } + + +/* Check-in details modal */ +.aksrt-checkin-modal { padding: 4px 2px 8px; } +.aksrt-checkin-modal__head { + display: flex; + align-items: center; + gap: 8px; + font-size: 16px; + margin-bottom: 14px; +} +.aksrt-checkin-modal__head .aksrt-remote-modal__close { + margin-left: auto; + border: 0; + background: transparent; + font-size: 22px; + line-height: 1; + cursor: pointer; + opacity: .55; +} +.aksrt-checkin-modal__user { + display: flex; + align-items: center; + gap: 10px; + margin-bottom: 12px; +} +.aksrt-checkin-modal__avatar { + width: 40px; + height: 40px; + border-radius: 50%; + object-fit: cover; +} +.aksrt-checkin-modal__name { font-weight: 700; } +.aksrt-checkin-modal__sub { font-size: 12px; color: var(--muted-2-color, #888); } +.aksrt-checkin-modal__wallet { margin-bottom: 12px; } +.aksrt-checkin-modal__wallet-item { + display: flex; + justify-content: space-between; + align-items: center; + padding: 10px 12px; + border-radius: 10px; + background: var(--surface-2, #f3f4f6); + text-decoration: none; + color: inherit; +} +.aksrt-checkin-modal__card { + display: flex; + align-items: center; + justify-content: space-between; + gap: 12px; + padding: 12px; + border-radius: 12px; + border: 1px solid var(--color-line, #e5e7eb); + margin-bottom: 14px; +} +.aksrt-checkin-modal__card-title { font-size: 13px; margin-bottom: 6px; } +.aksrt-checkin-modal__badge { + display: inline-block; + font-size: 12px; + padding: 2px 8px; + border-radius: 999px; + background: #ecfdf5; + color: #059669; +} +.aksrt-checkin-modal__done { text-align: right; color: #2563eb; font-size: 13px; } +.aksrt-checkin-modal__btn { white-space: nowrap; } +.aksrt-checkin-modal__streak-head { + display: flex; + justify-content: space-between; + align-items: center; + font-size: 13px; + margin-bottom: 8px; +} +.aksrt-checkin-modal__ladder { + display: grid; + grid-template-columns: repeat(7, minmax(0, 1fr)); + gap: 6px; + margin-bottom: 14px; +} +.aksrt-checkin-modal__day { + text-align: center; + border-radius: 8px; + padding: 8px 2px; + background: var(--surface-2, #f8fafc); + border: 1px solid transparent; + font-size: 11px; +} +.aksrt-checkin-modal__day.is-done { + background: #eff6ff; + border-color: #bfdbfe; + color: #1d4ed8; +} +.aksrt-checkin-modal__day-n { font-weight: 700; margin-bottom: 2px; } +.aksrt-checkin-modal__cal-title { + font-size: 13px; + margin-bottom: 8px; +} +.aksrt-signin-calendar__grid { + display: grid; + grid-template-columns: repeat(10, minmax(0, 1fr)); + gap: 4px; +} +.aksrt-signin-calendar__day { + aspect-ratio: 1; + border-radius: 6px; + display: flex; + align-items: center; + justify-content: center; + font-size: 11px; + background: var(--surface-2, #f3f4f6); + color: #999; +} +.aksrt-signin-calendar__day.is-signed { + background: #dbeafe; + color: #1d4ed8; + font-weight: 700; +} +.aksrt-signin-calendar__day.is-today { + outline: 1px solid var(--color-primary, #3b82f6); +} +.aksrt-header-checkin-details { text-decoration: none; } diff --git a/assets/js/enhancements2.js b/assets/js/enhancements2.js index 30a136a4..110ef7c3 100644 --- a/assets/js/enhancements2.js +++ b/assets/js/enhancements2.js @@ -302,6 +302,10 @@ initParallax(); initFloatLabels(); initSigninCalendar(); + document.addEventListener('aksrt:remote-modal:open', function () { + // Remote modal may inject calendar markup after open. + window.setTimeout(initSigninCalendar, 30); + }); }); // 暴露到全局供动态内容使用 diff --git a/inc/helpers/aksrt-header-userbox.php b/inc/helpers/aksrt-header-userbox.php index 442ec454..0f293fa9 100644 --- a/inc/helpers/aksrt-header-userbox.php +++ b/inc/helpers/aksrt-header-userbox.php @@ -39,17 +39,32 @@ if (!function_exists('aksrt_header_user_checkin_btn')) : $signed = false; } + $details = ''; + if (function_exists('aksrt_get_remote_modal_link')) { + $details = aksrt_get_remote_modal_link([ + 'tag' => 'a', + 'class' => 'aksrt-header-checkin-details muted-2-color em09 mt6 block text-center', + 'text' => __('签到详情', 'aksrt'), + 'query_arg' => ['action' => 'aksrt_checkin_details_modal'], + 'data_class' => 'modal-mini full-sm', + 'height' => 420, + 'mobile_bottom' => true, + ]); + } + if ($signed) { return ''; + . '' + . $details; } return ''; + . '' + . $details; } endif; diff --git a/inc/helpers/user-center-renderers/credits-signin.php b/inc/helpers/user-center-renderers/credits-signin.php index 5a9973de..335bfc2c 100644 --- a/inc/helpers/user-center-renderers/credits-signin.php +++ b/inc/helpers/user-center-renderers/credits-signin.php @@ -30,9 +30,6 @@ if (class_exists('\AKSRT\Credits\Signin')) { }, $signin_log)); } -if (empty($signin_dates)) { - return; -} ?>