Files
wx_pbzc/pages/index/index.wxss
T
lc 89d93c8155 refactor(ui): 12-point UI polish and bugfixes
Bug fixes:
- #1 Remove duplicate month label from calendar-heatmap (shown twice in records)
- #2 Extract shared .modal-overlay to app.wxss (was duplicated in index/records)

UX improvements:
- #3 Add long-press hint to history list in records page
- #4 Add drag handle + catchtouchmove to picker modal
- #5 Extend timer auto-navigate-back from 1.5s to 3s
- #6 Add clear data option in settings with confirmation dialog

Visual/code polish:
- #7 Remove 4 unused @keyframes (shimmer, spin) and 5 unused .icon classes
- #8 Tab bar inactive colors: hardcoded #888/#666 -> var(--text-secondary)
- #10 Split progress-ring observer to avoid redundant setData on size/color changes
- #12 Remove meaningless Math.min(planDay, 99) cap
2026-06-04 16:34:22 +08:00

410 lines
6.5 KiB
Plaintext

/* ---- greeting ---- */
.greeting-row {
padding: 16rpx 8rpx 24rpx;
animation: cardIn 0.4s ease both;
}
.greeting-text {
display: flex;
align-items: center;
margin-bottom: 8rpx;
}
.greeting-emoji {
font-size: 40rpx;
margin-right: 12rpx;
line-height: 1;
}
.greeting-title {
font-size: 40rpx;
font-weight: 700;
color: var(--text);
line-height: 1.2;
}
.greeting-sub {
font-size: 26rpx;
color: var(--text-secondary);
margin-left: 56rpx;
line-height: 1;
}
/* ---- header card ---- */
.header-card {
display: flex;
align-items: center;
padding: 36rpx 32rpx;
}
.streak-section {
display: flex;
flex-direction: column;
align-items: center;
min-width: 140rpx;
}
.streak-icon {
font-size: 40rpx;
margin-bottom: 4rpx;
line-height: 1;
animation: float 2.5s ease-in-out infinite;
}
.streak-num {
font-size: 56rpx;
font-weight: 700;
color: var(--primary);
line-height: 1.1;
}
.streak-label {
font-size: 22rpx;
color: var(--text-secondary);
margin-top: 4rpx;
line-height: 1;
}
.divider {
width: 2rpx;
height: 80rpx;
background: var(--border);
margin: 0 28rpx;
}
.plan-info {
flex: 1;
display: flex;
flex-direction: column;
}
.plan-badge {
display: flex;
align-items: center;
margin-bottom: 16rpx;
}
.plan-badge-icon {
font-size: 28rpx;
margin-right: 8rpx;
line-height: 1;
}
.plan-badge-text {
font-size: 26rpx;
font-weight: 600;
color: var(--text);
line-height: 1;
}
.progress-bar-wrap {
display: flex;
flex-direction: column;
}
.progress-bar {
width: 100%;
height: 8rpx;
background: var(--border);
border-radius: 4rpx;
overflow: visible;
margin-bottom: 8rpx;
}
.progress-fill {
height: 100%;
background: linear-gradient(90deg, var(--primary), var(--primary-light));
border-radius: 4rpx;
transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
position: relative;
}
.progress-glow {
position: absolute;
right: -4rpx;
top: -4rpx;
width: 16rpx;
height: 16rpx;
background: var(--primary);
border-radius: 50%;
box-shadow: 0 0 10rpx var(--primary);
}
.progress-label {
font-size: 22rpx;
color: var(--text-secondary);
line-height: 1;
}
/* ---- target card ---- */
.target-section {
text-align: center;
padding: 36rpx 32rpx;
}
.target-header {
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 8rpx;
}
.target-header .section-title {
margin-bottom: 0;
}
.target-icon {
font-size: 28rpx;
margin-right: 8rpx;
line-height: 1;
}
.target-display {
margin: 20rpx 0;
}
.target-ring {
display: inline-flex;
align-items: center;
justify-content: center;
width: 200rpx;
height: 200rpx;
border-radius: 50%;
background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.08), rgba(var(--primary-rgb), 0.02));
border: 4rpx solid rgba(var(--primary-rgb), 0.15);
margin-bottom: 16rpx;
}
.target-time {
font-size: 64rpx;
font-weight: 700;
color: var(--primary);
font-variant-numeric: tabular-nums;
line-height: 1;
}
.target-unit {
display: block;
font-size: 26rpx;
color: var(--text-secondary);
margin-top: 4rpx;
line-height: 1;
}
.today-status {
margin-top: 16rpx;
}
.done-badge {
display: inline-flex;
align-items: center;
background: rgba(76, 175, 80, 0.08);
padding: 10rpx 24rpx;
border-radius: 24rpx;
}
.done-emoji {
font-size: 28rpx;
margin-right: 6rpx;
line-height: 1;
}
.done-text {
font-size: 26rpx;
color: var(--success);
line-height: 1;
}
.pending-text {
font-size: 26rpx;
color: #CCC;
line-height: 1;
}
/* ---- action buttons ---- */
.action-buttons {
margin-top: 16rpx;
}
.start-btn {
width: 100%;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 10rpx;
padding: 24rpx 0;
}
.btn-icon {
font-size: 28rpx;
line-height: 1;
}
.free-btn {
width: 100%;
margin-top: 20rpx;
background: transparent;
border: 2rpx solid rgba(var(--primary-rgb), 0.3);
color: var(--text-secondary);
border-radius: 48rpx;
font-size: 28rpx;
padding: 20rpx 0;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 8rpx;
}
.free-btn::after {
border: none;
}
.free-btn:active {
background: var(--primary-bg);
border-color: var(--primary);
color: var(--primary);
}
.free-icon {
font-size: 28rpx;
line-height: 1;
}
/* ---- tip card ---- */
.tip-card {
display: flex;
align-items: flex-start;
padding: 24rpx 32rpx;
margin-top: 32rpx;
background: rgba(var(--primary-rgb), 0.04);
border-radius: 20rpx;
animation: cardIn 0.45s 0.4s ease both;
}
.tip-icon {
font-size: 28rpx;
margin-right: 10rpx;
flex-shrink: 0;
line-height: 1.6;
}
.tip-text {
font-size: 28rpx;
color: var(--text-secondary);
line-height: 1.6;
}
/* ---- picker modal ---- */
.picker-modal {
width: 100%;
background: #fff;
border-radius: 32rpx 32rpx 0 0;
padding: 28rpx 32rpx 40rpx;
padding-bottom: calc(40rpx + env(safe-area-inset-bottom));
animation: slideUp 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
.picker-handle {
width: 64rpx;
height: 8rpx;
background: #DDD;
border-radius: 4rpx;
margin: 0 auto 24rpx;
}
@keyframes slideUp {
from { transform: translateY(100%); }
to { transform: translateY(0); }
}
.picker-title {
font-size: 34rpx;
font-weight: 600;
color: var(--text);
display: block;
text-align: center;
margin-bottom: 32rpx;
}
.preset-grid {
display: flex;
flex-wrap: wrap;
gap: 16rpx;
margin-bottom: 28rpx;
}
.preset-item {
flex: 0 0 calc(33.33% - 12rpx);
background: #F5F5F5;
border-radius: 16rpx;
padding: 20rpx 0;
text-align: center;
display: flex;
flex-direction: column;
}
.preset-item:active {
transform: scale(0.94);
}
.preset-item.selected {
background: var(--primary-bg);
border: 2rpx solid var(--primary);
}
.preset-num {
font-size: 36rpx;
font-weight: 700;
color: var(--text);
line-height: 1.1;
}
.preset-item.selected .preset-num {
color: var(--primary);
}
.preset-unit {
font-size: 20rpx;
color: var(--text-secondary);
margin-top: 2rpx;
line-height: 1;
}
.custom-input-row {
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 28rpx;
}
.custom-label {
font-size: 28rpx;
color: #666;
line-height: 1;
}
.custom-input {
width: 160rpx;
height: 64rpx;
background: #F5F5F5;
border-radius: 12rpx;
text-align: center;
font-size: 32rpx;
font-weight: 600;
color: var(--primary);
margin: 0 16rpx;
}
.picker-confirm {
width: 100%;
margin-bottom: 16rpx;
}
.picker-cancel {
display: block;
text-align: center;
font-size: 28rpx;
color: var(--text-secondary);
padding: 12rpx 0;
}