nomadro/apps/miniprogram/xhs/tool/weapp-hero.css
eric 626f6b19e8 Ship unified miniprogram H5/weapp parity and XHS offline portal.
Align Taro pages with Next hub/nav/book/community/VIP, pack the single-index Xiaohongshu portal with host-chrome safe areas, and refresh shared book content plus portal README constraints.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-30 09:37:03 +08:00

564 lines
14 KiB
CSS
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/* ===== weapp-hero.css — 对齐微信 book/community 封面 Hero ===== */
.page-shell,
.xhs-hero-page {
--bg-primary: #0a0e17;
--bg-secondary: #111827;
--text-primary: #f1f5f9;
--text-secondary: #94a3b8;
--accent-1: #ff6b6b;
--accent-2: #ffe66d;
--accent-3: #4ecdc4;
--gradient-text: linear-gradient(135deg, #ff6b6b 0%, #ffe66d 50%, #4ecdc4 100%);
--nav-height: 44px;
--font-display: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", sans-serif;
/* 与首页 hub 同色调:顶区透出红/青光晕,而非死黑条 */
background:
radial-gradient(ellipse 90% 55% at 85% -5%, rgba(255, 107, 107, 0.22), transparent 55%),
radial-gradient(ellipse 80% 50% at 5% 75%, rgba(78, 205, 196, 0.16), transparent 50%),
radial-gradient(ellipse 60% 40% at 50% 40%, rgba(255, 230, 109, 0.06), transparent 55%),
#0a0e17;
color: var(--text-primary);
min-height: 100vh;
font-family: var(--font-display);
}
.xhs-hero-page {
position: relative;
overflow-x: hidden;
overflow-y: auto;
/* 底栏固定 CTA 占位,防止视觉区被盖住 */
padding-bottom: calc(140px + env(safe-area-inset-bottom, 0px));
/* 顶栏:硬编码 88+44,避免嵌套 var 失效 */
padding-top: 132px !important;
padding-top: calc(44px + var(--app-pad-top, 88px)) !important;
box-sizing: border-box;
}
.xhs-hero-page .navbar,
.book-flow .navbar,
.community-flow .navbar {
--nav-height: 44px;
top: 88px !important;
top: var(--app-pad-top, 88px) !important;
height: 44px !important;
min-height: 44px !important;
padding-top: 0 !important;
box-sizing: border-box;
/* 与首页 hub 一致:顶栏透明,透出页面 mesh 色调 */
background: transparent;
backdrop-filter: none;
-webkit-backdrop-filter: none;
border-bottom: none;
}
.xhs-hero-page .navbar.scrolled,
.book-flow .navbar.scrolled,
.community-flow .navbar.scrolled {
background: rgba(10, 14, 23, 0.72);
backdrop-filter: blur(16px);
-webkit-backdrop-filter: blur(16px);
border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.xhs-hero-page .navbar .nav-container,
.book-flow .navbar .nav-container,
.community-flow .navbar .nav-container {
height: 44px;
padding-left: 12px;
padding-right: 12px;
box-sizing: border-box;
display: flex;
align-items: center;
gap: 8px;
}
.xhs-home-back {
flex-shrink: 0;
width: 40px;
height: 40px;
margin: 0;
padding: 0;
border: 0;
border-radius: 12px;
background: rgba(255, 255, 255, 0.08);
color: #f1f5f9;
font-size: 1.25rem;
line-height: 40px;
text-align: center;
cursor: pointer;
-webkit-tap-highlight-color: transparent;
}
.vip-header {
display: flex;
align-items: center;
gap: 8px;
}
.xhs-hero-page .navbar .logo,
.book-flow .navbar .logo,
.community-flow .navbar .logo {
cursor: pointer;
-webkit-tap-highlight-color: transparent;
display: inline-flex;
align-items: center;
gap: 8px;
}
.logo-home-hint {
margin-left: 2px;
padding: 2px 8px;
border-radius: 999px;
font-size: 0.72rem;
font-weight: 600;
letter-spacing: 0.02em;
color: rgba(241, 245, 249, 0.72);
background: rgba(255, 255, 255, 0.08);
border: 1px solid rgba(255, 255, 255, 0.1);
}
.brand-mark .logo-home-hint {
margin-left: 6px;
flex-shrink: 0;
}
.vip-logo .logo-home-hint {
margin-left: 8px;
}
.xhs-hero-page .logo-icon,
.book-flow .logo-icon,
.community-flow .logo-icon {
width: 34px;
height: 34px;
display: block;
animation: xhsLogoSpin 20s linear infinite;
}
@keyframes xhsLogoSpin {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
.xhs-mini-nav {
position: sticky;
top: 0;
z-index: 50;
display: flex;
align-items: center;
gap: 10px;
padding: calc(8px + var(--app-pad-top, 88px)) 14px 10px var(--app-pad-left, 16px);
background: rgba(10, 14, 23, 0.88);
backdrop-filter: blur(16px);
border-bottom: 1px solid rgba(255, 255, 255, 0.06);
box-sizing: border-box;
}
.xhs-hero {
position: relative;
/* 可视区减去顶栏与固定 CTA,内容居中且不压按钮 */
min-height: calc(100vh - var(--nav-height, 44px) - var(--app-pad-top, 0px) - 140px);
display: flex;
flex-direction: column;
justify-content: center;
padding: 12px 16px 24px;
box-sizing: border-box;
}
.xhs-hero-shapes {
position: absolute;
/* 铺满整页含顶栏区,色块能透到透明 navbar 后面 */
top: calc(-1 * (44px + var(--app-pad-top, 88px)));
left: 0;
right: 0;
bottom: 0;
pointer-events: none;
overflow: hidden;
}
.xhs-hero-shapes .shape {
position: absolute;
border-radius: 50%;
filter: blur(80px);
-webkit-filter: blur(80px);
opacity: 0.4;
animation: xhsFloatShape 8s ease-in-out infinite;
}
.xhs-hero-shapes .shape-1 {
width: 220px;
height: 220px;
background: #ff6b6b;
top: -40px;
right: -40px;
}
.xhs-hero-shapes .shape-2 {
width: 180px;
height: 180px;
background: #4ecdc4;
bottom: 40px;
left: -50px;
animation-delay: -2.5s;
}
.xhs-hero-shapes .shape-3 {
width: 140px;
height: 140px;
background: #ffe66d;
top: 40%;
right: 10%;
opacity: 0.25;
animation-delay: -4s;
}
@keyframes xhsFloatShape {
0%, 100% { transform: translate(0, 0) scale(1); }
50% { transform: translate(12px, -18px) scale(1.06); }
}
.xhs-hero-inner {
position: relative;
z-index: 1;
display: flex;
flex-direction: column;
align-items: center;
gap: 10px;
text-align: center;
width: 100%;
max-width: 520px;
margin: 0 auto;
animation: xhsFadeUp 0.55s ease both;
}
@keyframes xhsFadeUp {
from { opacity: 0; transform: translateY(14px); }
to { opacity: 1; transform: translateY(0); }
}
.xhs-hero-title {
font-size: clamp(2rem, 9vw, 2.85rem);
font-weight: 800;
line-height: 1.15;
letter-spacing: -0.03em;
margin: 0;
}
.xhs-hero-title .line {
display: block;
}
.xhs-hero-title .line-brand {
font-size: clamp(2.2rem, 9.5vw, 3.2rem);
margin-bottom: 4px;
}
.xhs-hero-title .line-tag {
font-size: clamp(1rem, 4vw, 1.35rem);
font-weight: 700;
letter-spacing: 0.01em;
line-height: 1.35;
}
.xhs-gradient-text {
background: var(--gradient-text);
background-size: 200% 200%;
-webkit-background-clip: text;
background-clip: text;
-webkit-text-fill-color: transparent;
color: transparent;
animation: xhsGradShift 4s ease-in-out infinite;
}
@keyframes xhsGradShift {
0%, 100% { background-position: 0% 50%; }
50% { background-position: 100% 50%; }
}
.xhs-hero-spark {
font-size: 1.15rem;
letter-spacing: 0.08em;
line-height: 1;
animation: xhsFadeUp 0.55s ease 0.1s both;
}
.xhs-typewriter {
min-height: 2.6em;
max-width: 24em;
width: 100%;
margin: 0 auto;
padding: 0 12px;
font-size: 0.88rem;
color: var(--text-secondary);
line-height: 1.55;
white-space: normal;
overflow: hidden;
text-align: center;
box-sizing: border-box;
animation: xhsFadeUp 0.55s ease 0.16s both;
}
.xhs-typewriter .cursor {
color: #4ecdc4;
animation: xhsBlink 1s step-end infinite;
}
@keyframes xhsBlink {
50% { opacity: 0; }
}
.xhs-visual {
position: relative;
width: min(68vw, 260px);
margin: 6px auto 0;
flex-shrink: 0;
animation: xhsFadeUp 0.7s ease 0.2s both;
}
.xhs-visual svg {
width: 100%;
height: auto;
display: block;
}
/* 微信 weapp 同款:CSS 实心书本 / 社群网(XHS 里 SVG 渐变 fill 常失效变线框) */
.book-visual-css,
.social-mesh-css {
position: relative;
width: 100%;
max-width: 240px;
aspect-ratio: 1;
margin: 0 auto;
animation: xhsMeshFloat 7s ease-in-out infinite;
}
@keyframes xhsMeshFloat {
0%, 100% { transform: translateY(0); }
50% { transform: translateY(-12px); }
}
.book-visual-css-glow,
.social-mesh-css-glow {
position: absolute;
top: 8%;
left: 8%;
right: 8%;
bottom: 8%;
border-radius: 50%;
background: radial-gradient(
circle,
rgba(78, 205, 196, 0.38) 0%,
rgba(255, 230, 109, 0.14) 42%,
rgba(255, 107, 107, 0) 72%
);
animation: xhsGlowPulse 3.6s ease-in-out infinite;
}
@keyframes xhsGlowPulse {
0%, 100% { opacity: 0.85; transform: scale(1); }
50% { opacity: 1; transform: scale(1.04); }
}
.book-visual-css-body {
position: absolute;
left: 18%;
right: 18%;
top: 22%;
bottom: 22%;
border-radius: 14px;
background: linear-gradient(145deg, #1e293b, #0f172a);
border: 2px solid #4ecdc4;
box-shadow: 0 14px 32px rgba(0, 0, 0, 0.4);
animation: xhsBookTilt 6.5s ease-in-out infinite;
}
@keyframes xhsBookTilt {
0%, 100% { transform: rotate(-1.5deg); }
50% { transform: rotate(1.8deg); }
}
.book-visual-css-spine {
position: absolute;
left: 50%;
top: 8%;
bottom: 8%;
width: 3px;
margin-left: -1.5px;
background: linear-gradient(180deg, #ff6b6b, #ffe66d, #4ecdc4);
border-radius: 2px;
}
.book-visual-css-emoji {
position: absolute;
left: 0;
right: 0;
top: 40%;
text-align: center;
font-size: 40px;
line-height: 1;
}
.social-mesh-css-ring {
position: absolute;
left: 16%;
top: 16%;
right: 16%;
bottom: 16%;
border-radius: 50%;
border: 1.5px dashed rgba(78, 205, 196, 0.4);
animation: xhsRingSpin 18s linear infinite;
}
@keyframes xhsRingSpin {
to { transform: rotate(360deg); }
}
.social-mesh-css-core {
position: absolute;
left: 50%;
top: 50%;
width: 72px;
height: 72px;
margin: -36px 0 0 -36px;
border-radius: 50%;
background: rgba(17, 24, 39, 0.95);
border: 2px solid #4ecdc4;
box-shadow: 0 0 24px rgba(78, 205, 196, 0.35);
display: flex;
align-items: center;
justify-content: center;
font-size: 28px;
}
.social-mesh-css-node {
position: absolute;
width: 44px;
height: 44px;
margin: -22px 0 0 -22px;
border-radius: 50%;
background: rgba(17, 24, 39, 0.95);
border: 2px solid #ff6b6b;
display: flex;
align-items: center;
justify-content: center;
font-size: 18px;
animation: xhsChipFloat 4.2s ease-in-out infinite;
}
.social-mesh-css-node-1 { left: 28%; top: 22%; border-color: #ff6b6b; }
.social-mesh-css-node-2 { left: 74%; top: 24%; border-color: #ffe66d; animation-delay: -0.8s; }
.social-mesh-css-node-3 { left: 82%; top: 58%; border-color: #4ecdc4; animation-delay: -1.6s; }
.social-mesh-css-node-4 { left: 66%; top: 80%; border-color: #a78bfa; animation-delay: -2.2s; }
.social-mesh-css-node-5 { left: 22%; top: 70%; border-color: #f472b6; animation-delay: -1.2s; }
.social-mesh-css-node-6 { left: 18%; top: 42%; border-color: #ffe66d; animation-delay: -2.8s; }
.xhs-float-chips {
position: absolute;
inset: 0;
pointer-events: none;
overflow: visible;
}
.xhs-chip {
position: absolute;
padding: 6px 12px;
border-radius: 999px;
background: rgba(17, 24, 39, 0.92);
border: 1px solid rgba(255, 255, 255, 0.12);
font-size: 0.7rem;
font-weight: 600;
white-space: nowrap;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
animation: xhsChipFloat 4.2s ease-in-out infinite;
}
@keyframes xhsChipFloat {
0%, 100% { transform: translateY(0); }
50% { transform: translateY(-8px); }
}
.xhs-chip.sc-1 {
top: 4%;
right: -6%;
}
.xhs-chip.sc-2 {
top: 48%;
left: -10%;
animation-delay: -1.4s;
}
.xhs-chip.sc-3 {
bottom: 6%;
right: -2%;
animation-delay: -2.2s;
}
/* 窄屏隐藏右侧 chip,避免挤爆 */
@media (max-width: 420px) {
.xhs-chip.sc-1 { display: none; }
.xhs-visual { width: min(62vw, 220px); }
}
.xhs-fixed-cta {
position: fixed;
left: 16px;
right: 16px;
bottom: calc(28px + env(safe-area-inset-bottom, 0px));
z-index: 60;
display: flex;
flex-direction: column;
align-items: stretch;
gap: 8px;
pointer-events: none;
}
.xhs-fixed-cta > * {
pointer-events: auto;
}
.xhs-btn-primary {
width: 100%;
min-height: 52px;
border: none;
border-radius: 999px;
font-size: 1.05rem;
font-weight: 800;
color: #0a0e17;
background: linear-gradient(135deg, #ff6b6b, #ffe66d, #4ecdc4);
background-size: 200% 200%;
box-shadow: 0 10px 28px rgba(78, 205, 196, 0.35);
cursor: pointer;
-webkit-tap-highlight-color: transparent;
animation: xhsCtaPulse 2.4s ease-in-out infinite, xhsGradShift 4s ease-in-out infinite;
}
@keyframes xhsCtaPulse {
0%, 100% { box-shadow: 0 10px 28px rgba(78, 205, 196, 0.32); transform: translateY(0); }
50% { box-shadow: 0 14px 36px rgba(255, 107, 107, 0.28); transform: translateY(-2px); }
}
.xhs-btn-primary:active {
transform: scale(0.98);
}
.xhs-cta-hint {
text-align: center;
font-size: 0.78rem;
color: var(--text-secondary);
margin: 0;
}
/* 覆盖误报的 reduced-motion */
@media (prefers-reduced-motion: reduce) {
.xhs-hero-shapes .shape,
.xhs-visual svg,
.xhs-chip,
.xhs-btn-primary,
.xhs-gradient-text,
.xhs-typewriter .cursor,
.logo-icon {
animation-duration: 0.01ms !important;
/* 不关掉,仅缩短无效;下面强制恢复 */
}
}
.xhs-hero-shapes .shape {
animation: xhsFloatShape 8s ease-in-out infinite !important;
}
.xhs-visual svg {
animation: xhsMeshFloat 7s ease-in-out infinite !important;
}
.xhs-chip {
animation: xhsChipFloat 4.2s ease-in-out infinite !important;
}
.xhs-btn-primary {
animation: xhsCtaPulse 2.4s ease-in-out infinite, xhsGradShift 4s ease-in-out infinite !important;
}
.xhs-gradient-text {
animation: xhsGradShift 4s ease-in-out infinite !important;
}
.xhs-typewriter .cursor {
animation: xhsBlink 1s step-end infinite !important;
}
/* SVG 内虚线/光点(社群 mesh / 书本) */
.xhs-visual path[stroke-dasharray],
.xhs-visual .mesh-link {
animation: xhsDash 2.8s linear infinite;
}
@keyframes xhsDash {
to { stroke-dashoffset: -48; }
}
#view-book > .topbar,
#view-community > .topbar,
#view-vip > .topbar {
display: none !important;
}
#view-book .sub-page,
#view-community .sub-page,
#view-vip .sub-page {
padding: 0 !important;
margin: 0 !important;
}
/* 切页锁:吞掉同一手指穿透到新页的 touchend/click */
html.xhs-input-lock .view,
html.xhs-input-lock .xhs-fixed-cta,
html.xhs-input-lock .link-card,
html.xhs-input-lock .xhs-btn-primary,
html.xhs-input-lock .sheet-mask,
html.xhs-input-lock .woa-root {
pointer-events: none !important;
}