- design/: Figma 设计稿提取产物 — 设计规范文档、9 张整屏预览、 8 个 SVG 组件切图、15 张位图素材、完整节点数据(full.json) - h5/: 纯静态 H5 实现 — 启动页/隐私弹窗/档案填写(肤质轮播)/ 三连拍照/报告页,375px 基准还原,含压缩素材与 Playwright 验收截图
384 lines
13 KiB
CSS
384 lines
13 KiB
CSS
/* ═══════════════════════════════════════════
|
|
巨子测肤 · 1'me 在线肌肤测试 — H5 样式
|
|
设计稿 1080px 基准 → 此处 375px(÷2.88)
|
|
主色 #F5F078 · 文字 #282828 · 底 #EFEFEF
|
|
═══════════════════════════════════════════ */
|
|
:root {
|
|
--yellow: #F5F078;
|
|
--ink: #282828;
|
|
--ink-2: #2C2C2C;
|
|
--grey: #868686;
|
|
--grey-2: #757575;
|
|
--grey-3: #707070;
|
|
--para: #4A4A4A;
|
|
--bg: #EFEFEF;
|
|
--line: #E5E5E5;
|
|
--dry: #EAE6E1;
|
|
--neutral: #DBF6D6;
|
|
--bad: #D30C0C;
|
|
--nav-h: 44px;
|
|
--font: "Noto Sans SC","PingFang SC","Hiragino Sans GB","Microsoft YaHei",system-ui,sans-serif;
|
|
}
|
|
|
|
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
|
|
html, body { height: 100%; }
|
|
body {
|
|
font-family: var(--font);
|
|
color: var(--ink);
|
|
background: #000;
|
|
overflow: hidden;
|
|
-webkit-font-smoothing: antialiased;
|
|
user-select: none;
|
|
max-width: 480px; /* 桌面预览时居中显示 */
|
|
margin: 0 auto;
|
|
position: relative;
|
|
}
|
|
img { display: block; }
|
|
button { font-family: inherit; border: 0; background: none; cursor: pointer; }
|
|
|
|
/* ─── 屏幕容器 ─── */
|
|
.screen {
|
|
position: absolute; inset: 0;
|
|
display: none;
|
|
overflow-y: auto;
|
|
-webkit-overflow-scrolling: touch;
|
|
background: var(--bg);
|
|
}
|
|
.screen.active { display: block; animation: screenIn .35s ease both; }
|
|
@keyframes screenIn { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
|
|
|
|
/* ─── 通用按钮 ─── */
|
|
.btn-primary {
|
|
display: block;
|
|
width: 182px; height: 39px;
|
|
line-height: 39px;
|
|
background: var(--yellow);
|
|
border-radius: 20px;
|
|
color: var(--ink);
|
|
font-size: 14px; font-weight: 500;
|
|
text-align: center;
|
|
transition: transform .12s ease;
|
|
}
|
|
.btn-primary:active { transform: scale(.96); }
|
|
|
|
/* ─── 折线箭头(返回/下拉) ─── */
|
|
.chev {
|
|
width: 9px; height: 9px;
|
|
border: solid var(--ink-2); border-width: 0 2px 2px 0;
|
|
display: inline-block; padding: 2px;
|
|
}
|
|
.chev.left { transform: rotate(135deg); }
|
|
.chev.down { transform: rotate(45deg); }
|
|
|
|
/* ═══════════ 01 启动页 ═══════════ */
|
|
#s-splash { background: #101823; }
|
|
.splash-bg {
|
|
position: absolute; inset: 0;
|
|
background: url(../assets/img/bg-splash.jpg) center/cover no-repeat;
|
|
}
|
|
.splash-slogan {
|
|
position: absolute; left: 0; right: 0; top: 20%;
|
|
text-align: center;
|
|
color: #fff; font-size: 23px; font-weight: 500;
|
|
line-height: 1.38;
|
|
letter-spacing: 1px;
|
|
text-shadow: 0 1px 8px rgba(0,0,0,.18);
|
|
}
|
|
.splash-bottom {
|
|
position: absolute; left: 0; right: 0; bottom: 7%;
|
|
display: flex; flex-direction: column; align-items: center; gap: 18px;
|
|
padding-bottom: env(safe-area-inset-bottom);
|
|
}
|
|
.brand-row { display: flex; align-items: center; gap: 7px; }
|
|
.brand-logo { width: 46px; height: auto; filter: brightness(0) invert(1); }
|
|
.brand-text { color: #fff; font-size: 21px; font-weight: 500; letter-spacing: 1px; }
|
|
|
|
/* ═══════════ 通用导航 ═══════════ */
|
|
.nav {
|
|
position: sticky; top: 0; z-index: 20;
|
|
height: var(--nav-h);
|
|
display: flex; align-items: center;
|
|
padding: 0 6px;
|
|
background: rgba(255,255,255,.94);
|
|
backdrop-filter: blur(8px);
|
|
}
|
|
.nav-dark { background: rgba(20,20,20,.55); }
|
|
.nav-dark .nav-title { color: #fff; }
|
|
.nav-dark .chev { border-color: #fff; }
|
|
.nav-back { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; }
|
|
.nav-title {
|
|
position: absolute; left: 50%; transform: translateX(-50%);
|
|
font-size: 14px; font-weight: 500; color: #000;
|
|
max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
|
|
}
|
|
|
|
/* ═══════════ 03 档案填写 ═══════════ */
|
|
#s-profile { background: #0e0f18; }
|
|
.profile-bg {
|
|
position: absolute; inset: 0;
|
|
/* 设计稿:启动页照片 + 50% 正片叠底黑遮罩(矩形3) */
|
|
background:
|
|
linear-gradient(rgba(0,0,0,.55), rgba(0,0,0,.55)),
|
|
url(../assets/img/bg-splash.jpg) center/cover no-repeat;
|
|
}
|
|
#s-profile .nav { position: fixed; left: 0; right: 0; }
|
|
.profile-body {
|
|
position: relative; z-index: 1;
|
|
min-height: 100%;
|
|
padding: calc(var(--nav-h) + 18px) 38px 40px;
|
|
display: flex; flex-direction: column; justify-content: flex-end;
|
|
gap: 13px;
|
|
}
|
|
.page-title {
|
|
color: #fff; font-size: 21px; font-weight: 700;
|
|
letter-spacing: 1px; margin-bottom: 2px;
|
|
}
|
|
.field-label {
|
|
display: block;
|
|
color: #fff; font-size: 14px; font-weight: 400;
|
|
margin-bottom: 6px; letter-spacing: .5px;
|
|
}
|
|
.form-row.two { display: flex; gap: 8px; }
|
|
.form-row.two .field { flex: 1; }
|
|
.field-input {
|
|
display: block; width: 100%; height: 38px;
|
|
background: #fff; border-radius: 6px; border: 0; outline: none;
|
|
padding: 0 12px;
|
|
font-family: inherit; font-size: 13px; color: var(--ink);
|
|
appearance: none; -webkit-appearance: none;
|
|
}
|
|
.field-input::placeholder { color: #bbb; }
|
|
.field-select-wrap { position: relative; }
|
|
.field-select-wrap .chev { position: absolute; right: 12px; top: 15px; width: 7px; height: 7px; pointer-events: none; }
|
|
|
|
/* 肤质卡片 */
|
|
.skin-card {
|
|
background: #fff; border-radius: 10px;
|
|
padding: 12px 10px 14px;
|
|
}
|
|
.skin-axis {
|
|
display: flex; justify-content: center; gap: 14px;
|
|
margin-bottom: 4px;
|
|
}
|
|
.axis-item {
|
|
display: inline-flex; align-items: center; gap: 4px;
|
|
font-size: 9px; color: var(--ink);
|
|
}
|
|
.chip { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
|
|
.skin-carousel { overflow: hidden; }
|
|
.skin-track { display: flex; transition: transform .32s cubic-bezier(.22,.61,.36,1); }
|
|
.skin-item {
|
|
flex: 0 0 100%;
|
|
display: flex; flex-direction: column; align-items: center;
|
|
}
|
|
.skin-item img { width: 109px; height: 109px; }
|
|
.skin-name { font-size: 13px; font-weight: 500; color: #000; margin-top: 2px; }
|
|
.skin-desc {
|
|
font-size: 10px; color: var(--ink); font-weight: 400;
|
|
line-height: 1.5; text-align: center;
|
|
margin-top: 5px; padding: 0 12px;
|
|
}
|
|
.skin-dots { display: flex; justify-content: center; gap: 7px; margin-top: 10px; }
|
|
.skin-dots i {
|
|
width: 6px; height: 6px; border-radius: 50%;
|
|
background: #D6D6D6; transition: background .25s;
|
|
}
|
|
.skin-dots i.on { background: var(--ink); }
|
|
.btn-submit { margin: 6px auto 0; }
|
|
|
|
/* ═══════════ 05-07 拍照页 ═══════════ */
|
|
#s-cam { background: #000; }
|
|
.cam-bg {
|
|
position: absolute; inset: 0;
|
|
background-size: cover; background-position: center;
|
|
}
|
|
#s-cam .nav { position: fixed; left: 0; right: 0; }
|
|
.cam-step {
|
|
position: absolute; left: 0; right: 0; top: 15%;
|
|
text-align: center;
|
|
color: #fff; font-size: 21px; font-weight: 500;
|
|
line-height: 1.5; letter-spacing: 1px;
|
|
text-shadow: 0 1px 10px rgba(0,0,0,.4);
|
|
z-index: 2;
|
|
}
|
|
.cam-guide {
|
|
position: absolute; left: 0; right: 0; bottom: 17%;
|
|
display: flex; justify-content: center; align-items: center; gap: 18px;
|
|
z-index: 2;
|
|
}
|
|
.cam-guide span { color: #fff; font-size: 14px; font-weight: 400; opacity: .92; }
|
|
.cam-guide i { width: 0; height: 15px; border-left: 1px solid rgba(255,255,255,.5); }
|
|
.cam-controls {
|
|
position: absolute; left: 0; right: 0; bottom: 6%;
|
|
display: flex; align-items: center; justify-content: space-between;
|
|
padding: 0 55px;
|
|
padding-bottom: calc(10px + env(safe-area-inset-bottom));
|
|
z-index: 2;
|
|
}
|
|
.cam-side img { width: 31px; height: 31px; }
|
|
.cam-shutter img { width: 62px; height: 62px; }
|
|
.cam-shutter:active { transform: scale(.92); }
|
|
.cam-flash {
|
|
position: absolute; inset: 0; background: #fff;
|
|
opacity: 0; pointer-events: none; z-index: 9;
|
|
transition: opacity .18s ease;
|
|
}
|
|
.cam-flash.on { opacity: .92; }
|
|
|
|
/* ═══════════ 08 报告页 ═══════════ */
|
|
.report-body { padding: 12px 38px 34px; }
|
|
.report-title {
|
|
font-size: 20px; font-weight: 700; color: var(--ink);
|
|
text-align: center; margin: 8px 0 12px;
|
|
letter-spacing: .5px;
|
|
}
|
|
.card {
|
|
background: #fff; border-radius: 10px;
|
|
padding: 14px 15px;
|
|
margin-bottom: 9px;
|
|
}
|
|
/* 总分 */
|
|
.card-stats { display: flex; }
|
|
.stat { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; }
|
|
.stat-label { font-size: 9px; font-weight: 500; color: var(--grey); }
|
|
.stat-value { font-size: 29px; font-weight: 400; color: var(--ink); letter-spacing: 1px; }
|
|
/* 维度 */
|
|
.dims-intro { font-size: 10px; font-weight: 500; color: #464646; line-height: 1.6; margin-bottom: 10px; }
|
|
.dims-row { display: flex; }
|
|
.dim { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; }
|
|
.dim-name { font-size: 9px; font-weight: 500; color: var(--grey); }
|
|
.dim-score { font-size: 29px; font-weight: 500; color: var(--ink); }
|
|
.dim-bad { color: var(--bad); }
|
|
.dims-note { font-size: 9px; font-weight: 500; color: var(--grey); line-height: 1.55; margin-top: 9px; }
|
|
.dims-disclaimer { font-size: 7px; font-weight: 400; color: var(--grey-3); margin-top: 8px; line-height: 1.5; }
|
|
/* 具体描述 */
|
|
.detail-tabs {
|
|
display: flex;
|
|
border-bottom: 1px solid #F0F0F0;
|
|
margin-bottom: 12px;
|
|
}
|
|
.dtab {
|
|
flex: 1; padding: 8px 0 9px;
|
|
font-size: 10px; font-weight: 500; color: var(--ink);
|
|
position: relative;
|
|
}
|
|
.dtab.active { font-weight: 700; }
|
|
.dtab.active::after {
|
|
content: ""; position: absolute;
|
|
left: 50%; transform: translateX(-50%); bottom: -1px;
|
|
width: 46px; height: 4px; border-radius: 2px;
|
|
background: var(--yellow);
|
|
}
|
|
.dpanel { display: none; }
|
|
.dpanel.active { display: block; animation: fade .25s ease; }
|
|
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
|
|
.ditem { display: flex; gap: 11px; }
|
|
.ditem + .ditem { margin-top: 13px; padding-top: 13px; border-top: 1px solid #F0F0F0; }
|
|
.ditem-img { width: 92px; height: 96px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
|
|
.ditem-text { flex: 1; }
|
|
.ditem-title { font-size: 11.5px; font-weight: 500; color: var(--ink); margin-bottom: 4px; }
|
|
.ditem-para { font-size: 10px; font-weight: 400; color: var(--para); line-height: 1.55; }
|
|
.dempty {
|
|
padding: 26px 0; text-align: center;
|
|
font-size: 10px; color: var(--grey-2);
|
|
}
|
|
/* 护理建议 */
|
|
.card-heading { font-size: 13px; font-weight: 700; color: #000; margin-bottom: 8px; }
|
|
.care-item { font-size: 10px; color: var(--para); line-height: 1.6; margin-bottom: 8px; }
|
|
.care-summary { font-size: 11px; font-weight: 500; color: #000; margin-top: 10px; }
|
|
/* 产品推荐 */
|
|
.prod-title { font-size: 21px; font-weight: 700; color: var(--ink); line-height: 1.45; text-align: center; margin: 4px 0 12px; }
|
|
.prod-scroll {
|
|
display: flex; gap: 9px;
|
|
overflow-x: auto;
|
|
margin: 0 -6px; padding: 0 6px 4px;
|
|
scrollbar-width: none;
|
|
}
|
|
.prod-scroll::-webkit-scrollbar { display: none; }
|
|
.prod-scroll img {
|
|
width: 130px; height: 162px;
|
|
object-fit: cover; border-radius: 6px;
|
|
flex-shrink: 0;
|
|
}
|
|
.prod-name { font-size: 13px; font-weight: 700; color: var(--ink); margin: 11px 0 3px; }
|
|
.prod-sub { font-size: 7.5px; font-weight: 500; color: var(--grey-3); }
|
|
.btn-more { margin: 16px auto 0; }
|
|
.report-disclaimer {
|
|
font-size: 7px; font-weight: 300; color: var(--grey-3);
|
|
line-height: 1.7; text-align: center;
|
|
margin-top: 14px;
|
|
}
|
|
|
|
/* ═══════════ 弹窗 ═══════════ */
|
|
.overlay {
|
|
position: absolute; inset: 0; z-index: 50;
|
|
display: none;
|
|
align-items: center; justify-content: center;
|
|
background: rgba(0,0,0,.45);
|
|
}
|
|
.overlay.show { display: flex; }
|
|
.overlay .popup { animation: popIn .3s cubic-bezier(.34,1.4,.64,1) both; }
|
|
@keyframes popIn { from { opacity: 0; transform: translateY(26px) scale(.96); } to { opacity: 1; transform: none; } }
|
|
.popup {
|
|
position: relative;
|
|
width: 307px;
|
|
background: #fff; border-radius: 14px;
|
|
padding: 34px 26px 26px;
|
|
text-align: left;
|
|
}
|
|
.popup-close {
|
|
position: absolute; top: 12px; right: 12px;
|
|
width: 31px; height: 31px;
|
|
display: flex; align-items: center; justify-content: center;
|
|
}
|
|
.popup-close img { width: 17px; height: 17px; opacity: .8; }
|
|
.popup-title {
|
|
font-size: 23px; font-weight: 500; color: var(--ink);
|
|
line-height: 1.35; letter-spacing: .5px;
|
|
margin-bottom: 15px;
|
|
}
|
|
.popup-title-center { text-align: center; margin: 18px 0 24px; }
|
|
.popup-body { font-size: 11.5px; color: var(--ink); line-height: 1.55; margin-bottom: 20px; }
|
|
.privacy-row { display: flex; align-items: center; gap: 8px; margin-bottom: 24px; cursor: pointer; }
|
|
.checkbox {
|
|
width: 11px; height: 11px; border-radius: 50%;
|
|
border: 1px solid #9B9B9B; background: #fff;
|
|
flex-shrink: 0; position: relative;
|
|
}
|
|
.checkbox.checked::after {
|
|
content: ""; position: absolute;
|
|
inset: 2px; border-radius: 50%;
|
|
background: var(--ink-2);
|
|
}
|
|
.privacy-text { font-size: 10px; color: var(--grey-2); }
|
|
.popup-btn { margin: 0 auto; }
|
|
|
|
/* 分析中 */
|
|
.overlay-dark { background: rgba(16,16,16,.82); }
|
|
.analyzing {
|
|
color: #fff; text-align: center;
|
|
font-size: 13px; letter-spacing: 1px;
|
|
display: flex; flex-direction: column; align-items: center; gap: 16px;
|
|
}
|
|
.spinner {
|
|
width: 34px; height: 34px;
|
|
border: 3px solid rgba(255,255,255,.25);
|
|
border-top-color: var(--yellow);
|
|
border-radius: 50%;
|
|
animation: spin .8s linear infinite;
|
|
}
|
|
@keyframes spin { to { transform: rotate(360deg); } }
|
|
|
|
/* Toast */
|
|
.toast {
|
|
position: absolute; left: 50%; bottom: 15%;
|
|
transform: translateX(-50%) translateY(8px);
|
|
background: rgba(20,20,20,.85); color: #fff;
|
|
font-size: 12px;
|
|
padding: 9px 18px; border-radius: 18px;
|
|
opacity: 0; pointer-events: none;
|
|
transition: all .25s ease;
|
|
z-index: 99; white-space: nowrap;
|
|
}
|
|
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
|