fix(nav): publish menu contrast, check-in toast and button layout

Use solid light plate + forced ink on 发布 items, notyf instead of alert,
and keep header check-in flex layout after success.
This commit is contained in:
kate522 committed 2026-07-22 09:09:02 +08:00
1 parent 77164fee45
commit 35ac26db28
5 files changed
+238 -81

No files matched your search

+129 -53
View File
@@ -17,14 +17,18 @@
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
min-width: 0; min-width: 0;
flex: 0 0 auto;
width: auto;
max-width: none;
} }
/* CTA button base: flex icon + text, never stack or clip glyphs */ /* CTA paint only on actual anchors/buttons — never on hover wrappers */
.navbar-but-cluster .navbar-cta, .navbar-but-cluster a.navbar-cta,
.navbar-but-cluster .btn-primary, .navbar-but-cluster a.btn-primary,
.navbar-but-cluster .but.btn-primary, .navbar-but-cluster a.but.btn-primary,
.navbar-but-cluster .navbar-newposts.but, .navbar-but-cluster a.navbar-newposts.but,
.navbar-but-cluster a.but { .navbar-but-cluster a.but,
.navbar-but-cluster button.navbar-cta {
display: inline-flex !important; display: inline-flex !important;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
@@ -32,7 +36,7 @@
padding: 6px 14px; padding: 6px 14px;
border-radius: var(--navbar-cta-radius, 20px); border-radius: var(--navbar-cta-radius, 20px);
background: var(--color-primary, #2f6df6); background: var(--color-primary, #2f6df6);
color: #fff; color: #fff !important;
text-decoration: none; text-decoration: none;
border: 0; border: 0;
font-size: 13px; font-size: 13px;
@@ -40,27 +44,44 @@
white-space: nowrap; white-space: nowrap;
box-sizing: border-box; box-sizing: border-box;
vertical-align: middle; vertical-align: middle;
flex: 0 0 auto;
width: auto;
max-width: none;
height: auto;
min-height: 0;
} }
.navbar-but-cluster .navbar-cta > i, .navbar-but-cluster a.navbar-cta > i,
.navbar-but-cluster a.but > i, .navbar-but-cluster a.but > i,
.navbar-but-cluster .btn-primary > i { .navbar-but-cluster a.btn-primary > i,
.navbar-but-cluster a.navbar-cta .navbar-cta-text,
.navbar-but-cluster a.navbar-cta > span:not(.badge) {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
width: 1em;
height: 1em;
margin: 0 !important; margin: 0 !important;
flex: 0 0 auto; flex: 0 0 auto;
line-height: 1;
font-size: 1em;
}
.navbar-but-cluster .navbar-cta-text,
.navbar-but-cluster .navbar-cta > span:not(.badge) {
display: inline-block;
line-height: 1.2; line-height: 1.2;
white-space: nowrap; white-space: nowrap;
color: inherit !important;
}
.navbar-but-cluster a.navbar-cta > i,
.navbar-but-cluster a.but > i,
.navbar-but-cluster a.btn-primary > i {
width: 1em;
height: 1em;
font-size: 1em;
line-height: 1;
}
/* Multi-type toggle keeps fixed CTA size when menu opens (focus-within). */
.navbar-but-cluster .newadd-btns__toggle.navbar-cta,
.navbar-but-cluster a.newadd-btns__toggle {
flex: 0 0 auto !important;
width: auto !important;
min-width: 0;
max-width: none;
} }
.navbar-but-cluster .payvip-icon.but, .navbar-but-cluster .payvip-icon.but,
@@ -78,52 +99,70 @@
} }
/* Publish multi-type dropdown */ /* Publish multi-type dropdown */
.navbar-but-cluster .newadd-btns.hover-show,
.newadd-btns.hover-show { .newadd-btns.hover-show {
position: relative; position: relative;
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
align-self: center;
z-index: 20; z-index: 20;
/* Wrapper must not inherit CTA paint (pink/primary fill + white text). */ /* Wrapper must never look like the CTA (no fill, no stretch when open). */
background: transparent !important; background: transparent !important;
color: inherit; color: inherit !important;
padding: 0; padding: 0 !important;
border: 0; margin: 0;
box-shadow: none; border: 0 !important;
box-shadow: none !important;
width: auto !important;
min-width: 0;
max-width: none;
height: auto !important;
flex: 0 0 auto;
white-space: nowrap;
} }
.navbar-but-cluster .newadd-btns .drop-newadd,
.navbar-but-cluster .newadd-btns .hover-show-con,
.newadd-btns .drop-newadd, .newadd-btns .drop-newadd,
.newadd-btns .hover-show-con { .newadd-btns .hover-show-con {
display: block; display: block !important;
position: absolute; position: absolute !important;
top: calc(100% + 0px); top: calc(100% + 4px) !important;
right: 0; right: 0 !important;
min-width: 148px; left: auto !important;
margin: 0; float: none !important;
padding: 6px 0; width: max-content !important;
padding-top: 10px; /* bridge gap so pointer can move into menu */ min-width: 160px;
background: transparent; max-width: min(240px, 80vw);
border: 0; margin: 0 !important;
box-shadow: none; /* Top bridge so pointer can move into menu without collapsing hover */
padding: 8px 0 6px !important;
/* Solid plate — guarantees readable ink contrast in light mode */
background: #ffffff !important;
color: #222222 !important;
border: 1px solid rgba(0, 0, 0, 0.08) !important;
border-radius: 8px !important;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
opacity: 0; opacity: 0;
visibility: hidden; visibility: hidden;
transform: translateY(6px); transform: translateY(6px);
transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s; transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
z-index: 50; z-index: 1200 !important;
pointer-events: none; pointer-events: none;
box-sizing: border-box;
} }
/* Hide decorative plate — real background is on the panel itself */
.newadd-btns .drop-newadd::before, .newadd-btns .drop-newadd::before,
.newadd-btns .hover-show-con.drop-newadd::before { .newadd-btns .hover-show-con.drop-newadd::before {
content: ""; content: none !important;
display: block; display: none !important;
background: var(--main-bg-color, #fff);
border-radius: 8px;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
position: absolute;
inset: 6px 0 0 0;
z-index: -1;
} }
.navbar-but-cluster .newadd-btns.hover-show:hover .drop-newadd,
.navbar-but-cluster .newadd-btns.hover-show:hover .hover-show-con,
.navbar-but-cluster .newadd-btns.hover-show:focus-within .drop-newadd,
.navbar-but-cluster .newadd-btns.hover-show:focus-within .hover-show-con,
.newadd-btns.hover-show:hover .drop-newadd, .newadd-btns.hover-show:hover .drop-newadd,
.newadd-btns.hover-show:hover .hover-show-con, .newadd-btns.hover-show:hover .hover-show-con,
.newadd-btns.hover-show:focus-within .drop-newadd, .newadd-btns.hover-show:focus-within .drop-newadd,
@@ -134,40 +173,77 @@
pointer-events: auto; pointer-events: auto;
} }
.navbar-but-cluster .newadd-btns .newadd-btns__item,
.newadd-btns .drop-newadd .newadd-btns__item,
.newadd-btns__item { .newadd-btns__item {
display: flex; display: flex !important;
align-items: center; align-items: center;
gap: 8px; gap: 8px;
padding: 8px 14px; padding: 8px 14px !important;
/* Explicit ink color — never inherit white from CTA toggle. */ margin: 0;
color: var(--color-ink, #222); width: 100% !important;
text-decoration: none; height: auto !important;
min-height: 0;
border: 0 !important;
border-radius: 0;
background: transparent !important;
/* Force dark ink — never inherit CTA white */
color: #222 !important;
text-decoration: none !important;
white-space: nowrap; white-space: nowrap;
position: relative; position: relative;
box-sizing: border-box;
font-size: 13px !important;
font-weight: 500;
line-height: 1.35;
opacity: 1 !important;
} }
.navbar-but-cluster .newadd-btns .newadd-btns__item > i,
.newadd-btns__item > i { .newadd-btns__item > i {
width: 1em; width: 1em;
margin: 0; margin: 0 !important;
text-align: center; text-align: center;
flex: 0 0 auto; flex: 0 0 auto;
color: inherit !important;
opacity: 0.9;
} }
.navbar-but-cluster .newadd-btns .newadd-btns__item > span,
.newadd-btns__item > span {
color: inherit !important;
line-height: 1.35;
}
.navbar-but-cluster .newadd-btns .newadd-btns__item:hover,
.newadd-btns .drop-newadd .newadd-btns__item:hover,
.newadd-btns__item:hover { .newadd-btns__item:hover {
background: var(--surface-2, rgba(0, 0, 0, 0.04)); background: var(--surface-2, rgba(0, 0, 0, 0.06)) !important;
color: var(--focus-color, var(--color-primary)); color: var(--color-primary, #f04494) !important;
}
html.dark .newadd-btns .drop-newadd,
html.dark .newadd-btns .hover-show-con,
body.dark-theme .newadd-btns .drop-newadd,
body.dark-theme .newadd-btns .hover-show-con,
body.theme-dark .newadd-btns .drop-newadd,
body.theme-dark .newadd-btns .hover-show-con {
background: #323335 !important;
color: #f8fafc !important;
border-color: rgba(255, 255, 255, 0.08) !important;
} }
html.dark .newadd-btns__item, html.dark .newadd-btns__item,
body.dark-theme .newadd-btns__item, body.dark-theme .newadd-btns__item,
body.theme-dark .newadd-btns__item { body.theme-dark .newadd-btns__item {
color: var(--color-ink, #f8fafc); color: #f1f5f9 !important;
} }
html.dark .newadd-btns__item:hover, html.dark .newadd-btns__item:hover,
body.dark-theme .newadd-btns__item:hover, body.dark-theme .newadd-btns__item:hover,
body.theme-dark .newadd-btns__item:hover { body.theme-dark .newadd-btns__item:hover {
color: var(--focus-color, var(--color-primary)); color: var(--color-primary, #f04494) !important;
background: rgba(255, 255, 255, 0.06) !important;
} }
/* Generic hover-show (zibll parity) */ /* Generic hover-show (zibll parity) */
+79 -19
View File
@@ -32,36 +32,76 @@
color: var(--color-ink-3, #666); color: var(--color-ink-3, #666);
} }
/* Check-in: readable on light theme */ /* Check-in: beat generic `.user-dropdown button { height:44px; background:none }` */
.user-dropdown button.aksrt-header-checkin,
.aksrt-header-checkin { .aksrt-header-checkin {
width: 100%; width: 100% !important;
border: 0; max-width: 100%;
border-radius: 6px; height: auto !important;
padding: 8px 10px; min-height: 36px;
border: 0 !important;
border-radius: 6px !important;
padding: 8px 10px !important;
margin: 0;
cursor: pointer; cursor: pointer;
background: #fff6db; background: #fff6db !important;
color: #8a5a00; color: #8a5a00 !important;
font-weight: 600; font-weight: 600;
display: inline-flex; font-size: 13px !important;
align-items: center; line-height: 1.3;
justify-content: center; display: inline-flex !important;
gap: 6px; flex-direction: row !important;
align-items: center !important;
justify-content: center !important;
gap: 6px !important;
text-align: center !important;
box-sizing: border-box;
white-space: nowrap;
} }
.user-dropdown button.aksrt-header-checkin > i,
.aksrt-header-checkin > i { .aksrt-header-checkin > i {
margin: 0 !important; margin: 0 !important;
color: #b78103; color: #b78103 !important;
flex: 0 0 auto;
line-height: 1;
} }
.aksrt-header-checkin.is-done { .user-dropdown button.aksrt-header-checkin > span,
.aksrt-header-checkin > span {
line-height: 1.3;
color: inherit;
}
.user-dropdown button.aksrt-header-checkin.is-done,
.aksrt-header-checkin.is-done,
.user-dropdown button.aksrt-header-checkin:disabled,
.aksrt-header-checkin:disabled {
opacity: 0.85; opacity: 0.85;
cursor: default; cursor: default;
background: #f3f4f6; background: #f3f4f6 !important;
color: #555; color: #555 !important;
} }
.aksrt-header-checkin.is-done > i { .user-dropdown button.aksrt-header-checkin.is-done > i,
color: #777; .aksrt-header-checkin.is-done > i,
.user-dropdown button.aksrt-header-checkin:disabled > i,
.aksrt-header-checkin:disabled > i {
color: #777 !important;
}
.user-dropdown button.aksrt-header-checkin:hover,
.aksrt-header-checkin:hover {
background: #fff0c2 !important;
color: #8a5a00 !important;
}
.user-dropdown button.aksrt-header-checkin.is-done:hover,
.aksrt-header-checkin.is-done:hover,
.user-dropdown button.aksrt-header-checkin:disabled:hover,
.aksrt-header-checkin:disabled:hover {
background: #f3f4f6 !important;
color: #555 !important;
} }
.aksrt-header-checkin-details { .aksrt-header-checkin-details {
@@ -200,11 +240,31 @@
} }
/* Dark theme overrides */ /* Dark theme overrides */
html.dark .user-dropdown button.aksrt-header-checkin,
html.dark .aksrt-header-checkin, html.dark .aksrt-header-checkin,
body.dark-theme .user-dropdown button.aksrt-header-checkin,
body.dark-theme .aksrt-header-checkin, body.dark-theme .aksrt-header-checkin,
body.theme-dark .user-dropdown button.aksrt-header-checkin,
body.theme-dark .aksrt-header-checkin { body.theme-dark .aksrt-header-checkin {
background: rgba(255, 193, 7, 0.18); background: rgba(255, 193, 7, 0.18) !important;
color: #f0c14b; color: #f0c14b !important;
}
html.dark .user-dropdown button.aksrt-header-checkin > i,
html.dark .aksrt-header-checkin > i,
body.dark-theme .user-dropdown button.aksrt-header-checkin > i,
body.dark-theme .aksrt-header-checkin > i,
body.theme-dark .user-dropdown button.aksrt-header-checkin > i,
body.theme-dark .aksrt-header-checkin > i {
color: #f0c14b !important;
}
html.dark .user-dropdown button.aksrt-header-checkin.is-done,
html.dark .aksrt-header-checkin.is-done,
body.dark-theme .user-dropdown button.aksrt-header-checkin.is-done,
body.dark-theme .aksrt-header-checkin.is-done {
background: rgba(255, 255, 255, 0.08) !important;
color: #bbb !important;
} }
html.dark .aksrt-header-wallet, html.dark .aksrt-header-wallet,
+4
View File
@@ -206,6 +206,10 @@
window.aksrtToast = function (msg, type) { window.aksrtToast = function (msg, type) {
aksrt.notyf(msg, { type: type || 'info', duration: 2200 }); aksrt.notyf(msg, { type: type || 'info', duration: 2200 });
}; };
// Alias used by several modules that call aksrt.toast(...)
aksrt.toast = function (msg, type) {
return aksrt.notyf(msg, typeof type === 'string' ? { type: type, duration: 2200 } : (type || { duration: 2200 }));
};
// ══════════════════════════════════════════════════════════════ // ══════════════════════════════════════════════════════════════
// §10.10 — confirm: i18n confirm dialog + [data-confirm] // §10.10 — confirm: i18n confirm dialog + [data-confirm]
+22 -5
View File
@@ -17,12 +17,24 @@
} }
function toast(msg, type) { function toast(msg, type) {
if (window.aksrt && typeof window.aksrt.toast === 'function') { type = type || 'info';
window.aksrt.toast(msg, type || 'info'); // Site-wide notification widget (aksrt-runtime notyf).
if (window.aksrt && typeof window.aksrt.notyf === 'function') {
window.aksrt.notyf(msg, { type: type, duration: 2200 });
return; return;
} }
// eslint-disable-next-line no-alert if (typeof window.aksrtToast === 'function') {
window.alert(msg); window.aksrtToast(msg, type);
return;
}
if (typeof window.AksrtToast === 'function') {
window.AksrtToast(msg, type);
return;
}
// Last resort: non-blocking console (never native alert for UX).
if (window.console && typeof window.console.log === 'function') {
window.console.log('[aksrt]', type, msg);
}
} }
function openModal(id) { function openModal(id) {
@@ -91,7 +103,12 @@
} }
toast((res.data && res.data.message) || '签到成功', 'success'); toast((res.data && res.data.message) || '签到成功', 'success');
btn.classList.add('is-done'); btn.classList.add('is-done');
btn.innerHTML = '<i class="fas fa-calendar-check" aria-hidden="true"></i> 今日已签到'; btn.disabled = true;
btn.setAttribute('disabled', 'disabled');
// Keep existing structure so CSS layout (.but.block flex) is not lost.
btn.innerHTML =
'<i class="fas fa-calendar-check" aria-hidden="true"></i>' +
'<span>今日已签到</span>';
}) })
.catch(function () { .catch(function () {
toast('网络错误', 'danger'); toast('网络错误', 'danger');
+4 -4
View File
@@ -41,14 +41,14 @@ if (!function_exists('aksrt_header_user_checkin_btn')) :
if ($signed) { if ($signed) {
return '<button type="button" class="but block c-yellow aksrt-header-checkin is-done" disabled>' return '<button type="button" class="but block c-yellow aksrt-header-checkin is-done" disabled>'
. '<i class="fas fa-calendar-check" aria-hidden="true"></i> ' . '<i class="fas fa-calendar-check" aria-hidden="true"></i>'
. esc_html__('今日已签到', 'aksrt') . '<span>' . esc_html__('今日已签到', 'aksrt') . '</span>'
. '</button>'; . '</button>';
} }
return '<button type="button" class="but block c-yellow aksrt-header-checkin" data-aksrt-checkin="1">' return '<button type="button" class="but block c-yellow aksrt-header-checkin" data-aksrt-checkin="1">'
. '<i class="fas fa-calendar-check" aria-hidden="true"></i> ' . '<i class="fas fa-calendar-check" aria-hidden="true"></i>'
. esc_html__('签到领取今日奖励', 'aksrt') . '<span>' . esc_html__('签到领取今日奖励', 'aksrt') . '</span>'
. '</button>'; . '</button>';
} }
endif; endif;