Files
doodle-mini/miniprogram/englishPages/letterTracing/letterTracing.less
T
2026-04-22 15:02:48 +08:00

251 lines
5.7 KiB
Plaintext
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.
@import '../../style/theme.less';
page {
background-color: @bg-page;
}
.lt-page {
min-height: 100vh;
padding: 0 @page-padding-x;
padding-bottom: calc(200rpx + env(safe-area-inset-bottom));
box-sizing: border-box;
}
.lt-main {
padding-top: 24rpx;
display: flex;
flex-direction: column;
/* space-y-8 = 32px → 64rpx */
gap: 64rpx;
}
/* ===== 独立 Section 区块(参考 UI 稿 space-y-4 ===== */
.lt-section {
display: flex;
flex-direction: column;
gap: 32rpx;
}
.lt-section-title {
font-size: 32rpx;
font-weight: 700;
color: #6d3b00;
padding-left: 8rpx;
}
/* ===== 练习类型 2列卡片网格 (grid-cols-2 gap-4) ===== */
.lt-mode-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 32rpx;
}
.lt-mode-card {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
// gap: 16rpx;
gap: 12rpx;
padding: 32rpx 24rpx;
border-radius: 24rpx;
background: #f8f0e0;
box-sizing: border-box;
transition:
transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
background 0.2s cubic-bezier(0.4, 0, 0.2, 1),
box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.lt-mode-card__icon {
display: inline-flex;
align-items: center;
justify-content: center;
margin-bottom: 4rpx;
}
.lt-mode-card--active {
background: linear-gradient(145deg, #ffd709 0%, #efc900 100%);
box-shadow: 0 8rpx 32rpx rgba(50, 46, 37, 0.06);
}
.lt-mode-card--pressed {
transform: scale(0.95);
}
.lt-mode-card__label {
font-size: 30rpx;
font-weight: 700;
color: @text-secondary;
text-align: center;
}
.lt-mode-card--active .lt-mode-card__label {
color: #453900;
}
/* ===== 字母选择网格 (grid-cols-6 gap-3) ===== */
.lt-letter-grid {
display: grid;
grid-template-columns: repeat(6, 1fr);
gap: 28rpx;
padding: 0 8rpx;
}
/* 字母格子 (aspect-square rounded-[12px] bg-surface-container) */
.lt-letter-cell {
aspect-ratio: 1;
display: flex;
align-items: center;
justify-content: center;
border-radius: 24rpx;
background: @bg-card;
box-sizing: border-box;
transition:
background-color 0.2s ease,
transform 0.2s ease,
box-shadow 0.2s ease;
}
/* 按下态(hover-class):与选中态同色,松手后由 --active 保持 */
.lt-letter-cell--pressed {
transform: scale(0.95);
background: @brand;
box-shadow: 0 2rpx 8rpx rgba(50, 46, 37, 0.08);
}
/* 选中字母 (bg-[#FFD700] text-[#6c5a00] shadow-sm) */
.lt-letter-cell--active {
background: @brand;
box-shadow: 0 2rpx 8rpx rgba(50, 46, 37, 0.08);
// box-shadow: @btn-shadow-pressed;
}
.lt-letter-text {
font-size: 32rpx;
font-weight: 700;
color: @text-secondary;
line-height: 1;
transition: color 0.2s ease;
}
.lt-letter-cell--active .lt-letter-text {
/* #6c5a00 */
color: @text-selected-btn;
}
.lt-letter-cell--pressed .lt-letter-text {
color: @text-selected-btn;
}
/* ===== 大小写切换 / 字母分组选择 ===== */
.lt-chip-row {
display: flex;
flex-direction: row;
/* gap-2 = 8px → 16rpx */
gap: 32rpx;
}
.lt-chip-row--wrap {
flex-wrap: wrap;
.lt-chip {
flex: none;
}
}
.lt-chip-row--triple {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 24rpx;
.lt-chip {
flex: unset;
width: 100%;
padding: 24rpx 16rpx;
}
}
/* 未选中 chip(与字母格子统一底色) */
.lt-chip {
flex: 1;
box-sizing: border-box;
text-align: center;
padding: 24rpx 24rpx;
font-size: 28rpx;
font-weight: 700;
line-height: 40rpx;
color: @text-secondary;
background: @bg-card;
border-radius: 32rpx;
transition:
background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
/* 按下态(hover-class),未选与已选 chip 共用 */
.lt-chip--pressed {
transform: scale(0.96);
background: @brand;
color: @text-selected-btn;
font-weight: 700;
box-shadow: 0 2rpx 8rpx rgba(50, 46, 37, 0.08);
}
/* 选中 chip (同练习类型选中态) */
.lt-chip--active {
background: @brand;
color: @text-selected-btn;
font-weight: 700;
box-shadow: 0 2rpx 8rpx rgba(50, 46, 37, 0.08);
}
/* 换一批:自定义描边按钮(对齐 stitch 粗边框 + 图标文案横排,避免 toy-button 覆盖成本) */
.lt-shuffle-btn {
box-sizing: border-box;
width: 100%;
height: 108rpx;
padding: 0 32rpx;
border-radius: 32rpx;
border: 8rpx solid @bg-card;
background: transparent;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
gap: 12rpx;
/* 与字母格/chip 一致:view 上勿依赖 :active 做背景或稳定缩放,用 hover-class */
transition:
transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1),
background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
/* 稿 active:scale-[0.98],按下时略铺底便于看出过渡 */
.lt-shuffle-btn--hover {
transform: scale(0.98);
opacity: 0.92;
background-color: rgba(234, 226, 208, 0.55);
}
/* toy-icon 自定义组件宿主节点默认 display:inline,须强制为 inline-flex 方可参与 flex 对齐 */
.lt-shuffle-btn toy-icon {
display: inline-flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
.lt-shuffle-btn__text {
font-size: 36rpx;
font-weight: 700;
line-height: 1;
color: @text-secondary;
transition: color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.lt-spacer-bottom {
height: 24rpx;
}