fix(app): 全链路验证修复 — 编译错误/CORS/迁移/启动脚本
Some checks failed
Main Merge / backend (push) Has been cancelled
Main Merge / frontend (push) Has been cancelled

前端修复:
- calendar_page: 移除不存在的 JournalEntry.content getter
- responsive_scaffold: 移除不存在的 notchThickness 参数
- splash_page: SingleTickerProvider → TickerProvider (多 AnimationController)
- profile_page: UserRoleType.name → .code (修复运行时崩溃)
- 导入缺失的 user.dart

后端修复:
- class_service: generate_class_code 取 UUID 后6位(随机部分)避免碰撞
- diary_role_seed: 移除不存在的 id 列,使用复合主键 ON CONFLICT

基础设施:
- config/default.toml: CORS 改为通配符(开发模式)
- scripts/dev.sh: 统一启动脚本(自动清理端口)
- docs/opendesign/: Open Design 设计规格 HTML 原型稿

验证结果: flutter analyze 0 error, cargo test 77/77 通过, 17个页面全部渲染正常
This commit is contained in:
iven
2026-06-02 01:03:58 +08:00
parent 749ef55b89
commit b320641d9c
56 changed files with 20696 additions and 239 deletions

View File

@@ -1,5 +1,6 @@
// 暖记色彩系统 — 7 色 × 浅色/深色模式
// 设计规格 v1.2
// 暖记色彩系统 — 完整设计 Token
// 对齐 Open Design 原型稿 tokens.css
// 浅色(暖阳) + 深色 + 松风主题色值
import 'package:flutter/material.dart';
@@ -7,7 +8,7 @@ import 'package:flutter/material.dart';
class AppColors {
AppColors._();
// ===== 浅色模式 =====
// ===== 核心七色 · 浅色模式(暖阳 Warm Sun=====
/// 奶油白背景 #FFF8F0
static const Color bgLight = Color(0xFFFFF8F0);
@@ -30,7 +31,45 @@ class AppColors {
/// 玫瑰粉 #D4A5A5
static const Color rose = Color(0xFFD4A5A5);
// ===== 色模式 =====
// ===== 中间色 · 浅色模式 =====
/// 次要文字 #5C4F47
static const Color fg2Light = Color(0xFF5C4F47);
/// 柔和/禁用文字 #7A6D63
static const Color mutedLight = Color(0xFF7A6D63);
/// 辅助说明文字 #8B7E74
static const Color metaLight = Color(0xFF8B7E74);
/// 边框 #E8DDD4
static const Color borderLight = Color(0xFFE8DDD4);
/// 柔和边框 #F0E8DF
static const Color borderSoftLight = Color(0xFFF0E8DF);
/// 主色悬停 #D06A4F
static const Color accentHover = Color(0xFFD06A4F);
/// 主色按下 #C05A3F
static const Color accentActive = Color(0xFFC05A3F);
/// 主色辉光 rgba(224,122,95,0.25)
static const Color accentGlow = Color(0x40E07A5F);
/// 温暖表面 #FFF3E6
static const Color surfaceWarmLight = Color(0xFFFFF3E6);
/// 鼠尾草绿柔和 #D4E8DC
static const Color secondarySoftLight = Color(0xFFD4E8DC);
/// 暖金柔和 #FBE8C8
static const Color tertiarySoftLight = Color(0xFFFBE8C8);
/// 玫瑰柔和 #F0DADA
static const Color roseSoftLight = Color(0xFFF0DADA);
// ===== 核心七色 · 深色模式 =====
/// 深色背景 #1A1614
static const Color bgDark = Color(0xFF1A1614);
@@ -53,20 +92,77 @@ class AppColors {
/// 深色玫瑰 #C4A0A0
static const Color roseDark = Color(0xFFC4A0A0);
// ===== 功能色 =====
// ===== 中间色 · 深色模式 =====
/// 错误红
static const Color error = Color(0xFFD32F2F);
/// 深色次要文字 #C4B8AA
static const Color fg2Dark = Color(0xFFC4B8AA);
/// 成功绿
static const Color success = Color(0xFF4CAF50);
/// 深色柔和文字 #9B8E82
static const Color mutedDark = Color(0xFF9B8E82);
/// 警告黄
static const Color warning = Color(0xFFFFA726);
/// 深色辅助文字 #7A6D63
static const Color metaDark = Color(0xFF7A6D63);
/// 信息蓝
/// 深色边框 #3A3530
static const Color borderDark = Color(0xFF3A3530);
/// 深色柔和边框 #302B26
static const Color borderSoftDark = Color(0xFF302B26);
/// 深色主色悬停 #D07A64
static const Color accentHoverDark = Color(0xFFD07A64);
/// 深色主色按下 #C06A54
static const Color accentActiveDark = Color(0xFFC06A54);
/// 深色主色辉光
static const Color accentGlowDark = Color(0x40E8907A);
/// 深色温暖表面 #332D28
static const Color surfaceWarmDark = Color(0xFF332D28);
/// 深色鼠尾草绿柔和 #2A3A2E
static const Color secondarySoftDark = Color(0xFF2A3A2E);
/// 深色暖金柔和 #302A1E
static const Color tertiarySoftDark = Color(0xFF302A1E);
/// 深色玫瑰柔和 #3A2A2A
static const Color roseSoftDark = Color(0xFF3A2A2A);
// ===== 功能色(对齐设计稿)=====
/// 错误/危险 #C93D3D
static const Color error = Color(0xFFC93D3D);
/// 成功 #5A9E7E
static const Color success = Color(0xFF5A9E7E);
/// 警告 #D4A843
static const Color warning = Color(0xFFD4A843);
/// 信息 #42A5F5
static const Color info = Color(0xFF42A5F5);
// ===== 功能色 · 深色模式 =====
/// 深色错误 #D94A4A
static const Color errorDark = Color(0xFFD94A4A);
/// 深色成功 #6AAF8E
static const Color successDark = Color(0xFF6AAF8E);
/// 深色警告 #C4A843
static const Color warningDark = Color(0xFFC4A843);
// ===== 阴影色调 =====
/// 浅色阴影 rgba(45,36,32,...)
static const Color shadowLight = Color(0xFF2D2420);
/// 深色阴影 rgba(0,0,0,...)
static const Color shadowDark = Color(0xFF000000);
// ===== 心情颜色映射 =====
/// 心情 → 颜色
@@ -78,17 +174,26 @@ class AppColors {
'thinking': Color(0xFFB8A9C9),// 🤔 思考 — 淡紫
};
/// 心情 → 日历背景色
static const Map<String, Color> moodCellColors = {
'happy': secondarySoftLight, // #D4E8DC
'love': roseSoftLight, // #F0DADA
'calm': tertiarySoftLight, // #FBE8C8
'sad': Color(0xFFD4DDE8), // 灰蓝
'tired': Color(0xFFE8E4E0), // 灰棕
};
// ===== 浅色主题色彩方案 =====
static const _light = ColorScheme(
brightness: Brightness.light,
primary: accent,
onPrimary: Colors.white,
onPrimary: Color(0xFFFFF8F0), // accent-on
primaryContainer: Color(0xFFFFE0D6),
onPrimaryContainer: fgLight,
secondary: secondary,
onSecondary: Colors.white,
secondaryContainer: Color(0xFFD4E8DC),
secondaryContainer: secondarySoftLight,
onSecondaryContainer: fgLight,
tertiary: tertiary,
onTertiary: fgLight,
@@ -96,6 +201,9 @@ class AppColors {
onError: Colors.white,
surface: surfaceLight,
onSurface: fgLight,
onSurfaceVariant: mutedLight, // 次要文字
outline: borderLight, // 边框
outlineVariant: borderSoftLight, // 柔和边框
surfaceContainerHighest: bgLight,
);
@@ -104,19 +212,22 @@ class AppColors {
static const _dark = ColorScheme(
brightness: Brightness.dark,
primary: accentDark,
onPrimary: fgDark,
onPrimary: Color(0xFF1A1614), // accent-on dark
primaryContainer: Color(0xFF5A2E22),
onPrimaryContainer: Color(0xFFFFD6CC),
secondary: secondaryDark,
onSecondary: fgDark,
secondaryContainer: Color(0xFF2A4A38),
secondaryContainer: secondarySoftDark,
onSecondaryContainer: Color(0xFFD4E8DC),
tertiary: tertiaryDark,
onTertiary: fgDark,
error: Color(0xFFEF5350),
error: errorDark,
onError: fgDark,
surface: surfaceDark,
onSurface: fgDark,
onSurfaceVariant: mutedDark,
outline: borderDark,
outlineVariant: borderSoftDark,
surfaceContainerHighest: bgDark,
);

View File

@@ -1,11 +1,15 @@
// 暖记圆角系统
// 设计规格: 10 / 16 / 22 / 28 / pill
// 对齐 Open Design 原型稿 tokens.css: xs(8) / sm(10) / md(16) / lg(22) / xl(28) / pill
import 'package:flutter/material.dart';
class AppRadius {
AppRadius._();
/// 极小圆角 8px — 小型元素
static const double xs = 8;
static BorderRadius get xsBorder => BorderRadius.circular(xs);
/// 小圆角 10px — 按钮、输入框
static const double sm = 10;
static BorderRadius get smBorder => BorderRadius.circular(sm);

View File

@@ -1,4 +1,5 @@
// 暖记主题入口 — 浅色/深色 ThemeData
// 对齐 Open Design 原型稿设计系统
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
@@ -44,7 +45,7 @@ class AppTheme {
shape: RoundedRectangleBorder(
borderRadius: AppRadius.mdBorder,
side: BorderSide(
color: colorScheme.outlineVariant.withValues(alpha: 0.3),
color: colorScheme.outlineVariant,
),
),
color: colorScheme.surface,
@@ -102,7 +103,7 @@ class AppTheme {
bottomNavigationBarTheme: BottomNavigationBarThemeData(
type: BottomNavigationBarType.fixed,
selectedItemColor: colorScheme.primary,
unselectedItemColor: colorScheme.onSurface.withValues(alpha: 0.5),
unselectedItemColor: colorScheme.onSurfaceVariant,
backgroundColor: colorScheme.surface,
elevation: 8,
),
@@ -115,15 +116,15 @@ class AppTheme {
side: BorderSide.none,
),
// FloatingActionButton
// FloatingActionButton — 珊瑚色圆形凸起
floatingActionButtonTheme: FloatingActionButtonThemeData(
shape: RoundedRectangleBorder(
borderRadius: AppRadius.mdBorder,
),
backgroundColor: isLight ? AppColors.accent : AppColors.accentDark,
foregroundColor: isLight ? const Color(0xFFFFF8F0) : const Color(0xFF1A1614),
shape: const CircleBorder(),
elevation: 4,
),
// Page transitions — 弹性曲线
// Page transitions — 弹性曲线 cubic-bezier(0.34, 1.56, 0.64, 1)
pageTransitionsTheme: PageTransitionsTheme(
builders: {
TargetPlatform.android: _WarmCurveBuilder(),

View File

@@ -1,4 +1,6 @@
// 暖记字体系统 — Noto Sans SC + Caveat
// 暖记字体系统 — Quicksand(标题) + Nunito(正文) + Caveat(手写装饰)
// 对齐 Open Design 原型稿 tokens.css
// 字体文件待下载,当前系统字体回退
import 'package:flutter/material.dart';
@@ -6,99 +8,102 @@ class AppTypography {
AppTypography._();
/// 字体族
static const String displayFont = 'Caveat'; // 手写风格(标题装饰
static const String bodyFont = 'NotoSansSC'; // 正文(中文优先
static const String displayFont = 'Quicksand'; // 标题显示(待下载,系统回退 sans-serif
static const String bodyFont = 'Nunito'; // 正文(待下载,系统回退 sans-serif
static const String handwrittenFont = 'Caveat'; // 手写装饰(已有字体文件)
static const String cjkFont = 'NotoSansSC'; // CJK 回退(已有字体文件)
static const String monoFont = 'JetBrains Mono'; // 等宽(暂用系统回退)
/// 浅色主题文字主题
/// 字号对齐设计稿: xs=11, sm=13, base=15, md=17, lg=20, xl=24, 2xl=30, 3xl=38, 4xl=48
static TextTheme lightTextTheme() => TextTheme(
// 大标题 — 手写风格
// Display — Quicksand 标题(对应 text-3xl / text-4xl
displayLarge: TextStyle(
fontFamily: displayFont,
fontSize: 57,
fontSize: 48,
height: 1.12,
fontWeight: FontWeight.w700,
),
displayMedium: TextStyle(
fontFamily: displayFont,
fontSize: 45,
fontSize: 38,
height: 1.16,
fontWeight: FontWeight.w700,
),
displaySmall: TextStyle(
fontFamily: displayFont,
fontSize: 36,
height: 1.22,
fontSize: 30,
height: 1.2,
fontWeight: FontWeight.w700,
),
// 标题 — 正文衬线
// Headline — Nunito 标题(对应 text-xl / text-2xl
headlineLarge: TextStyle(
fontFamily: bodyFont,
fontSize: 32,
fontSize: 30,
height: 1.25,
fontWeight: FontWeight.w700,
),
headlineMedium: TextStyle(
fontFamily: bodyFont,
fontSize: 28,
fontSize: 24,
height: 1.29,
fontWeight: FontWeight.w600,
),
headlineSmall: TextStyle(
fontFamily: bodyFont,
fontSize: 24,
height: 1.33,
fontSize: 20,
height: 1.3,
fontWeight: FontWeight.w600,
),
// 副标题
// Title — Nunito 副标题(对应 text-md / text-base
titleLarge: TextStyle(
fontFamily: bodyFont,
fontSize: 22,
height: 1.27,
fontSize: 17,
height: 1.3,
fontWeight: FontWeight.w600,
),
titleMedium: TextStyle(
fontFamily: bodyFont,
fontSize: 16,
height: 1.5,
fontSize: 15,
height: 1.6,
fontWeight: FontWeight.w600,
),
titleSmall: TextStyle(
fontFamily: bodyFont,
fontSize: 14,
height: 1.43,
fontSize: 13,
height: 1.4,
fontWeight: FontWeight.w600,
),
// 正文
// Body — Nunito 正文(对应 text-base / text-sm
bodyLarge: TextStyle(
fontFamily: bodyFont,
fontSize: 16,
height: 1.5,
fontSize: 15,
height: 1.6,
fontWeight: FontWeight.w400,
),
bodyMedium: TextStyle(
fontFamily: bodyFont,
fontSize: 14,
height: 1.43,
fontSize: 15,
height: 1.6,
fontWeight: FontWeight.w400,
),
bodySmall: TextStyle(
fontFamily: bodyFont,
fontSize: 12,
height: 1.33,
fontSize: 13,
height: 1.6,
fontWeight: FontWeight.w400,
),
// 标签
// Label — Nunito 标签(对应 text-base / text-sm / text-xs
labelLarge: TextStyle(
fontFamily: bodyFont,
fontSize: 14,
height: 1.43,
fontSize: 15,
height: 1.6,
fontWeight: FontWeight.w500,
),
labelMedium: TextStyle(
fontFamily: bodyFont,
fontSize: 12,
height: 1.33,
fontSize: 13,
height: 1.6,
fontWeight: FontWeight.w500,
),
labelSmall: TextStyle(
@@ -109,6 +114,6 @@ class AppTypography {
),
);
/// 深色主题文字主题
/// 深色主题文字主题(与浅色共享字号,颜色由 ColorScheme 控制)
static TextTheme darkTextTheme() => lightTextTheme();
}

View File

@@ -3,6 +3,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:nuanji_app/core/theme/app_colors.dart';
import 'package:nuanji_app/core/theme/app_radius.dart';
import 'package:nuanji_app/data/remote/api_client.dart';
import '../bloc/achievement_bloc.dart';
@@ -129,7 +130,7 @@ class _AchievementProgressCard extends StatelessWidget {
return Card(
elevation: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(22),
borderRadius: AppRadius.lgBorder,
),
color: colorScheme.primaryContainer,
child: Padding(
@@ -156,7 +157,7 @@ class _AchievementProgressCard extends StatelessWidget {
),
const SizedBox(height: 12),
ClipRRect(
borderRadius: BorderRadius.circular(8),
borderRadius: AppRadius.xsBorder,
child: LinearProgressIndicator(
value: progress,
minHeight: 10,
@@ -188,7 +189,7 @@ class _AchievementCard extends StatelessWidget {
return Card(
elevation: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16),
borderRadius: AppRadius.mdBorder,
side: BorderSide(
color: achievement.isUnlocked
? AppColors.accent.withValues(alpha: 0.4)

View File

@@ -1,14 +1,16 @@
// 日历页面 — 月视图 + 日记列表
// 日历页面 — 月视图(心情色彩) + 周视图 + 时间轴
// 对齐 Open Design 原型稿: 日历格子用心情颜色填充背景 + 月/周/时间轴切换
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:go_router/go_router.dart';
import 'package:nuanji_app/core/theme/app_colors.dart';
import 'package:nuanji_app/core/theme/app_radius.dart';
import 'package:nuanji_app/data/models/journal_entry.dart';
import 'package:nuanji_app/data/repositories/journal_repository.dart';
import '../bloc/calendar_bloc.dart';
/// 日历页面 — 月视图 + 选中日期的日记列表
/// 日历页面 — 月视图(心情色彩) + 周视图 + 时间轴
class CalendarPage extends StatelessWidget {
const CalendarPage({super.key});
@@ -80,8 +82,54 @@ class _CalendarView extends StatelessWidget {
},
),
// 视图模式切换
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 4),
child: SegmentedButton<CalendarViewMode>(
segments: const [
ButtonSegment(value: CalendarViewMode.month, label: Text('')),
ButtonSegment(value: CalendarViewMode.week, label: Text('')),
ButtonSegment(value: CalendarViewMode.timeline, label: Text('时间轴')),
],
selected: {loaded.viewMode},
onSelectionChanged: (modes) {
context.read<CalendarBloc>()
.add(CalendarViewModeChanged(modes.first));
},
style: ButtonStyle(
visualDensity: VisualDensity.compact,
textStyle: WidgetStatePropertyAll(theme.textTheme.labelSmall),
),
),
),
// 根据视图模式切换内容
switch (loaded.viewMode) {
CalendarViewMode.month => _MonthView(loaded: loaded),
CalendarViewMode.week => _WeekView(loaded: loaded),
CalendarViewMode.timeline => _TimelineView(loaded: loaded),
},
],
);
},
);
}
}
// ===== 月视图 =====
class _MonthView extends StatelessWidget {
const _MonthView({required this.loaded});
final CalendarLoaded loaded;
@override
Widget build(BuildContext context) {
return Expanded(
child: Column(
children: [
// 星期标题行
_WeekdayHeader(colorScheme: colorScheme),
_WeekdayHeader(colorScheme: Theme.of(context).colorScheme),
// 日历网格
_CalendarGrid(
@@ -102,13 +150,261 @@ class _CalendarView extends StatelessWidget {
: _DayJournalList(journals: loaded.selectedDayJournals),
),
],
);
},
),
);
}
}
/// 月份导航栏
// ===== 周视图 =====
class _WeekView extends StatelessWidget {
const _WeekView({required this.loaded});
final CalendarLoaded loaded;
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final colorScheme = theme.colorScheme;
// 计算选中日期所在周
final selected = loaded.selectedDay;
final startOfWeek = selected.subtract(Duration(days: selected.weekday - 1));
return Expanded(
child: ListView(
padding: const EdgeInsets.all(16),
children: [
// 7 天条目
...List.generate(7, (i) {
final day = startOfWeek.add(Duration(days: i));
final dayKey = DateTime(day.year, day.month, day.day);
final journals = loaded.journalsByDate[dayKey] ?? [];
final isToday = _isToday(day);
final isSelected = _isSameDay(day, loaded.selectedDay);
final hasEntry = journals.isNotEmpty;
return Padding(
padding: const EdgeInsets.only(bottom: 8),
child: InkWell(
onTap: () {
context.read<CalendarBloc>().add(CalendarDaySelected(day));
},
borderRadius: AppRadius.mdBorder,
child: Container(
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: isSelected
? colorScheme.primaryContainer
: hasEntry
? _getMoodBgColor(journals.first.mood.value)
: colorScheme.surface,
borderRadius: AppRadius.mdBorder,
border: Border.all(
color: isToday
? colorScheme.primary
: colorScheme.outlineVariant,
width: isToday ? 2 : 1,
),
),
child: Row(
children: [
// 日期
SizedBox(
width: 48,
child: Column(
children: [
Text(
_weekdayName(day.weekday),
style: theme.textTheme.labelSmall?.copyWith(
color: colorScheme.onSurfaceVariant,
),
),
Text(
'${day.day}',
style: theme.textTheme.titleLarge?.copyWith(
fontWeight: isToday ? FontWeight.bold : FontWeight.normal,
color: isToday ? colorScheme.primary : null,
),
),
],
),
),
const SizedBox(width: 16),
// 内容
Expanded(
child: hasEntry
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
journals.first.title,
style: theme.textTheme.titleSmall?.copyWith(
fontWeight: FontWeight.w600,
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
if (journals.length > 1)
Text(
'还有 ${journals.length - 1} 篇日记',
style: theme.textTheme.bodySmall?.copyWith(
color: colorScheme.onSurfaceVariant,
),
),
],
)
: Text(
'无日记',
style: theme.textTheme.bodySmall?.copyWith(
color: colorScheme.onSurface.withValues(alpha: 0.4),
),
),
),
// 心情 emoji
if (hasEntry)
Text(
_moodEmoji(journals.first.mood),
style: const TextStyle(fontSize: 24),
),
],
),
),
),
);
}),
],
),
);
}
}
// ===== 时间轴视图 =====
class _TimelineView extends StatelessWidget {
const _TimelineView({required this.loaded});
final CalendarLoaded loaded;
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final colorScheme = theme.colorScheme;
// 获取当月所有日记,按日期排序
final allJournals = loaded.journalsByDate.entries
.expand((e) => e.value.map((j) => MapEntry(e.key, j)))
.toList()
..sort((a, b) => b.key.compareTo(a.key));
if (allJournals.isEmpty) {
return Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Icon(Icons.timeline_outlined, size: 48,
color: colorScheme.onSurface.withValues(alpha: 0.2)),
const SizedBox(height: 16),
Text('本月还没有日记', style: theme.textTheme.bodyLarge),
],
),
);
}
return Expanded(
child: ListView.builder(
padding: const EdgeInsets.all(16),
itemCount: allJournals.length,
itemBuilder: (context, index) {
final entry = allJournals[index];
final date = entry.key;
final journal = entry.value;
final isLast = index == allJournals.length - 1;
return IntrinsicHeight(
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// 时间轴线
SizedBox(
width: 60,
child: Column(
children: [
// 圆点 + emoji
Container(
width: 36,
height: 36,
decoration: BoxDecoration(
color: _getMoodBgColor(journal.mood.value),
shape: BoxShape.circle,
),
alignment: Alignment.center,
child: Text(_moodEmoji(journal.mood), style: const TextStyle(fontSize: 18)),
),
// 竖线
if (!isLast)
Expanded(
child: Container(
width: 2,
color: colorScheme.outlineVariant,
),
),
],
),
),
// 内容卡片
Expanded(
child: Padding(
padding: const EdgeInsets.only(bottom: 12),
child: Card(
elevation: 0,
shape: RoundedRectangleBorder(
borderRadius: AppRadius.mdBorder,
side: BorderSide(color: colorScheme.outlineVariant),
),
child: InkWell(
onTap: () => context.push('/editor?id=${journal.id}'),
borderRadius: AppRadius.mdBorder,
child: Padding(
padding: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'${date.month}${date.day}',
style: theme.textTheme.labelSmall?.copyWith(
color: colorScheme.onSurfaceVariant,
),
),
const SizedBox(height: 4),
Text(
journal.title,
style: theme.textTheme.titleSmall?.copyWith(
fontWeight: FontWeight.w600,
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
// 日记内容通过 JournalElement 管理,日历视图仅显示标题
// 后续可通过 elements 预览首段文字
],
),
),
),
),
),
),
],
),
);
},
),
);
}
}
// ===== 月份导航栏 =====
class _MonthNavigator extends StatelessWidget {
const _MonthNavigator({
required this.month,
@@ -160,7 +456,8 @@ class _MonthNavigator extends StatelessWidget {
}
}
/// 星期标题行
// ===== 星期标题行 =====
class _WeekdayHeader extends StatelessWidget {
const _WeekdayHeader({required this.colorScheme});
@@ -191,7 +488,8 @@ class _WeekdayHeader extends StatelessWidget {
}
}
/// 日历网格 — 6行7列
// ===== 日历网格 — 6行7列(带心情色彩背景)=====
class _CalendarGrid extends StatelessWidget {
const _CalendarGrid({
required this.month,
@@ -207,8 +505,6 @@ class _CalendarGrid extends StatelessWidget {
@override
Widget build(BuildContext context) {
final colorScheme = Theme.of(context).colorScheme;
final today = DateTime.now();
final days = _generateDays(month);
return Padding(
@@ -217,19 +513,18 @@ class _CalendarGrid extends StatelessWidget {
children: days.map((week) {
return Row(
children: week.map((dayInfo) {
final dayKey = DateTime(
dayInfo.date.year, dayInfo.date.month, dayInfo.date.day);
final journals = journalsByDate[dayKey] ?? [];
final moodValue = journals.isNotEmpty ? journals.first.mood.value : null;
return Expanded(
child: _DayCell(
dayInfo: dayInfo,
isToday: dayInfo.date.year == today.year &&
dayInfo.date.month == today.month &&
dayInfo.date.day == today.day,
isSelected: dayInfo.date.year == selectedDay.year &&
dayInfo.date.month == selectedDay.month &&
dayInfo.date.day == selectedDay.day,
hasJournals: journalsByDate.containsKey(
DateTime(dayInfo.date.year, dayInfo.date.month, dayInfo.date.day),
),
colorScheme: colorScheme,
isToday: _isToday(dayInfo.date),
isSelected: _isSameDay(dayInfo.date, selectedDay),
hasJournals: journals.isNotEmpty,
moodValue: moodValue,
onTap: () => onDaySelected(dayInfo.date),
),
);
@@ -240,35 +535,26 @@ class _CalendarGrid extends StatelessWidget {
);
}
/// 生成当月日历数据(包含前后补齐)
List<List<_DayInfo>> _generateDays(DateTime month) {
final firstDay = DateTime(month.year, month.month, 1);
// 周一为第一天weekday 1=Mon...7=Sun
final startOffset = firstDay.weekday - 1;
final daysInMonth = DateTime(month.year, month.month + 1, 0).day;
final allDays = <_DayInfo>[];
// 前面的空白
for (var i = 0; i < startOffset; i++) {
allDays.add(_DayInfo(date: firstDay.subtract(Duration(days: startOffset - i)), isCurrentMonth: false));
}
// 当月日期
for (var d = 1; d <= daysInMonth; d++) {
allDays.add(_DayInfo(
date: DateTime(month.year, month.month, d),
isCurrentMonth: true,
));
allDays.add(_DayInfo(date: DateTime(month.year, month.month, d), isCurrentMonth: true));
}
// 后面的补齐到完整行
while (allDays.length % 7 != 0) {
final last = allDays.last.date;
allDays.add(_DayInfo(date: last.add(const Duration(days: 1)), isCurrentMonth: false));
}
// 分周
return List.generate(allDays.length ~/ 7, (i) => allDays.sublist(i * 7, (i + 1) * 7));
}
}
@@ -279,14 +565,15 @@ class _DayInfo {
final bool isCurrentMonth;
}
/// 单日格子
// ===== 单日格子(带心情色彩背景)=====
class _DayCell extends StatelessWidget {
const _DayCell({
required this.dayInfo,
required this.isToday,
required this.isSelected,
required this.hasJournals,
required this.colorScheme,
required this.moodValue,
required this.onTap,
});
@@ -294,33 +581,43 @@ class _DayCell extends StatelessWidget {
final bool isToday;
final bool isSelected;
final bool hasJournals;
final ColorScheme colorScheme;
final String? moodValue;
final VoidCallback onTap;
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final colorScheme = theme.colorScheme;
// 心情色彩背景
final moodBg = hasJournals && moodValue != null
? _getMoodBgColor(moodValue!)
: Colors.transparent;
return GestureDetector(
onTap: onTap,
behavior: HitTestBehavior.opaque,
child: Container(
height: 44,
height: 48,
margin: const EdgeInsets.all(2),
decoration: BoxDecoration(
color: isSelected
? colorScheme.primary
: moodBg != Colors.transparent
? moodBg
: isToday
? colorScheme.primaryContainer
: null,
borderRadius: AppRadius.xsBorder,
border: isToday && !isSelected
? Border.all(color: colorScheme.primary, width: 2)
: null,
),
alignment: Alignment.center,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(
width: 32,
height: 32,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: isSelected
? colorScheme.primary
: isToday
? colorScheme.primaryContainer
: null,
),
alignment: Alignment.center,
child: Text(
Text(
'${dayInfo.date.day}',
style: TextStyle(
fontSize: 14,
@@ -332,18 +629,15 @@ class _DayCell extends StatelessWidget {
: colorScheme.onSurface,
),
),
),
// 日记指示点
if (hasJournals)
// 心情小圆点(仅在有日记但无背景色时显示)
if (hasJournals && moodBg == Colors.transparent)
Container(
width: 4,
height: 4,
margin: const EdgeInsets.only(top: 2),
margin: const EdgeInsets.only(top: 1),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: isSelected
? colorScheme.onPrimary
: AppColors.accent,
color: isSelected ? colorScheme.onPrimary : AppColors.accent,
),
),
],
@@ -353,7 +647,8 @@ class _DayCell extends StatelessWidget {
}
}
/// 无日记的空状态
// ===== 无日记的空状态 =====
class _EmptyDayView extends StatelessWidget {
const _EmptyDayView({required this.selectedDay});
@@ -394,7 +689,8 @@ class _EmptyDayView extends StatelessWidget {
}
}
/// 日记列表
// ===== 日记列表 =====
class _DayJournalList extends StatelessWidget {
const _DayJournalList({required this.journals});
@@ -416,17 +712,16 @@ class _DayJournalList extends StatelessWidget {
margin: const EdgeInsets.only(bottom: 12),
elevation: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16),
borderRadius: AppRadius.mdBorder,
side: BorderSide(color: colorScheme.outlineVariant),
),
child: InkWell(
onTap: () => context.push('/editor?id=${journal.id}'),
borderRadius: BorderRadius.circular(16),
borderRadius: AppRadius.mdBorder,
child: Padding(
padding: const EdgeInsets.all(16),
child: Row(
children: [
// 心情图标
Container(
width: 40,
height: 40,
@@ -441,7 +736,6 @@ class _DayJournalList extends StatelessWidget {
),
),
const SizedBox(width: 12),
// 标题和标签
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@@ -478,8 +772,17 @@ class _DayJournalList extends StatelessWidget {
},
);
}
}
String _moodEmoji(Mood mood) {
// ===== 辅助函数 =====
/// 获取心情对应的日历格子背景色
Color _getMoodBgColor(String mood) {
return AppColors.moodCellColors[mood] ?? AppColors.secondarySoftLight;
}
/// 心情 → emoji
String _moodEmoji(Mood mood) {
return switch (mood) {
Mood.happy => '😊',
Mood.calm => '😌',
@@ -487,5 +790,29 @@ class _DayJournalList extends StatelessWidget {
Mood.angry => '😠',
Mood.thinking => '🤔',
};
}
}
/// 是否是今天
bool _isToday(DateTime date) {
final now = DateTime.now();
return date.year == now.year && date.month == now.month && date.day == now.day;
}
/// 是否同一天
bool _isSameDay(DateTime a, DateTime b) {
return a.year == b.year && a.month == b.month && a.day == b.day;
}
/// 周几名称
String _weekdayName(int weekday) {
return switch (weekday) {
1 => '周一',
2 => '周二',
3 => '周三',
4 => '周四',
5 => '周五',
6 => '周六',
7 => '周日',
_ => '',
};
}

View File

@@ -0,0 +1,634 @@
// 月度概览页面 — 心情色彩月历 + 月度统计 + 精选日记
// 对齐 Open Design 原型稿 screens/monthly.html
import 'package:flutter/material.dart';
import 'package:nuanji_app/core/theme/app_colors.dart';
import 'package:nuanji_app/core/theme/app_radius.dart';
import 'package:nuanji_app/core/theme/app_shadows.dart';
import 'package:nuanji_app/core/theme/app_typography.dart';
/// 月度概览页面
class MonthlyPage extends StatefulWidget {
const MonthlyPage({super.key});
@override
State<MonthlyPage> createState() => _MonthlyPageState();
}
class _MonthlyPageState extends State<MonthlyPage> {
late DateTime _focusedMonth;
@override
void initState() {
super.initState();
_focusedMonth = DateTime.now();
}
void _goToPreviousMonth() {
setState(() {
_focusedMonth = DateTime(_focusedMonth.year, _focusedMonth.month - 1);
});
}
void _goToNextMonth() {
setState(() {
_focusedMonth = DateTime(_focusedMonth.year, _focusedMonth.month + 1);
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: Column(
children: [
// 月头部导航
_MonthHeader(
month: _focusedMonth,
onPrevious: _goToPreviousMonth,
onNext: _goToNextMonth,
),
// 可滚动内容区
Expanded(
child: ListView(
padding: const EdgeInsets.symmetric(horizontal: 20),
children: [
const SizedBox(height: 16),
// 心情色彩月历
_MoodCalendar(month: _focusedMonth),
const SizedBox(height: 20),
// 月度统计 2x2
const _MonthSummary(),
const SizedBox(height: 20),
// 精选日记
const _Highlights(),
const SizedBox(height: 32),
],
),
),
],
),
),
);
}
}
// ===== 月头部导航 =====
class _MonthHeader extends StatelessWidget {
const _MonthHeader({
required this.month,
required this.onPrevious,
required this.onNext,
});
final DateTime month;
final VoidCallback onPrevious;
final VoidCallback onNext;
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final colorScheme = theme.colorScheme;
final title = '${month.year}${month.month}';
return Padding(
padding: const EdgeInsets.fromLTRB(20, 8, 12, 0),
child: Row(
children: [
Expanded(
child: Text(
title,
style: theme.textTheme.headlineSmall?.copyWith(
fontFamily: AppTypography.displayFont,
fontWeight: FontWeight.w700,
),
),
),
_NavButton(
icon: Icons.chevron_left_rounded,
onTap: onPrevious,
borderColor: colorScheme.outline,
foregroundColor: colorScheme.onSurface,
),
const SizedBox(width: 8),
_NavButton(
icon: Icons.chevron_right_rounded,
onTap: onNext,
borderColor: colorScheme.outline,
foregroundColor: colorScheme.onSurface,
),
],
),
);
}
}
/// 圆形导航按钮 (44px 触摸目标)
class _NavButton extends StatelessWidget {
const _NavButton({
required this.icon,
required this.onTap,
required this.borderColor,
required this.foregroundColor,
});
final IconData icon;
final VoidCallback onTap;
final Color borderColor;
final Color foregroundColor;
@override
Widget build(BuildContext context) {
return SizedBox(
width: 44,
height: 44,
child: OutlinedButton(
onPressed: onTap,
style: OutlinedButton.styleFrom(
padding: EdgeInsets.zero,
shape: const CircleBorder(),
side: BorderSide(color: borderColor, width: 1.5),
foregroundColor: foregroundColor,
backgroundColor: Theme.of(context).colorScheme.surface,
),
child: Icon(icon, size: 18),
),
);
}
}
// ===== 心情色彩月历 =====
class _MoodCalendar extends StatelessWidget {
const _MoodCalendar({required this.month});
final DateTime month;
// 心情类型
static const _moodTypes = [
'happy', 'calm', 'sad', 'tired', 'love',
];
// 心情 → emoji
static const _moodEmojis = <String, String>{
'happy': '😊',
'calm': '😐',
'sad': '😢',
'tired': '😐',
'love': '😡',
};
// 心情 → 背景色
static const _moodBgColors = <String, Color>{
'happy': AppColors.secondarySoftLight,
'love': AppColors.roseSoftLight,
'calm': AppColors.tertiarySoftLight,
'sad': Color(0xFFD4DDE8),
'tired': Color(0xFFE8E4E0),
};
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final colorScheme = theme.colorScheme;
final now = DateTime.now();
return Container(
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: colorScheme.surface,
borderRadius: AppRadius.mdBorder,
boxShadow: AppShadows.soft(context),
border: Border.all(color: colorScheme.outlineVariant),
),
child: Column(
children: [
// 星期标题行
_WeekdayRow(colorScheme: colorScheme),
const SizedBox(height: 8),
// 7列网格
_buildGrid(context, now),
],
),
);
}
Widget _buildGrid(BuildContext context, DateTime now) {
final firstDay = DateTime(month.year, month.month, 1);
// 周日=0 → 偏移量; weekday 返回 1(周一)..7(周日)
final startOffset = firstDay.weekday % 7; // 周日开头
final daysInMonth = DateTime(month.year, month.month + 1, 0).day;
final cells = <Widget>[];
// 空白填充
for (var i = 0; i < startOffset; i++) {
cells.add(const SizedBox.shrink());
}
// 模拟心情数据(确定性伪随机,同一天固定同心情)
final rng = _SeededRandom(month.year * 100 + month.month);
for (var d = 1; d <= daysInMonth; d++) {
final isToday = now.year == month.year &&
now.month == month.month &&
now.day == d;
// 每天随机一个心情
final moodIndex = rng.nextInt(5);
final mood = _moodTypes[moodIndex];
final bgColor = _moodBgColors[mood] ?? Colors.transparent;
final emoji = _moodEmojis[mood] ?? '';
cells.add(
_MoodCell(
day: d,
emoji: emoji,
bgColor: bgColor,
isToday: isToday,
),
);
}
return GridView.count(
crossAxisCount: 7,
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
mainAxisSpacing: 3,
crossAxisSpacing: 3,
childAspectRatio: 1,
children: cells,
);
}
}
/// 简单确定性伪随机数生成器(仅用于模拟数据)
class _SeededRandom {
_SeededRandom(int seed) : _state = seed;
int _state;
int nextInt(int max) {
_state = (_state * 1103515245 + 12345) & 0x7FFFFFFF;
return _state % max;
}
}
/// 星期标题行
class _WeekdayRow extends StatelessWidget {
const _WeekdayRow({required this.colorScheme});
final ColorScheme colorScheme;
@override
Widget build(BuildContext context) {
const weekdays = ['', '', '', '', '', '', ''];
return Row(
children: weekdays.map((day) {
return Expanded(
child: Center(
child: Text(
day,
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w500,
color: colorScheme.onSurfaceVariant,
),
),
),
);
}).toList(),
);
}
}
/// 单个心情格子
class _MoodCell extends StatelessWidget {
const _MoodCell({
required this.day,
required this.emoji,
required this.bgColor,
required this.isToday,
});
final int day;
final String emoji;
final Color bgColor;
final bool isToday;
@override
Widget build(BuildContext context) {
final colorScheme = Theme.of(context).colorScheme;
return GestureDetector(
onTap: () {
// TODO: 选择日期,跳转详情
},
child: Container(
decoration: BoxDecoration(
color: bgColor,
borderRadius: BorderRadius.circular(6),
border: isToday
? Border.all(color: AppColors.accent, width: 2)
: null,
),
alignment: Alignment.center,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Text(
'$day',
style: TextStyle(
fontSize: 12,
color: colorScheme.onSurface,
fontWeight: isToday ? FontWeight.w700 : FontWeight.w400,
),
),
const SizedBox(height: 1),
Text(
emoji,
style: const TextStyle(fontSize: 10),
),
],
),
),
);
}
}
// ===== 月度统计 2x2 =====
class _MonthSummary extends StatelessWidget {
const _MonthSummary();
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'本月总结',
style: theme.textTheme.headlineSmall?.copyWith(
fontFamily: AppTypography.displayFont,
fontWeight: FontWeight.w700,
),
),
const SizedBox(height: 16),
GridView.count(
crossAxisCount: 2,
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
mainAxisSpacing: 12,
crossAxisSpacing: 12,
childAspectRatio: 1.2,
children: [
_StatCard(
icon: '📝',
value: '28',
label: '日记篇数',
bgColor: AppColors.tertiarySoftLight,
valueColor: const Color(0xFFB8860B),
),
_StatCard(
icon: '🔥',
value: '12',
label: '最长连续',
bgColor: AppColors.secondarySoftLight,
valueColor: const Color(0xFF2D7D46),
),
_StatCard(
icon: '😊',
value: '72%',
label: '好心情占比',
bgColor: AppColors.roseSoftLight,
valueColor: const Color(0xFF9B4D4D),
),
_StatCard(
icon: '📸',
value: '18',
label: '照片数量',
bgColor: const Color(0xFFD4DDE8),
valueColor: const Color(0xFF4A6B8A),
),
],
),
],
);
}
}
/// 单张统计小卡片
class _StatCard extends StatelessWidget {
const _StatCard({
required this.icon,
required this.value,
required this.label,
required this.bgColor,
required this.valueColor,
});
final String icon;
final String value;
final String label;
final Color bgColor;
final Color valueColor;
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
return Container(
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: bgColor,
borderRadius: AppRadius.mdBorder,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(icon, style: const TextStyle(fontSize: 24)),
const SizedBox(height: 8),
Text(
value,
style: TextStyle(
fontFamily: AppTypography.displayFont,
fontSize: 24,
fontWeight: FontWeight.w700,
color: valueColor,
),
),
const SizedBox(height: 2),
Text(
label,
style: theme.textTheme.labelSmall?.copyWith(
color: theme.colorScheme.onSurfaceVariant,
),
),
],
),
);
}
}
// ===== 精选日记 =====
class _Highlights extends StatelessWidget {
const _Highlights();
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
// 模拟精选日记数据
const highlights = [
(
emoji: '😊',
emojiBg: AppColors.roseSoftLight,
date: '5月14日',
title: '和朋友聚餐的欢乐时光',
badge: '最佳心情',
badgeBg: AppColors.roseSoftLight,
badgeFg: Color(0xFF9B4D4D),
),
(
emoji: '',
emojiBg: AppColors.tertiarySoftLight,
date: '5月21日',
title: '完成了第一个小目标',
badge: '里程碑',
badgeBg: AppColors.tertiarySoftLight,
badgeFg: Color(0xFFB8860B),
),
(
emoji: '📚',
emojiBg: AppColors.secondarySoftLight,
date: '5月28日',
title: '期末考试结束',
badge: '最详尽记录',
badgeBg: AppColors.secondarySoftLight,
badgeFg: Color(0xFF2D7D46),
),
];
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'本月精选',
style: theme.textTheme.headlineSmall?.copyWith(
fontFamily: AppTypography.displayFont,
fontWeight: FontWeight.w700,
),
),
const SizedBox(height: 16),
...highlights.map((item) {
return _HighlightCard(
emoji: item.emoji,
emojiBg: item.emojiBg,
date: item.date,
title: item.title,
badge: item.badge,
badgeBg: item.badgeBg,
badgeFg: item.badgeFg,
);
}),
],
);
}
}
/// 单张精选日记卡片
class _HighlightCard extends StatelessWidget {
const _HighlightCard({
required this.emoji,
required this.emojiBg,
required this.date,
required this.title,
required this.badge,
required this.badgeBg,
required this.badgeFg,
});
final String emoji;
final Color emojiBg;
final String date;
final String title;
final String badge;
final Color badgeBg;
final Color badgeFg;
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final colorScheme = theme.colorScheme;
return Container(
margin: const EdgeInsets.only(bottom: 12),
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: colorScheme.surface,
borderRadius: AppRadius.mdBorder,
boxShadow: AppShadows.soft(context),
border: Border.all(color: colorScheme.outlineVariant),
),
child: Row(
children: [
// 48x48 emoji 圆圈
Container(
width: 48,
height: 48,
decoration: BoxDecoration(
color: emojiBg,
shape: BoxShape.circle,
),
alignment: Alignment.center,
child: Text(emoji, style: const TextStyle(fontSize: 24)),
),
const SizedBox(width: 12),
// 标题 + 日期
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
date,
style: theme.textTheme.labelSmall?.copyWith(
color: colorScheme.onSurfaceVariant,
),
),
const SizedBox(height: 2),
Text(
title,
style: theme.textTheme.titleMedium?.copyWith(
fontFamily: AppTypography.displayFont,
fontWeight: FontWeight.w600,
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
],
),
),
// badge pill
Container(
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 4),
decoration: BoxDecoration(
color: badgeBg,
borderRadius: AppRadius.pillBorder,
),
child: Text(
badge,
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w600,
color: badgeFg,
),
),
),
],
),
);
}
}

View File

@@ -0,0 +1,573 @@
// 周概览页面 — 7天条目 + 统计卡片 + 每日日记卡片
// 对齐 Open Design 原型稿 screens/weekly.html
import 'package:flutter/material.dart';
import 'package:nuanji_app/core/theme/app_colors.dart';
import 'package:nuanji_app/core/theme/app_radius.dart';
import 'package:nuanji_app/core/theme/app_shadows.dart';
import 'package:nuanji_app/core/theme/app_typography.dart';
/// 周概览页面
class WeeklyPage extends StatefulWidget {
const WeeklyPage({super.key});
@override
State<WeeklyPage> createState() => _WeeklyPageState();
}
class _WeeklyPageState extends State<WeeklyPage> {
late DateTime _focusedWeekStart;
@override
void initState() {
super.initState();
final now = DateTime.now();
_focusedWeekStart = now.subtract(Duration(days: now.weekday - 1));
}
void _goToPreviousWeek() {
setState(() {
_focusedWeekStart = _focusedWeekStart.subtract(const Duration(days: 7));
});
}
void _goToNextWeek() {
setState(() {
_focusedWeekStart = _focusedWeekStart.add(const Duration(days: 7));
});
}
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final colorScheme = theme.colorScheme;
return Scaffold(
body: SafeArea(
child: Column(
children: [
// 周头部导航
_WeekHeader(
weekStart: _focusedWeekStart,
onPrevious: _goToPreviousWeek,
onNext: _goToNextWeek,
),
// 可滚动内容区
Expanded(
child: ListView(
padding: const EdgeInsets.symmetric(horizontal: 20),
children: [
const SizedBox(height: 16),
// 7天条目
_WeekStrip(weekStart: _focusedWeekStart),
const SizedBox(height: 20),
// 本周总结
const _WeekSummary(),
const SizedBox(height: 20),
// 每日日记卡片
..._buildDayCards(theme, colorScheme),
const SizedBox(height: 32),
],
),
),
],
),
),
);
}
List<Widget> _buildDayCards(ThemeData theme, ColorScheme colorScheme) {
// 模拟数据: 3 张日记卡片
return [
_DayCard(
weekday: '周日',
date: '5月31日',
moodEmoji: '😊',
weatherEmoji: '☀️',
body:
'今天下午去图书馆自习,阳光从窗外洒进来,暖暖的。喝了抹茶拿铁,虽然期末压力大但看到窗外的樱花还在开,觉得一切都会好的。',
tags: const [
('学习', AppColors.secondarySoftLight, Color(0xFF2D7D46)),
('美食', AppColors.tertiarySoftLight, Color(0xFFB8860B)),
],
photoEmoji: '📚',
),
_DayCard(
weekday: '周六',
date: '5月30日',
moodEmoji: '😊',
weatherEmoji: '🌤',
body:
'今天在图书馆自习,窗外的阳光洒进来,暖暖的。复习了高数第三章,做了两套模拟题感觉还不错。',
tags: const [
('学习', AppColors.secondarySoftLight, Color(0xFF2D7D46)),
],
photoEmoji: null,
),
_DayCard(
weekday: '周五',
date: '5月29日',
moodEmoji: '😊',
weatherEmoji: '☀️',
body:
'考完试和舍友们去吃了火锅庆祝,大家都好开心,聊了很多有趣的事。这学期终于结束了!',
tags: const [
('朋友', AppColors.roseSoftLight, Color(0xFF9B4D4D)),
('美食', AppColors.tertiarySoftLight, Color(0xFFB8860B)),
],
photoEmoji: '🍲',
),
];
}
}
// ===== 周头部导航 =====
class _WeekHeader extends StatelessWidget {
const _WeekHeader({
required this.weekStart,
required this.onPrevious,
required this.onNext,
});
final DateTime weekStart;
final VoidCallback onPrevious;
final VoidCallback onNext;
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final colorScheme = theme.colorScheme;
// 格式化: "2026年6月 第1周"
final monthNames = [
'', '1月', '2月', '3月', '4月', '5月', '6月',
'7月', '8月', '9月', '10月', '11月', '12月',
];
final title =
'${weekStart.year}${monthNames[weekStart.month]}${_weekOfMonth(weekStart)}';
return Padding(
padding: const EdgeInsets.fromLTRB(20, 8, 12, 0),
child: Row(
children: [
Expanded(
child: Text(
title,
style: theme.textTheme.headlineSmall?.copyWith(
fontFamily: AppTypography.displayFont,
fontWeight: FontWeight.w700,
),
),
),
// 左右箭头导航按钮
_NavButton(
icon: Icons.chevron_left_rounded,
onTap: onPrevious,
borderColor: colorScheme.outline,
foregroundColor: colorScheme.onSurface,
),
const SizedBox(width: 8),
_NavButton(
icon: Icons.chevron_right_rounded,
onTap: onNext,
borderColor: colorScheme.outline,
foregroundColor: colorScheme.onSurface,
),
],
),
);
}
/// 计算是当月第几周
int _weekOfMonth(DateTime date) {
final firstDay = DateTime(date.year, date.month, 1);
final offset = firstDay.weekday - 1;
return ((date.day + offset) / 7).ceil();
}
}
/// 圆形导航按钮 (44px 触摸目标)
class _NavButton extends StatelessWidget {
const _NavButton({
required this.icon,
required this.onTap,
required this.borderColor,
required this.foregroundColor,
});
final IconData icon;
final VoidCallback onTap;
final Color borderColor;
final Color foregroundColor;
@override
Widget build(BuildContext context) {
return SizedBox(
width: 44,
height: 44,
child: OutlinedButton(
onPressed: onTap,
style: OutlinedButton.styleFrom(
padding: EdgeInsets.zero,
shape: const CircleBorder(),
side: BorderSide(color: borderColor, width: 1.5),
foregroundColor: foregroundColor,
backgroundColor: Theme.of(context).colorScheme.surface,
),
child: Icon(icon, size: 18),
),
);
}
}
// ===== 7天条目 =====
class _WeekStrip extends StatelessWidget {
const _WeekStrip({required this.weekStart});
final DateTime weekStart;
// 模拟数据: 每天的心情 emoji
static const _mockMoods = ['😊', '😐', '😊', '😊', '😊', '😊', '😊'];
static const _weekNames = ['', '', '', '', '', '', ''];
static const _hasEntry = [true, true, true, true, true, true, true];
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final colorScheme = theme.colorScheme;
final now = DateTime.now();
return Row(
children: List.generate(7, (i) {
final day = weekStart.add(Duration(days: i));
final isToday = day.year == now.year &&
day.month == now.month &&
day.day == now.day;
final hasEntry = _hasEntry[i];
final moodEmoji = _mockMoods[i];
return Expanded(
child: GestureDetector(
onTap: () {
// TODO: 选择某天后刷新下方日记卡片
},
child: Container(
padding: const EdgeInsets.symmetric(vertical: 12),
decoration: BoxDecoration(
color: isToday ? AppColors.accent : null,
borderRadius: AppRadius.mdBorder,
),
child: Column(
children: [
// 周名
Text(
_weekNames[i],
style: TextStyle(
fontSize: 11,
color: isToday
? const Color(0xFFFFF8F0).withValues(alpha: 0.85)
: colorScheme.onSurfaceVariant,
),
),
const SizedBox(height: 4),
// 日期数字
Text(
'${day.day}',
style: TextStyle(
fontFamily: AppTypography.displayFont,
fontSize: 20,
fontWeight: FontWeight.w700,
color: isToday
? const Color(0xFFFFF8F0) // accent-on
: colorScheme.onSurface.withValues(alpha: 0.7),
),
),
const SizedBox(height: 4),
// 心情 emoji
Text(moodEmoji, style: const TextStyle(fontSize: 16)),
// 有日记: 日期下方4px小圆点
if (hasEntry && !isToday)
Container(
width: 4,
height: 4,
margin: const EdgeInsets.only(top: 4),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: AppColors.accent,
),
),
if (hasEntry && isToday)
Container(
width: 4,
height: 4,
margin: const EdgeInsets.only(top: 4),
decoration: const BoxDecoration(
shape: BoxShape.circle,
color: Color(0xFFFFF8F0),
),
),
],
),
),
),
);
}),
);
}
}
// ===== 本周总结卡片 =====
class _WeekSummary extends StatelessWidget {
const _WeekSummary();
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final colorScheme = theme.colorScheme;
return Container(
padding: const EdgeInsets.all(20),
decoration: BoxDecoration(
color: colorScheme.surface,
borderRadius: AppRadius.mdBorder,
boxShadow: AppShadows.soft(context),
border: Border.all(color: colorScheme.outlineVariant),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'本周总结',
style: theme.textTheme.titleMedium?.copyWith(
fontFamily: AppTypography.displayFont,
fontWeight: FontWeight.w600,
),
),
const SizedBox(height: 16),
// 3个统计数字
Row(
children: [
_SummaryItem(
value: '6',
label: '记录天数',
valueColor: AppColors.accent,
),
_SummaryItem(
value: '7',
label: '日记篇数',
valueColor: AppColors.secondary,
),
_SummaryItem(
value: '12',
label: '使用贴纸',
valueColor: AppColors.tertiary,
),
],
),
const SizedBox(height: 16),
// 心情分布条
Row(
children: [
Expanded(
flex: 3,
child: Container(
height: 8,
decoration: BoxDecoration(
color: AppColors.secondary,
borderRadius: BorderRadius.circular(4),
),
),
),
const SizedBox(width: 8),
Expanded(
flex: 2,
child: Container(
height: 8,
decoration: BoxDecoration(
color: AppColors.tertiary,
borderRadius: BorderRadius.circular(4),
),
),
),
const SizedBox(width: 8),
Expanded(
flex: 1,
child: Container(
height: 8,
decoration: BoxDecoration(
color: const Color(0xFF5B7DB1),
borderRadius: BorderRadius.circular(4),
),
),
),
],
),
],
),
);
}
}
/// 单个统计项
class _SummaryItem extends StatelessWidget {
const _SummaryItem({
required this.value,
required this.label,
required this.valueColor,
});
final String value;
final String label;
final Color valueColor;
@override
Widget build(BuildContext context) {
return Expanded(
child: Column(
children: [
Text(
value,
style: TextStyle(
fontFamily: AppTypography.displayFont,
fontSize: 24,
fontWeight: FontWeight.w700,
color: valueColor,
),
),
const SizedBox(height: 2),
Text(
label,
style: Theme.of(context).textTheme.labelSmall?.copyWith(
color: Theme.of(context).colorScheme.onSurfaceVariant,
),
),
],
),
);
}
}
// ===== 每日日记卡片 =====
class _DayCard extends StatelessWidget {
const _DayCard({
required this.weekday,
required this.date,
required this.moodEmoji,
required this.weatherEmoji,
required this.body,
required this.tags,
this.photoEmoji,
});
final String weekday;
final String date;
final String moodEmoji;
final String weatherEmoji;
final String body;
final List<(String, Color, Color)> tags; // (label, bg, fg)
final String? photoEmoji;
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final colorScheme = theme.colorScheme;
return Container(
margin: const EdgeInsets.only(bottom: 12),
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: colorScheme.surface,
borderRadius: AppRadius.mdBorder,
boxShadow: AppShadows.soft(context),
border: Border.all(color: colorScheme.outlineVariant),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// 头部: 日期 + 心情/weather emoji
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'$weekday · $date',
style: theme.textTheme.titleSmall?.copyWith(
fontWeight: FontWeight.w600,
color: colorScheme.onSurface.withValues(alpha: 0.7),
),
),
Text(
'$moodEmoji $weatherEmoji',
style: const TextStyle(fontSize: 13),
),
],
),
const SizedBox(height: 12),
// 正文预览 (3行截断)
Text(
body,
style: theme.textTheme.bodySmall?.copyWith(
color: colorScheme.onSurfaceVariant,
height: 1.6,
),
maxLines: 3,
overflow: TextOverflow.ellipsis,
),
// 标签 pills
if (tags.isNotEmpty) ...[
const SizedBox(height: 12),
Wrap(
spacing: 8,
runSpacing: 4,
children: tags.map((tag) {
return Container(
padding: const EdgeInsets.symmetric(
horizontal: 10,
vertical: 3,
),
decoration: BoxDecoration(
color: tag.$2,
borderRadius: AppRadius.pillBorder,
),
child: Text(
tag.$1,
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w500,
color: tag.$3,
),
),
);
}).toList(),
),
],
// 照片占位
if (photoEmoji != null) ...[
const SizedBox(height: 12),
Container(
width: double.infinity,
height: 80,
decoration: BoxDecoration(
borderRadius: AppRadius.smBorder,
gradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
colorScheme.surfaceContainerHighest
.withValues(alpha: 0.6),
colorScheme.outlineVariant.withValues(alpha: 0.3),
],
),
),
alignment: Alignment.center,
child: Text(photoEmoji!, style: const TextStyle(fontSize: 24)),
),
],
],
),
);
}
}

View File

@@ -4,6 +4,8 @@ import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:go_router/go_router.dart';
import 'package:nuanji_app/core/theme/app_colors.dart';
import 'package:nuanji_app/core/theme/app_radius.dart';
import 'package:nuanji_app/core/theme/app_typography.dart';
import 'package:nuanji_app/data/models/journal_entry.dart';
import 'package:nuanji_app/data/repositories/journal_repository.dart';
import '../bloc/home_bloc.dart';
@@ -38,11 +40,17 @@ class _HomeView extends StatelessWidget {
title: Text(
'暖记',
style: theme.textTheme.headlineSmall?.copyWith(
fontFamily: 'Caveat',
fontFamily: AppTypography.handwrittenFont,
color: colorScheme.primary,
),
),
actions: [
// 搜索按钮(设计稿要求右上角圆形搜索按钮)
IconButton(
onPressed: () => context.push('/discover'),
icon: const Icon(Icons.search_rounded),
tooltip: '搜索',
),
IconButton(
onPressed: () => context.go('/stickers'),
icon: const Icon(Icons.emoji_emotions_outlined),
@@ -136,7 +144,7 @@ class _QuickMoodCard extends StatelessWidget {
return Card(
elevation: 0,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(22)),
shape: RoundedRectangleBorder(borderRadius: AppRadius.lgBorder),
color: colorScheme.primaryContainer.withValues(alpha: 0.3),
child: Padding(
padding: const EdgeInsets.all(20),
@@ -152,7 +160,7 @@ class _QuickMoodCard extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 2),
decoration: BoxDecoration(
color: AppColors.tertiary.withValues(alpha: 0.2),
borderRadius: BorderRadius.circular(8),
borderRadius: AppRadius.xsBorder,
),
child: Text('🔥 连续 $streakDays', style: theme.textTheme.labelSmall),
),
@@ -161,7 +169,7 @@ class _QuickMoodCard extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 2),
decoration: BoxDecoration(
color: AppColors.secondary.withValues(alpha: 0.2),
borderRadius: BorderRadius.circular(8),
borderRadius: AppRadius.xsBorder,
),
child: Text('✅ 今日已写', style: theme.textTheme.labelSmall),
),
@@ -221,12 +229,12 @@ class _JournalList extends StatelessWidget {
margin: const EdgeInsets.only(bottom: 12),
elevation: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16),
borderRadius: AppRadius.mdBorder,
side: BorderSide(color: colorScheme.outlineVariant),
),
child: InkWell(
onTap: () => context.push('/editor?id=${journal.id}'),
borderRadius: BorderRadius.circular(16),
borderRadius: AppRadius.mdBorder,
child: Padding(
padding: const EdgeInsets.all(16),
child: Row(

View File

@@ -4,6 +4,7 @@ import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:nuanji_app/core/theme/app_colors.dart';
import 'package:nuanji_app/core/theme/app_radius.dart';
import 'package:nuanji_app/data/models/journal_entry.dart';
import 'package:nuanji_app/data/remote/api_client.dart';
import '../bloc/mood_bloc.dart';
@@ -129,7 +130,7 @@ class _StatsOverviewCard extends StatelessWidget {
return Card(
elevation: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(22),
borderRadius: AppRadius.lgBorder,
),
color: colorScheme.primaryContainer,
child: Padding(
@@ -218,7 +219,7 @@ class _MoodDistributionChart extends StatelessWidget {
return Card(
elevation: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(22),
borderRadius: AppRadius.lgBorder,
side: BorderSide(color: colorScheme.outlineVariant),
),
child: Padding(
@@ -322,7 +323,7 @@ class _StreakCard extends StatelessWidget {
return Card(
elevation: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(22),
borderRadius: AppRadius.lgBorder,
),
color: AppColors.tertiary.withValues(alpha: 0.15),
child: Padding(

View File

@@ -0,0 +1,495 @@
// 引导页 — 3 页水平滑动引导 + 完成标记
// 对齐 Open Design 原型稿 screens/onboarding.html
//
// 流程:
// Step 1: "用手账的方式记录每一天" — 笔记本+笔+贴纸 插图
// Step 2: "海量贴纸与模板随心装饰" — 贴纸面板 插图
// Step 3: "回顾成长轨迹看见自己的变化" — 心情日历 插图
//
// 完成后: SharedPreferences 记录 onboarding_complete=true → 跳转 /login
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:shared_preferences/shared_preferences.dart';
import '../../../core/constants/design_tokens.dart';
import '../../../core/theme/app_colors.dart';
import '../../../core/theme/app_radius.dart';
import '../../../core/theme/app_typography.dart';
/// 引导页 — 首次使用时展示功能介绍
class OnboardingPage extends StatefulWidget {
const OnboardingPage({super.key});
@override
State<OnboardingPage> createState() => _OnboardingPageState();
}
class _OnboardingPageState extends State<OnboardingPage> {
final PageController _pageController = PageController();
int _currentPage = 0;
static const int _totalPages = 3;
static const String _kOnboardingComplete = 'onboarding_complete';
static const _OnboardingStep _step1 = _OnboardingStep(
pageNumber: '01',
emoji: '📝',
titleLine1: '用手账的方式',
titleLine2: '记录每一天',
description: '文字、贴纸、涂鸦、照片 — 选择你喜欢的方式,把日常变成一本温暖的手账',
illustrationType: _IllustrationType.notebook,
);
static const _OnboardingStep _step2 = _OnboardingStep(
pageNumber: '02',
emoji: '🎨',
titleLine1: '海量贴纸与模板',
titleLine2: '随心装饰',
description: '数百款手绘贴纸、精美模板和装饰素材,让你的日记独一无二',
illustrationType: _IllustrationType.stickers,
);
static const _OnboardingStep _step3 = _OnboardingStep(
pageNumber: '03',
emoji: '🌱',
titleLine1: '回顾成长轨迹',
titleLine2: '看见自己的变化',
description: '心情追踪、日历回顾、统计洞察 — 不仅仅是记录,更是了解自己的旅程',
illustrationType: _IllustrationType.growth,
);
@override
void dispose() {
_pageController.dispose();
super.dispose();
}
Future<void> _completeOnboarding() async {
final prefs = await SharedPreferences.getInstance();
await prefs.setBool(_kOnboardingComplete, true);
if (mounted) {
context.go('/login');
}
}
void _goToPage(int index) {
_pageController.animateToPage(
index,
duration: DesignTokens.animSlow,
curve: DesignTokens.warmCurve,
);
}
void _nextSlide() {
if (_currentPage < _totalPages - 1) {
_goToPage(_currentPage + 1);
} else {
_completeOnboarding();
}
}
@override
Widget build(BuildContext context) {
final isDark = Theme.of(context).brightness == Brightness.dark;
final bottomPadding = MediaQuery.of(context).padding.bottom;
return Scaffold(
body: Stack(
children: [
// 页面内容
PageView(
controller: _pageController,
onPageChanged: (index) {
setState(() => _currentPage = index);
},
children: [
_buildSlidePage(context, _step1, isDark),
_buildSlidePage(context, _step2, isDark),
_buildSlidePage(context, _step3, isDark),
],
),
// 跳过按钮 — 右上角
Positioned(
top: MediaQuery.of(context).padding.top + 8,
right: 20,
child: Semantics(
button: true,
label: '跳过引导',
child: GestureDetector(
onTap: _completeOnboarding,
behavior: HitTestBehavior.opaque,
child: Container(
padding:
const EdgeInsets.symmetric(horizontal: 8, vertical: 8),
constraints:
const BoxConstraints(minWidth: 44, minHeight: 44),
alignment: Alignment.center,
child: Text(
'跳过',
style: TextStyle(
fontFamily: AppTypography.bodyFont,
fontSize: 15,
fontWeight: FontWeight.w500,
color:
isDark ? AppColors.mutedDark : AppColors.mutedLight,
),
),
),
),
),
),
// 底部控制区
Positioned(
left: 0,
right: 0,
bottom: bottomPadding + 24,
child: _buildBottomControls(isDark),
),
],
),
);
}
/// 单页引导内容
Widget _buildSlidePage(
BuildContext context,
_OnboardingStep step,
bool isDark,
) {
final topPadding = MediaQuery.of(context).padding.top;
return Padding(
padding: EdgeInsets.only(
top: topPadding + 48,
left: 32,
right: 32,
bottom: MediaQuery.of(context).padding.bottom + 120,
),
child: Column(
children: [
// 页码水印
Align(
alignment: Alignment.centerLeft,
child: Padding(
padding: const EdgeInsets.only(left: 20),
child: Text(
step.pageNumber,
style: TextStyle(
fontFamily: AppTypography.displayFont,
fontSize: 120,
fontWeight: FontWeight.w800,
color: (isDark ? AppColors.fgDark : AppColors.fgLight)
.withValues(alpha: 0.04),
height: 1,
),
),
),
),
const Spacer(flex: 1),
// 插图
_buildIllustration(step, isDark),
const SizedBox(height: 40),
// 标题(两行)
Text(
'${step.titleLine1}\n${step.titleLine2}',
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: AppTypography.displayFont,
fontSize: 24,
fontWeight: FontWeight.w700,
color: isDark ? AppColors.fgDark : AppColors.fgLight,
height: 1.3,
),
),
const SizedBox(height: 12),
// 描述
SizedBox(
width: 280,
child: Text(
step.description,
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: AppTypography.bodyFont,
fontSize: 15,
fontWeight: FontWeight.w400,
color:
isDark ? AppColors.mutedDark : AppColors.mutedLight,
height: 1.6,
),
),
),
const Spacer(flex: 2),
],
),
);
}
/// 插图圆形区域
Widget _buildIllustration(_OnboardingStep step, bool isDark) {
// 每个步骤不同的渐变背景
final gradientColors = _getIllustrationGradient(step.illustrationType, isDark);
return SizedBox(
width: 260,
height: 260,
child: Stack(
alignment: Alignment.center,
children: [
// 外围虚线旋转圆
_DashedCircleBorder(
size: 286,
color: isDark
? AppColors.borderDark
: AppColors.borderLight,
),
// 渐变圆形背景
Container(
width: 260,
height: 260,
decoration: BoxDecoration(
shape: BoxShape.circle,
gradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: gradientColors,
),
),
alignment: Alignment.center,
child: _buildIllustrationContent(step, isDark),
),
],
),
);
}
List<Color> _getIllustrationGradient(
_IllustrationType type,
bool isDark,
) {
switch (type) {
case _IllustrationType.notebook:
return [
isDark ? AppColors.surfaceWarmDark : AppColors.surfaceWarmLight,
(isDark ? AppColors.accentDark : AppColors.accent)
.withValues(alpha: 0.3),
];
case _IllustrationType.stickers:
return [
isDark ? AppColors.secondarySoftDark : AppColors.secondarySoftLight,
(isDark ? AppColors.secondaryDark : AppColors.secondary)
.withValues(alpha: 0.15),
];
case _IllustrationType.growth:
return [
isDark ? AppColors.tertiarySoftDark : AppColors.tertiarySoftLight,
(isDark ? AppColors.tertiaryDark : AppColors.tertiary)
.withValues(alpha: 0.2),
];
}
}
/// 插图内容 — emoji 大图标
Widget _buildIllustrationContent(_OnboardingStep step, bool isDark) {
return Text(
step.emoji,
style: const TextStyle(fontSize: 80),
);
}
/// 底部控制区 — 指示点 + 按钮
Widget _buildBottomControls(bool isDark) {
final isLastPage = _currentPage == _totalPages - 1;
final accentColor = isDark ? AppColors.accentDark : AppColors.accent;
final accentOnColor =
isDark ? const Color(0xFF1A1614) : const Color(0xFFFFF8F0);
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 32),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
// 指示点
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: List.generate(_totalPages, (index) {
final isActive = index == _currentPage;
return AnimatedContainer(
duration: DesignTokens.animNormal,
curve: DesignTokens.warmCurve,
margin: const EdgeInsets.symmetric(horizontal: 4),
width: isActive ? 28 : 8,
height: 8,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4),
color: isActive
? accentColor
: (isDark
? AppColors.borderDark
: AppColors.borderLight),
),
);
}),
),
const SizedBox(height: 24),
// 下一步 / 开始使用 按钮
GestureDetector(
onTap: _nextSlide,
child: Container(
width: double.infinity,
padding: const EdgeInsets.symmetric(vertical: 16),
decoration: BoxDecoration(
color: accentColor,
borderRadius: AppRadius.pillBorder,
boxShadow: [
BoxShadow(
color: accentColor.withValues(alpha: 0.3),
offset: const Offset(0, 4),
blurRadius: 20,
),
],
),
alignment: Alignment.center,
child: Text(
isLastPage ? '开始使用' : '下一步',
style: TextStyle(
fontFamily: AppTypography.displayFont,
fontSize: 20,
fontWeight: FontWeight.w600,
color: accentOnColor,
),
),
),
),
],
),
);
}
}
// ===== 数据模型 =====
/// 引导步骤数据
class _OnboardingStep {
final String pageNumber;
final String emoji;
final String titleLine1;
final String titleLine2;
final String description;
final _IllustrationType illustrationType;
const _OnboardingStep({
required this.pageNumber,
required this.emoji,
required this.titleLine1,
required this.titleLine2,
required this.description,
required this.illustrationType,
});
}
/// 插图类型
enum _IllustrationType {
notebook,
stickers,
growth,
}
// ===== 虚线圆圈装饰 =====
/// 外围虚线旋转圆(对齐 onboarding.html 的 dashed border
class _DashedCircleBorder extends StatefulWidget {
final double size;
final Color color;
const _DashedCircleBorder({
required this.size,
required this.color,
});
@override
State<_DashedCircleBorder> createState() => _DashedCircleBorderState();
}
class _DashedCircleBorderState extends State<_DashedCircleBorder>
with SingleTickerProviderStateMixin {
late final AnimationController _controller;
@override
void initState() {
super.initState();
_controller = AnimationController(
vsync: this,
duration: const Duration(seconds: 20),
)..repeat();
}
@override
void dispose() {
_controller.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return AnimatedBuilder(
animation: _controller,
builder: (context, child) {
return Transform.rotate(
angle: _controller.value * 6.2832, // 2 * PI
child: child,
);
},
child: CustomPaint(
size: Size(widget.size, widget.size),
painter: _DashedCirclePainter(color: widget.color),
),
);
}
}
/// 虚线圆绘制器
class _DashedCirclePainter extends CustomPainter {
final Color color;
_DashedCirclePainter({required this.color});
@override
void paint(Canvas canvas, Size size) {
final paint = Paint()
..color = color
..style = PaintingStyle.stroke
..strokeWidth = 2;
final cx = size.width / 2;
final cy = size.height / 2;
final radius = size.width / 2 - 1;
const dashCount = 36;
const dashAngle = 6.2832 / dashCount; // 2 * PI / dashCount
const dashLength = dashAngle * 0.6;
for (var i = 0; i < dashCount; i++) {
final startAngle = i * dashAngle;
canvas.drawArc(
Rect.fromCircle(center: Offset(cx, cy), radius: radius),
startAngle,
dashLength,
false,
paint,
);
}
}
@override
bool shouldRepaint(covariant _DashedCirclePainter oldDelegate) =>
color != oldDelegate.color;
}

View File

@@ -0,0 +1,694 @@
// 启动页 — 全屏渐变背景 + App Logo + 自动跳转
// 对齐 Open Design 原型稿 screens/splash.html
//
// 跳转逻辑:
// - 2 秒自动跳转或点击"开始记录"按钮
// - 已认证 → /home
// - 首次使用(未完成引导) → /onboarding
// - 其他 → /login
import 'dart:async';
import 'dart:math' show cos, sin;
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:go_router/go_router.dart';
import 'package:shared_preferences/shared_preferences.dart';
import '../../../core/constants/design_tokens.dart';
import '../../../core/theme/app_colors.dart';
import '../../../core/theme/app_radius.dart';
import '../../../core/theme/app_typography.dart';
import '../../auth/bloc/auth_bloc.dart';
/// 启动页 — App 打开后第一个画面
class SplashPage extends StatefulWidget {
const SplashPage({super.key});
@override
State<SplashPage> createState() => _SplashPageState();
}
class _SplashPageState extends State<SplashPage>
with TickerProviderStateMixin {
late final AnimationController _scaleController;
late final Animation<double> _scaleAnimation;
late final AnimationController _fadeController;
late final Animation<double> _fadeAnimation;
Timer? _autoNavigateTimer;
bool _hasNavigated = false;
static const String _kOnboardingComplete = 'onboarding_complete';
@override
void initState() {
super.initState();
// 中心内容弹性缩放入场
_scaleController = AnimationController(
vsync: this,
duration: const Duration(milliseconds: 800),
);
_scaleAnimation = CurvedAnimation(
parent: _scaleController,
curve: DesignTokens.warmCurve,
);
// 底部区域淡入(延迟 500ms
_fadeController = AnimationController(
vsync: this,
duration: const Duration(milliseconds: 1000),
);
_fadeAnimation = CurvedAnimation(
parent: _fadeController,
curve: Curves.easeOut,
);
_scaleController.forward();
Future.delayed(const Duration(milliseconds: 500), () {
if (mounted) _fadeController.forward();
});
// 2 秒后自动跳转
_autoNavigateTimer = Timer(const Duration(seconds: 2), _navigate);
}
@override
void dispose() {
_autoNavigateTimer?.cancel();
_scaleController.dispose();
_fadeController.dispose();
super.dispose();
}
Future<void> _navigate() async {
if (_hasNavigated || !mounted) return;
_hasNavigated = true;
final authState = context.read<AuthBloc>().state;
// 已认证 → 直接进入首页
if (authState is Authenticated) {
if (authState.needsRoleSelection) {
context.go('/role-selection');
} else if (authState.needsClassCode) {
context.go('/class-code');
} else {
context.go('/home');
}
return;
}
// 检查是否已完成引导
final prefs = await SharedPreferences.getInstance();
final onboardingComplete = prefs.getBool(_kOnboardingComplete) ?? false;
if (!mounted) return;
if (onboardingComplete) {
context.go('/login');
} else {
context.go('/onboarding');
}
}
@override
Widget build(BuildContext context) {
final isDark = Theme.of(context).brightness == Brightness.dark;
return Scaffold(
body: Container(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
stops: const [0.0, 0.4, 1.0],
colors: [
isDark ? AppColors.bgDark : AppColors.bgLight,
isDark ? AppColors.tertiarySoftDark : AppColors.tertiarySoftLight,
isDark
? AppColors.accentDark.withValues(alpha: 0.5)
: AppColors.accent.withValues(alpha: 0.5),
],
),
),
child: Stack(
children: [
// 浮动装饰元素
_buildDecorations(isDark),
// 中心内容
Center(
child: ScaleTransition(
scale: _scaleAnimation,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
_buildAppIcon(isDark),
const SizedBox(height: 28),
_buildAppName(isDark),
const SizedBox(height: 12),
_buildTagline(isDark),
],
),
),
),
// 底部区域
Positioned(
left: 0,
right: 0,
bottom: MediaQuery.of(context).padding.bottom + 40,
child: FadeTransition(
opacity: _fadeAnimation,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
_buildHandwrittenTagline(isDark),
const SizedBox(height: 20),
_buildEnterButton(isDark),
const SizedBox(height: 16),
_buildHint(isDark),
],
),
),
),
],
),
),
);
}
/// 浮动装饰星星和圆圈
Widget _buildDecorations(bool isDark) {
return Stack(
children: [
// 星星 — 左上
_FloatingStar(
top: 120,
left: 60,
size: 28,
color: isDark ? AppColors.accentDark : AppColors.accent,
animDelay: Duration.zero,
),
// 星星 — 右上
_FloatingStar(
top: 200,
right: 50,
size: 28,
color: isDark ? AppColors.secondaryDark : AppColors.secondary,
animDelay: const Duration(milliseconds: 1500),
),
// 圆圈 — 右侧
_FloatingCircle(
top: 160,
right: 80,
size: 80,
color: isDark ? AppColors.tertiaryDark : AppColors.tertiary,
animDelay: const Duration(milliseconds: 2000),
),
// 圆圈 — 左下
_FloatingCircle(
bottom: 300,
left: 40,
size: 50,
color: isDark ? AppColors.roseDark : AppColors.rose,
animDelay: const Duration(milliseconds: 3000),
),
// 星星 — 右下
_FloatingStar(
bottom: 350,
right: 70,
size: 28,
color: isDark ? AppColors.tertiaryDark : AppColors.tertiary,
animDelay: const Duration(milliseconds: 2500),
),
],
);
}
/// App 图标 — 120x120, 圆角 32px, accent→tertiary 渐变
Widget _buildAppIcon(bool isDark) {
return Container(
width: 120,
height: 120,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(32),
gradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
isDark ? AppColors.accentDark : AppColors.accent,
isDark ? AppColors.tertiaryDark : AppColors.tertiary,
],
),
boxShadow: [
BoxShadow(
color: (isDark ? AppColors.accentDark : AppColors.accent)
.withValues(alpha: 0.3),
offset: const Offset(0, 8),
blurRadius: 32,
),
],
),
child: Stack(
alignment: Alignment.center,
children: [
// 高光圆
Positioned(
top: -20,
right: -20,
child: Container(
width: 72,
height: 72,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.white.withValues(alpha: 0.2),
),
),
),
// 笔记本图标
CustomPaint(
size: const Size(56, 56),
painter: _NotebookIconPainter(
accentColor: isDark ? AppColors.accentDark : AppColors.accent,
tertiaryColor:
isDark ? AppColors.tertiaryDark : AppColors.tertiary,
),
),
],
),
);
}
/// App 名 — "暖记" 42px/700, letter-spacing 2px
Widget _buildAppName(bool isDark) {
return Text(
'暖记',
style: TextStyle(
fontFamily: AppTypography.displayFont,
fontSize: 42,
fontWeight: FontWeight.w700,
color: isDark ? AppColors.fgDark : AppColors.fgLight,
letterSpacing: 2,
),
);
}
/// Tagline — "用温暖的方式,记录每一天"
Widget _buildTagline(bool isDark) {
return Text(
'用温暖的方式,记录每一天',
style: TextStyle(
fontFamily: AppTypography.bodyFont,
fontSize: 17,
fontWeight: FontWeight.w400,
color: isDark ? AppColors.mutedDark : AppColors.mutedLight,
letterSpacing: 1,
),
);
}
/// 手写 tagline — "每一页,都是你的故事"
Widget _buildHandwrittenTagline(bool isDark) {
return Text(
'每一页,都是你的故事',
style: TextStyle(
fontFamily: AppTypography.handwrittenFont,
fontSize: 22,
color: isDark ? AppColors.accentDark : AppColors.accent,
letterSpacing: 1,
),
);
}
/// "开始记录" 按钮 — pill 形状, accent 背景色
Widget _buildEnterButton(bool isDark) {
final accentColor = isDark ? AppColors.accentDark : AppColors.accent;
final accentOnColor =
isDark ? const Color(0xFF1A1614) : const Color(0xFFFFF8F0);
return SizedBox(
width: double.infinity,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 48),
child: GestureDetector(
onTap: _navigate,
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 48, vertical: 16),
decoration: BoxDecoration(
color: accentColor,
borderRadius: AppRadius.pillBorder,
boxShadow: [
BoxShadow(
color: accentColor.withValues(alpha: 0.3),
offset: const Offset(0, 4),
blurRadius: 20,
),
],
),
child: Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'开始记录',
style: TextStyle(
fontFamily: AppTypography.displayFont,
fontSize: 20,
fontWeight: FontWeight.w600,
color: accentOnColor,
),
),
const SizedBox(width: 8),
Icon(
Icons.arrow_forward_rounded,
size: 20,
color: accentOnColor,
),
],
),
),
),
),
);
}
/// 底部提示
Widget _buildHint(bool isDark) {
return Text(
'每一天都值得被温柔记录',
style: TextStyle(
fontFamily: AppTypography.bodyFont,
fontSize: 13,
fontWeight: FontWeight.w400,
color: isDark ? AppColors.metaDark : AppColors.metaLight,
),
);
}
}
// ===== 浮动装饰组件 =====
/// 浮动星星装饰
class _FloatingStar extends StatefulWidget {
final double? top;
final double? bottom;
final double? left;
final double? right;
final double size;
final Color color;
final Duration animDelay;
const _FloatingStar({
this.top,
this.bottom,
this.left,
this.right,
required this.size,
required this.color,
required this.animDelay,
});
@override
State<_FloatingStar> createState() => _FloatingStarState();
}
class _FloatingStarState extends State<_FloatingStar>
with SingleTickerProviderStateMixin {
late final AnimationController _controller;
late final Animation<double> _animation;
@override
void initState() {
super.initState();
_controller = AnimationController(
vsync: this,
duration: const Duration(seconds: 4),
);
_animation = Tween(begin: 0.0, end: 1.0).animate(_controller);
Future.delayed(widget.animDelay, () {
if (mounted) _controller.repeat();
});
}
@override
void dispose() {
_controller.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Positioned(
top: widget.top,
bottom: widget.bottom,
left: widget.left,
right: widget.right,
child: AnimatedBuilder(
animation: _animation,
builder: (context, child) {
final offset =
_animation.value < 0.5 ? _animation.value * -10 : (_animation.value - 0.5) * -10 + 10;
final rotation = _animation.value * 0.14; // ~5deg
return Transform.translate(
offset: Offset(0, -offset + 5),
child: Transform.rotate(
angle: rotation,
child: child,
),
);
},
child: Opacity(
opacity: 0.25,
child: CustomPaint(
size: Size(widget.size, widget.size),
painter: _StarPainter(color: widget.color),
),
),
),
);
}
}
/// 浮动圆形装饰
class _FloatingCircle extends StatefulWidget {
final double? top;
final double? bottom;
final double? left;
final double? right;
final double size;
final Color color;
final Duration animDelay;
const _FloatingCircle({
this.top,
this.bottom,
this.left,
this.right,
required this.size,
required this.color,
required this.animDelay,
});
@override
State<_FloatingCircle> createState() => _FloatingCircleState();
}
class _FloatingCircleState extends State<_FloatingCircle>
with SingleTickerProviderStateMixin {
late final AnimationController _controller;
late final Animation<double> _animation;
@override
void initState() {
super.initState();
_controller = AnimationController(
vsync: this,
duration: const Duration(seconds: 5),
);
_animation = Tween(begin: 0.0, end: 1.0).animate(_controller);
Future.delayed(widget.animDelay, () {
if (mounted) _controller.repeat(reverse: true);
});
}
@override
void dispose() {
_controller.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Positioned(
top: widget.top,
bottom: widget.bottom,
left: widget.left,
right: widget.right,
child: AnimatedBuilder(
animation: _animation,
builder: (context, child) {
final offset = _animation.value * -10;
return Transform.translate(
offset: Offset(0, offset),
child: child,
);
},
child: Opacity(
opacity: 0.12,
child: Container(
width: widget.size,
height: widget.size,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: widget.color,
),
),
),
),
);
}
}
// ===== CustomPainter — 笔记本图标 =====
/// 笔记本图标绘制器(对齐 splash.html 中的 SVG
class _NotebookIconPainter extends CustomPainter {
final Color accentColor;
final Color tertiaryColor;
_NotebookIconPainter({
required this.accentColor,
required this.tertiaryColor,
});
@override
void paint(Canvas canvas, Size size) {
final s = size.width / 56; // 基准 56px 缩放
// 白色笔记本主体
final bodyPaint = Paint()
..color = Colors.white.withValues(alpha: 0.9)
..style = PaintingStyle.fill;
final bodyRect = RRect.fromRectAndRadius(
Rect.fromLTWH(10 * s, 6 * s, 36 * s, 44 * s),
Radius.circular(4 * s),
);
canvas.drawRRect(bodyRect, bodyPaint);
// 脊部装饰线
final spinePaint = Paint()
..color = Colors.white.withValues(alpha: 0.3)
..style = PaintingStyle.fill;
canvas.drawRect(
Rect.fromLTWH(14 * s, 6 * s, 4 * s, 44 * s),
spinePaint,
);
// 文字横线
final linePaint = Paint()
..color = accentColor
..style = PaintingStyle.stroke
..strokeWidth = 2 * s
..strokeCap = StrokeCap.round;
canvas.drawLine(
Offset(20 * s, 18 * s),
Offset(38 * s, 18 * s),
linePaint,
);
canvas.drawLine(
Offset(20 * s, 24 * s),
Offset(34 * s, 24 * s),
linePaint,
);
canvas.drawLine(
Offset(20 * s, 30 * s),
Offset(38 * s, 30 * s),
linePaint,
);
canvas.drawLine(
Offset(20 * s, 36 * s),
Offset(30 * s, 36 * s),
linePaint,
);
// 右上角勾选标记圆形
final checkCirclePaint = Paint()
..color = tertiaryColor.withValues(alpha: 0.6)
..style = PaintingStyle.fill;
canvas.drawCircle(
Offset(42 * s, 14 * s),
8 * s,
checkCirclePaint,
);
// 勾选符号
final checkPaint = Paint()
..color = accentColor
..style = PaintingStyle.stroke
..strokeWidth = 1.5 * s
..strokeCap = StrokeCap.round
..strokeJoin = StrokeJoin.round;
final checkPath = Path()
..moveTo(39 * s, 14 * s)
..lineTo(41 * s, 16 * s)
..lineTo(45 * s, 12 * s);
canvas.drawPath(checkPath, checkPaint);
}
@override
bool shouldRepaint(covariant _NotebookIconPainter oldDelegate) =>
accentColor != oldDelegate.accentColor ||
tertiaryColor != oldDelegate.tertiaryColor;
}
// ===== CustomPainter — 五角星 =====
/// 五角星绘制器(装饰元素)
class _StarPainter extends CustomPainter {
final Color color;
_StarPainter({required this.color});
@override
void paint(Canvas canvas, Size size) {
final paint = Paint()
..color = color
..style = PaintingStyle.fill;
final path = Path();
final cx = size.width / 2;
final cy = size.height / 2;
final outerRadius = size.width / 2;
final innerRadius = outerRadius * 0.4;
for (var i = 0; i < 5; i++) {
final outerAngle = (i * 72 - 90) * 3.14159 / 180;
final innerAngle = ((i * 72) + 36 - 90) * 3.14159 / 180;
final ox = cx + outerRadius * cos(outerAngle);
final oy = cy + outerRadius * sin(outerAngle);
final ix = cx + innerRadius * cos(innerAngle);
final iy = cy + innerRadius * sin(innerAngle);
if (i == 0) {
path.moveTo(ox, oy);
} else {
path.lineTo(ox, oy);
}
path.lineTo(ix, iy);
}
path.close();
canvas.drawPath(path, paint);
}
@override
bool shouldRepaint(covariant _StarPainter oldDelegate) =>
color != oldDelegate.color;
}

View File

@@ -4,7 +4,9 @@ import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:go_router/go_router.dart';
import 'package:nuanji_app/core/theme/app_colors.dart';
import 'package:nuanji_app/core/theme/app_radius.dart';
import 'package:nuanji_app/features/auth/bloc/auth_bloc.dart';
import 'package:nuanji_app/data/models/user.dart';
/// 个人中心页面
class ProfilePage extends StatelessWidget {
@@ -25,7 +27,7 @@ class ProfilePage extends StatelessWidget {
// 用户头像卡片
Card(
elevation: 0,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(22)),
shape: RoundedRectangleBorder(borderRadius: AppRadius.lgBorder),
color: colorScheme.primaryContainer,
child: Padding(
padding: const EdgeInsets.all(24),
@@ -132,9 +134,9 @@ class ProfilePage extends StatelessWidget {
);
}
String _roleLabel(dynamic role) {
String _roleLabel(UserRoleType? role) {
if (role == null) return '未选择角色';
return switch (role.name) {
return switch (role.code) {
'teacher' => '老师',
'student' => '学生',
'parent' => '家长',

View File

@@ -3,6 +3,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:nuanji_app/core/theme/app_colors.dart';
import 'package:nuanji_app/core/theme/app_radius.dart';
import 'package:nuanji_app/features/profile/bloc/settings_bloc.dart';
/// 设置页面
@@ -92,7 +93,7 @@ class _ThemeSelectorCard extends StatelessWidget {
return Card(
elevation: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(22),
borderRadius: AppRadius.lgBorder,
side: BorderSide(color: colorScheme.outlineVariant),
),
child: Padding(
@@ -165,7 +166,7 @@ class _AboutCard extends StatelessWidget {
return Card(
elevation: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(22),
borderRadius: AppRadius.lgBorder,
side: BorderSide(color: colorScheme.outlineVariant),
),
child: Column(
@@ -180,7 +181,7 @@ class _AboutCard extends StatelessWidget {
height: 56,
decoration: BoxDecoration(
color: AppColors.accent.withValues(alpha: 0.15),
borderRadius: BorderRadius.circular(16),
borderRadius: AppRadius.mdBorder,
),
alignment: Alignment.center,
child: const Text('📝', style: TextStyle(fontSize: 28)),
@@ -294,7 +295,7 @@ class _LegalCard extends StatelessWidget {
return Card(
elevation: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(22),
borderRadius: AppRadius.lgBorder,
side: BorderSide(color: colorScheme.outlineVariant),
),
child: Column(

View File

@@ -3,6 +3,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:nuanji_app/core/theme/app_colors.dart';
import 'package:nuanji_app/core/theme/app_radius.dart';
import 'package:nuanji_app/data/remote/api_client.dart';
import '../bloc/sticker_bloc.dart';
@@ -135,7 +136,7 @@ class _StickerPackCard extends StatelessWidget {
return Card(
elevation: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16),
borderRadius: AppRadius.mdBorder,
side: BorderSide(color: colorScheme.outlineVariant),
),
child: InkWell(
@@ -144,7 +145,7 @@ class _StickerPackCard extends StatelessWidget {
SnackBar(content: Text('打开贴纸包: ${pack.name}')),
);
},
borderRadius: BorderRadius.circular(16),
borderRadius: AppRadius.mdBorder,
child: Padding(
padding: const EdgeInsets.all(16),
child: Column(
@@ -156,7 +157,7 @@ class _StickerPackCard extends StatelessWidget {
height: 64,
decoration: BoxDecoration(
color: colorScheme.primaryContainer.withValues(alpha: 0.3),
borderRadius: BorderRadius.circular(16),
borderRadius: AppRadius.mdBorder,
),
alignment: Alignment.center,
child: Text(

View File

@@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:go_router/go_router.dart';
import 'package:nuanji_app/core/theme/app_colors.dart';
import 'package:nuanji_app/core/theme/app_radius.dart';
import 'package:nuanji_app/data/repositories/class_repository.dart';
import 'package:nuanji_app/data/repositories/journal_repository.dart';
import '../../class_/bloc/class_bloc.dart';
@@ -241,12 +242,12 @@ class _ActionCard extends StatelessWidget {
return Card(
elevation: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16),
borderRadius: AppRadius.mdBorder,
side: BorderSide(color: colorScheme.outlineVariant),
),
child: InkWell(
onTap: onTap,
borderRadius: BorderRadius.circular(16),
borderRadius: AppRadius.mdBorder,
child: Padding(
padding: const EdgeInsets.all(16),
child: Row(

View File

@@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:go_router/go_router.dart';
import 'package:nuanji_app/core/theme/app_colors.dart';
import 'package:nuanji_app/core/theme/app_radius.dart';
import 'package:nuanji_app/data/remote/api_client.dart';
import '../bloc/template_bloc.dart';
@@ -133,7 +134,7 @@ class _TemplateCard extends StatelessWidget {
return Card(
elevation: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16),
borderRadius: AppRadius.mdBorder,
side: BorderSide(color: colorScheme.outlineVariant),
),
child: InkWell(
@@ -141,7 +142,7 @@ class _TemplateCard extends StatelessWidget {
// 使用模板创建日记
context.push('/editor?template=${template.id}');
},
borderRadius: BorderRadius.circular(16),
borderRadius: AppRadius.mdBorder,
child: Padding(
padding: const EdgeInsets.all(16),
child: Column(
@@ -160,7 +161,7 @@ class _TemplateCard extends StatelessWidget {
AppColors.tertiary.withValues(alpha: 0.3),
],
),
borderRadius: BorderRadius.circular(16),
borderRadius: AppRadius.mdBorder,
),
alignment: Alignment.center,
child: Text(

View File

@@ -1,10 +1,17 @@
// 暖记响应式骨架 — 三级自适应布局
// 手机: 底部 TabBar | 平板: 侧边导航 | 桌面: 三栏
// 手机: 底部 TabBar + 中心凸起写日记按钮 | 平板: 侧边导航 | 桌面: 三栏
// Web 平台始终使用底部 TabBar移动端布局以保证导航交互正常
// 对齐 Open Design 原型稿: 首页/日历/写日记(FAB)/发现/我的
import 'package:flutter/foundation.dart' show kIsWeb;
import 'package:flutter/material.dart';
import '../core/constants/breakpoints.dart';
import '../core/theme/app_colors.dart';
import '../core/theme/app_typography.dart';
import '../core/theme/app_radius.dart';
/// 导航项数量(不含中心 FAB
const int kNavItemCount = 4;
/// 暖记自适应 Scaffold
class ResponsiveScaffold extends StatefulWidget {
@@ -13,15 +20,23 @@ class ResponsiveScaffold extends StatefulWidget {
required this.selectedIndex,
required this.onDestinationSelected,
required this.body,
this.floatingActionButton,
this.onCenterButtonPressed,
this.appBarTitle,
this.secondaryBody,
});
/// 当前选中的导航索引 (0-3对应首页/日历/发现/我的)
final int selectedIndex;
/// 导航项被选中回调
final ValueChanged<int> onDestinationSelected;
/// 主内容区
final Widget body;
final Widget? floatingActionButton;
/// 中心写日记按钮回调
final VoidCallback? onCenterButtonPressed;
final String? appBarTitle;
final Widget? secondaryBody;
@@ -34,7 +49,6 @@ class _ResponsiveScaffoldState extends State<ResponsiveScaffold> {
Widget build(BuildContext context) {
final width = MediaQuery.sizeOf(context).width;
// Web 平台:始终使用移动端底部 TabBar 布局
// 原因Web 上 NavigationRail 点击事件可能被 Flutter CanvasKit 拦截
final deviceType = kIsWeb
? DeviceType.mobile
: Breakpoints.getDeviceType(width);
@@ -45,7 +59,7 @@ class _ResponsiveScaffoldState extends State<ResponsiveScaffold> {
selectedIndex: widget.selectedIndex,
onDestinationSelected: widget.onDestinationSelected,
body: widget.body,
floatingActionButton: widget.floatingActionButton,
onCenterButtonPressed: widget.onCenterButtonPressed,
appBarTitle: widget.appBarTitle,
);
case DeviceType.tablet:
@@ -53,6 +67,7 @@ class _ResponsiveScaffoldState extends State<ResponsiveScaffold> {
selectedIndex: widget.selectedIndex,
onDestinationSelected: widget.onDestinationSelected,
body: widget.body,
onCenterButtonPressed: widget.onCenterButtonPressed,
appBarTitle: widget.appBarTitle,
);
case DeviceType.desktop:
@@ -60,6 +75,7 @@ class _ResponsiveScaffoldState extends State<ResponsiveScaffold> {
selectedIndex: widget.selectedIndex,
onDestinationSelected: widget.onDestinationSelected,
body: widget.body,
onCenterButtonPressed: widget.onCenterButtonPressed,
secondaryBody: widget.secondaryBody,
appBarTitle: widget.appBarTitle,
);
@@ -67,32 +83,28 @@ class _ResponsiveScaffoldState extends State<ResponsiveScaffold> {
}
}
// ===== 导航项定义 =====
// ===== 导航项定义4 项,中间由 FAB 占位)=====
final _navItems = [
const _navItems = [
NavigationDestination(
icon: const Icon(Icons.home_outlined),
selectedIcon: const Icon(Icons.home),
icon: Icon(Icons.home_outlined),
selectedIcon: Icon(Icons.home),
label: '首页',
),
NavigationDestination(
icon: const Icon(Icons.calendar_month_outlined),
selectedIcon: const Icon(Icons.calendar_month),
icon: Icon(Icons.calendar_month_outlined),
selectedIcon: Icon(Icons.calendar_month),
label: '日历',
),
// 索引 2: 中心 FAB 占位(写日记)
NavigationDestination(
icon: const Icon(Icons.auto_awesome_outlined),
selectedIcon: const Icon(Icons.auto_awesome),
label: '心情',
icon: Icon(Icons.explore_outlined),
selectedIcon: Icon(Icons.explore),
label: '发现',
),
NavigationDestination(
icon: const Icon(Icons.search_outlined),
selectedIcon: const Icon(Icons.search),
label: '搜索',
),
NavigationDestination(
icon: const Icon(Icons.person_outline),
selectedIcon: const Icon(Icons.person),
icon: Icon(Icons.person_outline),
selectedIcon: Icon(Icons.person),
label: '我的',
),
];
@@ -109,14 +121,9 @@ const _railItems = [
label: Text('日历'),
),
NavigationRailDestination(
icon: Icon(Icons.auto_awesome_outlined),
selectedIcon: Icon(Icons.auto_awesome),
label: Text('心情'),
),
NavigationRailDestination(
icon: Icon(Icons.search_outlined),
selectedIcon: Icon(Icons.search),
label: Text('搜索'),
icon: Icon(Icons.explore_outlined),
selectedIcon: Icon(Icons.explore),
label: Text('发现'),
),
NavigationRailDestination(
icon: Icon(Icons.person_outline),
@@ -125,21 +132,42 @@ const _railItems = [
),
];
// ===== 手机布局 — 底部 TabBar =====
// ===== 中心写日记 FAB 按钮 =====
class _CenterFabButton extends StatelessWidget {
const _CenterFabButton({required this.onPressed});
final VoidCallback onPressed;
@override
Widget build(BuildContext context) {
return FloatingActionButton(
heroTag: 'center_write',
onPressed: onPressed,
backgroundColor: AppColors.accent,
foregroundColor: const Color(0xFFFFF8F0),
elevation: 4,
shape: const CircleBorder(),
child: const Icon(Icons.edit_rounded, size: 28),
);
}
}
// ===== 手机布局 — 底部 TabBar + 中心凸起 FAB =====
class _MobileLayout extends StatelessWidget {
const _MobileLayout({
required this.selectedIndex,
required this.onDestinationSelected,
required this.body,
this.floatingActionButton,
this.onCenterButtonPressed,
this.appBarTitle,
});
final int selectedIndex;
final ValueChanged<int> onDestinationSelected;
final Widget body;
final Widget? floatingActionButton;
final VoidCallback? onCenterButtonPressed;
final String? appBarTitle;
@override
@@ -149,11 +177,138 @@ class _MobileLayout extends StatelessWidget {
? AppBar(title: Text(appBarTitle!))
: null,
body: body,
floatingActionButton: floatingActionButton,
bottomNavigationBar: NavigationBar(
floatingActionButton: onCenterButtonPressed != null
? _CenterFabButton(onPressed: onCenterButtonPressed!)
: null,
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
bottomNavigationBar: _BottomNavBar(
selectedIndex: selectedIndex,
onDestinationSelected: onDestinationSelected,
destinations: _navItems,
),
);
}
}
/// 自定义底部导航栏 — 支持中心凹槽
class _BottomNavBar extends StatelessWidget {
const _BottomNavBar({
required this.selectedIndex,
required this.onDestinationSelected,
});
final int selectedIndex;
final ValueChanged<int> onDestinationSelected;
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final colorScheme = theme.colorScheme;
return BottomAppBar(
shape: const CircularNotchedRectangle(),
padding: EdgeInsets.zero,
height: 64,
color: colorScheme.surface,
surfaceTintColor: Colors.transparent,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
// 首页
_NavItem(
icon: Icons.home_outlined,
activeIcon: Icons.home,
label: '首页',
isSelected: selectedIndex == 0,
color: colorScheme.primary,
inactiveColor: colorScheme.onSurfaceVariant,
onTap: () => onDestinationSelected(0),
),
// 日历
_NavItem(
icon: Icons.calendar_month_outlined,
activeIcon: Icons.calendar_month,
label: '日历',
isSelected: selectedIndex == 1,
color: colorScheme.primary,
inactiveColor: colorScheme.onSurfaceVariant,
onTap: () => onDestinationSelected(1),
),
// 中间留给 FAB 凹槽 — 占位
const SizedBox(width: 48),
// 发现
_NavItem(
icon: Icons.explore_outlined,
activeIcon: Icons.explore,
label: '发现',
isSelected: selectedIndex == 2,
color: colorScheme.primary,
inactiveColor: colorScheme.onSurfaceVariant,
onTap: () => onDestinationSelected(2),
),
// 我的
_NavItem(
icon: Icons.person_outline,
activeIcon: Icons.person,
label: '我的',
isSelected: selectedIndex == 3,
color: colorScheme.primary,
inactiveColor: colorScheme.onSurfaceVariant,
onTap: () => onDestinationSelected(3),
),
],
),
);
}
}
/// 单个底部导航项
class _NavItem extends StatelessWidget {
const _NavItem({
required this.icon,
required this.activeIcon,
required this.label,
required this.isSelected,
required this.color,
required this.inactiveColor,
required this.onTap,
});
final IconData icon;
final IconData activeIcon;
final String label;
final bool isSelected;
final Color color;
final Color inactiveColor;
final VoidCallback onTap;
@override
Widget build(BuildContext context) {
return InkWell(
onTap: onTap,
customBorder: const CircleBorder(),
child: SizedBox(
width: 64,
height: 56,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [
Icon(
isSelected ? activeIcon : icon,
size: 24,
color: isSelected ? color : inactiveColor,
),
const SizedBox(height: 2),
Text(
label,
style: TextStyle(
fontSize: 11,
fontWeight: isSelected ? FontWeight.w600 : FontWeight.w500,
color: isSelected ? color : inactiveColor,
),
),
],
),
),
);
}
@@ -166,16 +321,20 @@ class _TabletLayout extends StatelessWidget {
required this.selectedIndex,
required this.onDestinationSelected,
required this.body,
this.onCenterButtonPressed,
this.appBarTitle,
});
final int selectedIndex;
final ValueChanged<int> onDestinationSelected;
final Widget body;
final VoidCallback? onCenterButtonPressed;
final String? appBarTitle;
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
return Scaffold(
appBar: appBarTitle != null
? AppBar(title: Text(appBarTitle!))
@@ -187,11 +346,25 @@ class _TabletLayout extends StatelessWidget {
onDestinationSelected: onDestinationSelected,
destinations: _railItems,
leading: Padding(
padding: const EdgeInsets.symmetric(vertical: 16),
child: Icon(
padding: const EdgeInsets.symmetric(vertical: 8),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Icon(
Icons.edit_note_rounded,
size: 32,
color: Theme.of(context).colorScheme.primary,
color: theme.colorScheme.primary,
),
const SizedBox(height: 8),
if (onCenterButtonPressed != null)
FloatingActionButton.small(
heroTag: 'rail_write',
onPressed: onCenterButtonPressed,
backgroundColor: AppColors.accent,
foregroundColor: const Color(0xFFFFF8F0),
child: const Icon(Icons.edit_rounded, size: 20),
),
],
),
),
),
@@ -210,6 +383,7 @@ class _DesktopLayout extends StatelessWidget {
required this.selectedIndex,
required this.onDestinationSelected,
required this.body,
this.onCenterButtonPressed,
this.secondaryBody,
this.appBarTitle,
});
@@ -217,11 +391,14 @@ class _DesktopLayout extends StatelessWidget {
final int selectedIndex;
final ValueChanged<int> onDestinationSelected;
final Widget body;
final VoidCallback? onCenterButtonPressed;
final Widget? secondaryBody;
final String? appBarTitle;
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
return Scaffold(
appBar: appBarTitle != null
? AppBar(title: Text(appBarTitle!))
@@ -234,21 +411,43 @@ class _DesktopLayout extends StatelessWidget {
destinations: _railItems,
extended: true,
leading: Padding(
padding: const EdgeInsets.symmetric(vertical: 16),
child: Row(
padding: const EdgeInsets.symmetric(vertical: 8),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(
Icons.edit_note_rounded,
size: 32,
color: Theme.of(context).colorScheme.primary,
color: theme.colorScheme.primary,
),
const SizedBox(width: 12),
Text(
'暖记',
style: Theme.of(context).textTheme.headlineSmall?.copyWith(
fontFamily: 'Caveat',
color: Theme.of(context).colorScheme.primary,
style: theme.textTheme.headlineSmall?.copyWith(
fontFamily: AppTypography.handwrittenFont,
color: theme.colorScheme.primary,
),
),
],
),
const SizedBox(height: 12),
if (onCenterButtonPressed != null)
Padding(
padding: const EdgeInsets.only(right: 16),
child: ElevatedButton.icon(
onPressed: onCenterButtonPressed,
icon: const Icon(Icons.edit_rounded, size: 18),
label: const Text('写日记'),
style: ElevatedButton.styleFrom(
backgroundColor: AppColors.accent,
foregroundColor: const Color(0xFFFFF8F0),
shape: RoundedRectangleBorder(
borderRadius: AppRadius.pillBorder,
),
),
),
),
],

View File

@@ -23,7 +23,7 @@ level = "info"
[cors]
# Comma-separated allowed origins. Use "*" for development only.
allowed_origins = "http://localhost:5173,http://localhost:5174,http://localhost:5175,http://localhost:5176,http://localhost:3000"
allowed_origins = "*"
[wechat]
appid = "__MUST_SET_VIA_ENV__"

View File

@@ -341,11 +341,17 @@ impl ClassService {
/// 生成 6 位班级码UUID 前 6 位字符)
fn generate_class_code() -> String {
// UUID v7 毫秒级时间戳前缀在紧凑循环中可能重复
// 取后 6 位(随机部分)而非前 6 位(时间戳部分)
Uuid::now_v7()
.to_string()
.replace("-", "")
.chars()
.rev()
.take(6)
.collect::<String>()
.chars()
.rev()
.collect()
}

View File

@@ -49,14 +49,15 @@ impl MigrationTrait for Migration {
];
for (role_code, perm_code) in &role_permissions {
// role_permissions 表主键为 (role_id, permission_id),无 id 列
let sql = format!(
r#"INSERT INTO role_permissions (id, role_id, permission_id, tenant_id, created_at, updated_at, created_by, updated_by, version)
SELECT gen_random_uuid(), r.id, p.id, r.tenant_id, now(), now(), {tid}, {tid}, 1
r#"INSERT INTO role_permissions (role_id, permission_id, tenant_id, created_at, updated_at, created_by, updated_by, version)
SELECT r.id, p.id, r.tenant_id, now(), now(), {tid}, {tid}, 1
FROM roles r
JOIN permissions p ON p.tenant_id = r.tenant_id
WHERE r.code = '{role_code}' AND r.tenant_id = {tid} AND r.deleted_at IS NULL
AND p.code = '{perm_code}' AND p.deleted_at IS NULL
ON CONFLICT DO NOTHING"#,
ON CONFLICT (role_id, permission_id) DO NOTHING"#,
);
conn.execute(sea_orm::Statement::from_string(
sea_orm::DatabaseBackend::Postgres,

View File

@@ -0,0 +1,296 @@
/* ─────────────────────────────────────────────────────────
* 暖记 — 共享组件样式
* ───────────────────────────────────────────────────────── */
/* Reset & base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
font-family: var(--font-body);
font-size: var(--text-base);
line-height: var(--leading-body);
color: var(--fg);
background: var(--bg);
overflow-x: hidden;
}
/* Phone frame wrapper */
.phone-frame {
width: 390px;
height: 844px;
position: relative;
overflow: hidden;
background: var(--bg);
border-radius: 44px;
box-shadow: var(--elev-float);
}
/* Status bar */
.status-bar {
display: flex;
justify-content: space-between;
align-items: center;
padding: 14px 28px 0;
height: var(--safe-top);
font-size: var(--text-sm);
font-weight: 600;
color: var(--fg);
position: relative;
z-index: 100;
}
.status-bar .time { font-variant-numeric: tabular-nums; }
.status-bar .icons { display: flex; gap: 6px; align-items: center; }
.status-bar .icons svg { width: 18px; height: 18px; }
/* Dynamic Island */
.dynamic-island {
position: absolute;
top: 12px;
left: 50%;
transform: translateX(-50%);
width: 126px;
height: 36px;
background: #000;
border-radius: 20px;
z-index: 200;
}
/* Top nav bar */
.top-nav {
display: flex;
align-items: center;
justify-content: space-between;
padding: var(--space-4) var(--space-5);
position: relative;
z-index: 10;
}
.top-nav .title {
font-family: var(--font-display);
font-size: var(--text-xl);
font-weight: 700;
color: var(--fg);
}
.top-nav .action {
width: var(--touch-min);
height: var(--touch-min);
display: flex;
align-items: center;
justify-content: center;
border-radius: var(--radius-pill);
background: var(--surface);
border: none;
cursor: pointer;
transition: background var(--motion-fast) var(--ease-standard);
}
.top-nav .action:hover { background: var(--border-soft); }
.top-nav .action:focus-visible { box-shadow: var(--focus-ring); outline: none; }
.top-nav .action svg { width: 22px; height: 22px; color: var(--fg); }
/* Bottom tab bar */
.tab-bar {
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: calc(var(--tab-height) + var(--safe-bottom));
padding-bottom: var(--safe-bottom);
display: flex;
align-items: flex-start;
justify-content: space-around;
background: var(--surface);
border-top: 1px solid var(--border-soft);
z-index: 100;
}
.tab-item {
display: flex;
flex-direction: column;
align-items: center;
gap: 2px;
padding-top: 10px;
background: none;
border: none;
cursor: pointer;
color: var(--muted);
font-size: var(--text-xs);
font-weight: 500;
transition: color var(--motion-fast) var(--ease-standard);
}
.tab-item.active { color: var(--accent); }
.tab-item svg { width: 24px; height: 24px; }
.tab-item span { margin-top: 2px; }
/* Buttons */
.btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: var(--space-2);
padding: 14px 28px;
border-radius: var(--radius-pill);
border: none;
font-family: var(--font-display);
font-size: var(--text-md);
font-weight: 600;
cursor: pointer;
transition: all var(--motion-fast) var(--ease-standard);
}
.btn:active { transform: scale(0.97); }
.btn-primary {
background: var(--accent);
color: var(--accent-on);
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:focus-visible { box-shadow: var(--focus-ring); outline: none; }
.btn-secondary {
background: var(--surface);
color: var(--fg);
border: 1.5px solid var(--border);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-secondary:focus-visible { box-shadow: var(--focus-ring); outline: none; }
.btn-ghost {
background: transparent;
color: var(--muted);
}
.btn-ghost:hover { color: var(--accent); }
/* Cards */
.card {
background: var(--surface);
border-radius: var(--radius-md);
padding: var(--space-5);
box-shadow: var(--elev-soft);
border: 1px solid var(--border-soft);
}
/* Tags / chips */
.chip {
display: inline-flex;
align-items: center;
gap: var(--space-1);
padding: 6px 14px;
border-radius: var(--radius-pill);
font-size: var(--text-sm);
font-weight: 500;
background: var(--surface);
color: var(--fg-2);
border: 1px solid var(--border);
transition: all var(--motion-fast) var(--ease-standard);
}
.chip:focus-visible { box-shadow: var(--focus-ring); outline: none; }
.chip.active {
background: var(--accent);
color: var(--accent-on);
border-color: var(--accent);
}
/* Section heading */
.section-heading {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: var(--space-4);
}
.section-heading h3 {
font-family: var(--font-display);
font-size: var(--text-lg);
font-weight: 700;
}
.section-heading .more {
font-size: var(--text-sm);
color: var(--accent);
cursor: pointer;
background: none;
border: none;
font-weight: 500;
min-height: var(--touch-min);
display: inline-flex;
align-items: center;
}
.section-heading .more:focus-visible { box-shadow: var(--focus-ring); outline: none; border-radius: 4px; }
/* Mood emoji faces */
.mood-row {
display: flex;
gap: var(--space-3);
justify-content: center;
}
.mood-btn {
width: 48px;
height: 48px;
border-radius: 50%;
border: 2px solid var(--border);
display: flex;
align-items: center;
justify-content: center;
font-size: 24px;
background: var(--surface);
cursor: pointer;
transition: all var(--motion-fast) var(--ease-bounce);
}
.mood-btn:hover { transform: scale(1.1); }
.mood-btn:focus-visible { box-shadow: var(--focus-ring); outline: none; }
.mood-btn.selected {
border-color: var(--accent);
background: var(--surface-warm);
transform: scale(1.08);
}
/* Scroll content area */
.scroll-content {
overflow-y: auto;
overflow-x: hidden;
-webkit-overflow-scrolling: touch;
scrollbar-width: none;
}
.scroll-content::-webkit-scrollbar { display: none; }
/* Utility */
.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.text-accent { color: var(--accent); }
.text-secondary { color: var(--secondary); }
.font-display { font-family: var(--font-display); }
.font-hand { font-family: var(--font-handwritten); }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.gap-6 { gap: var(--space-6); }
.w-full { width: 100%; }
.rounded-full { border-radius: var(--radius-pill); }
/* Decorative doodles */
.doodle { opacity: 0.15; pointer-events: none; }
/* Home indicator */
.home-indicator {
width: 134px;
height: 5px;
background: var(--fg);
opacity: 0.2;
border-radius: 3px;
margin: 8px auto;
}
/* Page transitions */
@keyframes fadeIn {
from { opacity: 0; transform: translateY(12px); }
to { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
from { opacity: 0; transform: translateY(40px); }
to { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
from { opacity: 0; transform: scale(0.9); }
to { opacity: 1; transform: scale(1); }
}
.anim-fade { animation: fadeIn 0.5s var(--ease-standard) both; }
.anim-slide { animation: slideUp 0.6s var(--ease-bounce) both; }
.anim-scale { animation: scaleIn 0.4s var(--ease-bounce) both; }

View File

@@ -0,0 +1,502 @@
/* ─────────────────────────────────────────────────────────
* 暖记 — 编辑器共享样式
* 三端通用 (mobile / tablet / desktop)
* ───────────────────────────────────────────────────────── */
/* Top toolbar */
.editor-topbar {
display: flex;
align-items: center;
justify-content: space-between;
background: var(--surface);
border-bottom: 1px solid var(--border-soft);
}
.topbar-left, .topbar-right {
display: flex;
align-items: center;
gap: var(--space-3);
}
.topbar-btn {
border-radius: var(--radius-pill);
border: none;
background: none;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
color: var(--fg);
transition: background var(--motion-fast);
}
.topbar-btn:hover { background: var(--surface-warm); }
.topbar-center {
font-family: var(--font-display);
font-size: var(--text-base);
font-weight: 600;
color: var(--fg-2);
}
/* Save button */
.save-btn {
background: var(--accent);
color: var(--accent-on);
border: none;
border-radius: var(--radius-pill);
font-family: var(--font-display);
font-size: var(--text-sm);
font-weight: 600;
cursor: pointer;
transition: all var(--motion-fast);
}
.save-btn:hover { background: var(--accent-hover); }
/* Canvas area common */
.canvas-grid {
position: absolute;
inset: 0;
background-image: radial-gradient(circle, var(--border) 1px, transparent 1px);
background-size: 28px 28px;
opacity: 0.4;
pointer-events: none;
border-radius: var(--radius-md);
}
.washi-tape {
position: absolute;
background: repeating-linear-gradient(
45deg,
rgba(242, 204, 143, 0.7),
rgba(242, 204, 143, 0.7) 4px,
rgba(255, 243, 230, 0.7) 4px,
rgba(255, 243, 230, 0.7) 8px
);
transform: rotate(-8deg);
border-radius: 2px;
opacity: 0.8;
}
.placed-sticker {
position: absolute;
cursor: move;
filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}
.journal-content { position: relative; z-index: 1; }
.journal-title {
font-family: var(--font-display);
font-size: var(--text-2xl);
font-weight: 700;
color: var(--fg);
margin-bottom: var(--space-4);
border: none;
outline: none;
width: 100%;
background: transparent;
}
.journal-body {
font-size: var(--text-base);
line-height: 1.9;
color: var(--fg-2);
border: none;
outline: none;
width: 100%;
background: transparent;
resize: none;
min-height: 240px;
}
/* Format bar */
.format-bar {
display: flex;
align-items: center;
gap: var(--space-2);
padding: var(--space-2) 0;
margin-bottom: var(--space-4);
border-bottom: 1px solid var(--border-soft);
}
.format-btn {
border-radius: 6px;
border: none;
background: none;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
color: var(--muted);
font-size: var(--text-sm);
font-weight: 600;
transition: all var(--motion-fast);
}
.format-btn:hover { background: var(--surface-warm); color: var(--fg); }
.format-btn.active { background: var(--accent); color: #FFF8F0; }
.format-divider {
width: 1px;
height: 22px;
background: var(--border);
}
/* Color dots */
.color-dot {
border-radius: 50%;
border: 2px solid transparent;
cursor: pointer;
transition: all var(--motion-fast);
}
.color-dot:hover { transform: scale(1.15); }
.color-dot.active { border-color: var(--fg); }
/* Placed photo in journal */
.placed-photo {
width: 100%;
border-radius: var(--radius-sm);
background: linear-gradient(135deg, #D4E8DC, #E8F4ED);
display: flex;
align-items: center;
justify-content: center;
}
/* Panel tabs */
.panel-tab {
padding: 8px 16px;
border-radius: var(--radius-pill);
font-size: var(--text-sm);
font-weight: 500;
background: var(--surface-warm);
color: var(--fg-2);
border: none;
cursor: pointer;
white-space: nowrap;
transition: all var(--motion-fast);
}
.panel-tab.active { background: var(--accent); color: #FFF8F0; }
.panel-content {
padding: var(--space-5);
}
/* Sticker grid */
.sticker-grid {
display: grid;
grid-template-columns: repeat(5, 1fr);
gap: var(--space-3);
}
.sticker-item {
aspect-ratio: 1;
border-radius: var(--radius-sm);
background: var(--surface-warm);
display: flex;
align-items: center;
justify-content: center;
font-size: 28px;
cursor: pointer;
transition: all var(--motion-fast) var(--ease-bounce);
border: 1px solid transparent;
}
.sticker-item:hover { transform: scale(1.1); border-color: var(--accent); }
/* Date strip */
.date-strip {
display: flex;
align-items: center;
justify-content: space-between;
background: var(--surface);
}
.date-info {
display: flex;
align-items: center;
gap: var(--space-2);
font-size: var(--text-sm);
color: var(--muted);
}
.date-info strong { color: var(--fg); font-weight: 600; }
.mood-quick { display: flex; gap: 6px; }
.mood-mini {
border-radius: 50%;
border: 1.5px solid var(--border);
display: flex;
align-items: center;
justify-content: center;
background: var(--surface);
cursor: pointer;
transition: all var(--motion-fast);
}
.mood-mini.selected { border-color: var(--accent); background: var(--surface-warm); }
/* Undo/Redo */
.topbar-undo-redo {
display: flex;
align-items: center;
gap: 2px;
}
.undo-btn, .redo-btn {
border-radius: var(--radius-pill);
border: none;
background: none;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
color: var(--muted);
transition: all var(--motion-fast);
}
.undo-btn:hover:not(:disabled), .redo-btn:hover:not(:disabled) { background: var(--surface-warm); color: var(--fg); }
.undo-btn:disabled, .redo-btn:disabled { opacity: 0.35; cursor: default; }
.undo-btn svg, .redo-btn svg { width: 18px; height: 18px; }
/* Auto-save indicator */
.autosave-status {
display: flex;
align-items: center;
gap: 5px;
font-size: 11px;
color: var(--success);
font-weight: 500;
}
.autosave-dot {
width: 6px;
height: 6px;
border-radius: 50%;
background: var(--success);
}
/* Brush slider (size + opacity) */
.brush-slider {
flex: 1;
-webkit-appearance: none;
appearance: none;
height: 4px;
border-radius: 2px;
background: var(--border);
outline: none;
}
.brush-slider::-webkit-slider-thumb {
-webkit-appearance: none;
width: 18px;
height: 18px;
border-radius: 50%;
background: var(--accent);
cursor: pointer;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}
.brush-size-row {
display: flex;
align-items: center;
gap: var(--space-3);
}
.brush-size-value {
font-size: var(--text-sm);
font-weight: 600;
color: var(--fg);
min-width: 36px;
text-align: right;
}
/* Brush color dots */
.brush-color-dot {
border-radius: 50%;
border: 3px solid transparent;
cursor: pointer;
transition: all var(--motion-fast);
}
.brush-color-dot:hover { transform: scale(1.1); }
.brush-color-dot.active { border-color: var(--fg); box-shadow: 0 0 0 2px var(--surface); }
/* Brush opacity */
.brush-opacity-row {
display: flex;
align-items: center;
gap: var(--space-3);
transition: opacity var(--motion-fast);
}
.brush-opacity-row.disabled { opacity: 0.35; pointer-events: none; }
.brush-opacity-label {
font-size: var(--text-xs);
color: var(--muted);
font-weight: 500;
min-width: 40px;
}
.brush-opacity-value {
font-size: var(--text-sm);
font-weight: 600;
color: var(--fg);
min-width: 36px;
text-align: right;
}
/* Tag pill */
.tag-selected-area {
display: flex;
flex-wrap: wrap;
gap: var(--space-2);
min-height: 36px;
}
.tag-pill {
display: inline-flex;
align-items: center;
gap: 4px;
padding: 4px 12px;
border-radius: 9999px;
background: var(--surface-warm);
color: var(--accent);
font-size: 13px;
font-weight: 500;
transition: all var(--motion-fast);
}
.tag-pill .remove {
width: 16px;
height: 16px;
border-radius: 50%;
background: var(--accent);
color: var(--surface);
display: flex;
align-items: center;
justify-content: center;
font-size: 10px;
cursor: pointer;
border: none;
line-height: 1;
transition: background var(--motion-fast);
}
.tag-pill .remove:hover { background: var(--accent-hover); }
/* Tag input */
.tag-input-row {
display: flex;
}
.tag-input {
flex: 1;
height: 44px;
border: 1.5px solid var(--border);
border-radius: var(--radius-pill);
padding: 0 var(--space-4);
font-size: var(--text-sm);
color: var(--fg);
background: var(--bg);
outline: none;
transition: border-color var(--motion-fast);
font-family: var(--font-body);
}
.tag-input::placeholder { color: var(--meta); }
.tag-input:focus { border-color: var(--accent); box-shadow: var(--shadow-input-focus); }
/* Tag suggest items */
.tag-suggest-item {
display: inline-flex;
align-items: center;
padding: 6px 14px;
border-radius: 9999px;
background: var(--surface-warm);
color: var(--fg-2);
font-size: var(--text-sm);
font-weight: 500;
border: 1px solid transparent;
cursor: pointer;
white-space: nowrap;
min-height: 44px;
transition: all var(--motion-fast);
}
.tag-suggest-item:hover { border-color: var(--accent); color: var(--accent); }
/* Brush section title (tablet/desktop) */
.brush-section-title {
font-size: var(--text-xs);
font-weight: 600;
color: var(--muted);
text-transform: uppercase;
letter-spacing: 0.5px;
margin-bottom: var(--space-3);
}
/* Brush color grid (tablet/desktop) */
.brush-colors-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: var(--space-3);
}
/* Tags section */
.tags-section {
margin-bottom: var(--space-5);
}
/* Tool panel side (tablet/desktop) */
.tool-panel-side {
background: var(--surface);
border-left: 1px solid var(--border-soft);
overflow-y: auto;
scrollbar-width: thin;
flex-shrink: 0;
}
.tool-panel-side::-webkit-scrollbar { width: 4px; }
.tool-panel-side::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.panel-header {
padding: var(--space-5);
border-bottom: 1px solid var(--border-soft);
display: flex;
align-items: center;
gap: var(--space-3);
}
/* Canvas wrapper scrollbar (tablet/desktop) */
.canvas-wrapper {
flex: 1;
padding: var(--space-6);
overflow-y: auto;
scrollbar-width: thin;
scrollbar-color: var(--border) transparent;
}
.canvas-wrapper::-webkit-scrollbar { width: 4px; }
.canvas-wrapper::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
/* Canvas paper (tablet/desktop) */
.canvas-paper {
background: var(--surface);
border-radius: var(--radius-md);
box-shadow: var(--elev-medium);
border: 1px solid var(--border-soft);
position: relative;
}
/* Editor body flex layout (tablet/desktop) */
.editor-body {
flex: 1;
display: flex;
overflow: hidden;
}

View File

@@ -0,0 +1,235 @@
/* ─────────────────────────────────────────────────────────
* 暖记 (Warm Notes) — 手账日记App 视觉系统
* Theme 1: 暖阳 (Warm Sun) — 温暖治愈 · 手绘插画风 · 默认
* Theme 2: 松风 (Pine Wind) — 静谧森林 · 自然调性 · 男学生向
* ───────────────────────────────────────────────────────── */
:root {
/* Surface */
--bg: #FFF8F0;
--surface: #FFFFFF;
--surface-warm: #FFF3E6;
/* Foreground ramp (contrast-safe on #FFF8F0) */
--fg: #2D2420;
--fg-2: #5C4F47;
--muted: #7A6D63;
--meta: #8B7E74;
/* Border */
--border: #E8DDD4;
--border-soft: #F0E8DF;
/* Accent — soft coral / terracotta */
--accent: #E07A5F;
--accent-on: #FFF8F0;
--accent-hover: #D06A4F;
--accent-active: #C05A3F;
--accent-glow: rgba(224, 122, 95, 0.25);
/* Secondary — sage green */
--secondary: #81B29A;
--secondary-soft: #D4E8DC;
/* Tertiary — warm gold */
--tertiary: #F2CC8F;
--tertiary-soft: #FBE8C8;
/* Rose */
--rose: #D4A5A5;
--rose-soft: #F0DADA;
/* Semantic */
--success: #5A9E7E;
--warn: #D4A843;
--danger: #C93D3D;
/* Typography */
--font-display: "Quicksand", "Nunito", "SF Pro Rounded", -apple-system, system-ui, sans-serif;
--font-body: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
--font-mono: ui-monospace, "JetBrains Mono", monospace;
--font-handwritten: "Caveat", "Kalam", cursive;
/* Type scale */
--text-xs: 11px;
--text-sm: 13px;
--text-base: 15px;
--text-md: 17px;
--text-lg: 20px;
--text-xl: 24px;
--text-2xl: 30px;
--text-3xl: 38px;
--text-4xl: 48px;
--leading-body: 1.6;
--leading-tight: 1.25;
/* Spacing */
--space-1: 4px;
--space-2: 8px;
--space-3: 12px;
--space-4: 16px;
--space-5: 20px;
--space-6: 24px;
--space-8: 32px;
--space-10: 40px;
--space-12: 48px;
/* Radius */
--radius-sm: 10px;
--radius-md: 16px;
--radius-lg: 22px;
--radius-xl: 28px;
--radius-pill: 9999px;
/* Elevation */
--elev-soft: 0 2px 12px rgba(45, 36, 32, 0.06);
--elev-medium: 0 4px 20px rgba(45, 36, 32, 0.08);
--elev-float: 0 8px 32px rgba(45, 36, 32, 0.12);
/* Focus */
--focus-ring: 0 0 0 3px rgba(224, 122, 95, 0.45);
--shadow-accent: 0 4px 14px rgba(224, 122, 95, 0.25);
--shadow-accent-hover: 0 6px 20px rgba(224, 122, 95, 0.35);
--shadow-input-focus: 0 0 0 3px rgba(224, 122, 95, 0.2);
--bg-frosted: rgba(255, 248, 240, 0.85);
/* Touch target minimum (WCAG 2.5.8) */
--touch-min: 44px;
/* Motion */
--motion-fast: 150ms;
--motion-base: 250ms;
--ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
--ease-standard: cubic-bezier(0.2, 0, 0, 1);
/* Layout */
--container-max: 390px;
--safe-top: 54px;
--safe-bottom: 34px;
--tab-height: 56px;
/* Theme meta */
--theme-name: "暖阳";
}
/* ─────────────────────────────────────────────────────────
* Theme: 松风 (Pine Wind) — 森林书房 · 男学生向
* Steel blue accent + forest green + warm amber
* ───────────────────────────────────────────────────────── */
[data-theme="pine"] {
--bg: #F2F3F0;
--surface: #FFFFFF;
--surface-warm: #E9EAE6;
--fg: #23272F;
--fg-2: #484E58;
--muted: #6E7380;
--meta: #8A8F9A;
--border: #D5D2CD;
--border-soft: #E3E1DC;
--accent: #4A7B9D;
--accent-on: #FFFFFF;
--accent-hover: #3F6A8A;
--accent-active: #345A78;
--accent-glow: rgba(74, 123, 157, 0.25);
--secondary: #5B9E7A;
--secondary-soft: #D6E8DE;
--tertiary: #C49A3C;
--tertiary-soft: #F0E4C8;
--rose: #7A8B6A;
--rose-soft: #E0E8D8;
--success: #4A9E6E;
--warn: #B89430;
--danger: #C93D3D;
--elev-soft: 0 2px 12px rgba(35, 39, 47, 0.06);
--elev-medium: 0 4px 20px rgba(35, 39, 47, 0.08);
--elev-float: 0 8px 32px rgba(35, 39, 47, 0.12);
--focus-ring: 0 0 0 3px rgba(74, 123, 157, 0.45);
--shadow-accent: 0 4px 14px rgba(74, 123, 157, 0.25);
--shadow-accent-hover: 0 6px 20px rgba(74, 123, 157, 0.35);
--shadow-input-focus: 0 0 0 3px rgba(74, 123, 157, 0.2);
--bg-frosted: rgba(242, 243, 240, 0.85);
--theme-name: "松风";
}
/* ─────────────────────────────────────────────────────────
* Dark Mode — 暖阳 (Warm Sun) dark
* ───────────────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
:root:not([data-theme]),
:root[data-theme="warm"] {
--bg: #1A1614;
--surface: #2A2520;
--surface-warm: #332D28;
--fg: #F0E8DF;
--fg-2: #C4B8AA;
--muted: #9B8E82;
--meta: #7A6D63;
--border: #3A3530;
--border-soft: #302B26;
--accent: #E8907A;
--accent-on: #1A1614;
--accent-hover: #D07A64;
--accent-active: #C06A54;
--accent-glow: rgba(232, 144, 122, 0.25);
--secondary: #8FBF9E;
--secondary-soft: #2A3A2E;
--tertiary: #D4B878;
--tertiary-soft: #302A1E;
--rose: #C4A0A0;
--rose-soft: #3A2A2A;
--success: #6AAF8E;
--warn: #C4A843;
--danger: #D94A4A;
--elev-soft: 0 2px 12px rgba(0, 0, 0, 0.2);
--elev-medium: 0 4px 20px rgba(0, 0, 0, 0.25);
--elev-float: 0 8px 32px rgba(0, 0, 0, 0.3);
--focus-ring: 0 0 0 3px rgba(232, 144, 122, 0.5);
--shadow-accent: 0 4px 14px rgba(232, 144, 122, 0.25);
--shadow-accent-hover: 0 6px 20px rgba(232, 144, 122, 0.35);
--shadow-input-focus: 0 0 0 3px rgba(232, 144, 122, 0.2);
--bg-frosted: rgba(26, 22, 20, 0.85);
* */
@media (prefers-color-scheme: dark) {
[data-theme="pine"] {
--bg: #14161C;
--surface: #1C1E26;
--surface-warm: #22242C;
--fg: #E4E6EC;
--fg-2: #B4B8C4;
--muted: #7E8494;
--meta: #5E6474;
--border: #282C38;
--border-soft: #1E222C;
--accent: #5A8FAD;
--accent-on: #14161C;
--accent-hover: #4A7F9D;
--accent-active: #3A6F8D;
--accent-glow: rgba(90, 143, 173, 0.25);
--secondary: #6AAE85;
--secondary-soft: #1C2E24;
--tertiary: #D4AA4C;
--tertiary-soft: #2A2618;
--rose: #8A9B7A;
--rose-soft: #242E20;
--success: #5AAE7E;
--warn: #C4A440;
--danger: #D94A4A;
--elev-soft: 0 2px 12px rgba(0, 0, 0, 0.2);
--elev-medium: 0 4px 20px rgba(0, 0, 0, 0.25);
--elev-float: 0 8px 32px rgba(0, 0, 0, 0.3);
--focus-ring: 0 0 0 3px rgba(90, 143, 173, 0.5);
--shadow-accent: 0 4px 14px rgba(90, 143, 173, 0.25);
--shadow-accent-hover: 0 6px 20px rgba(90, 143, 173, 0.35);
--shadow-input-focus: 0 0 0 3px rgba(90, 143, 173, 0.2);
--bg-frosted: rgba(20, 22, 28, 0.85);

611
docs/opendesign/index.html Normal file
View File

@@ -0,0 +1,611 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>暖记 — 多终端手账App 设计稿</title>
<style>
@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;500;600;700&family=Nunito:wght@400;500;600;700&display=swap');
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
--bg: #FFF8F0;
--surface: #FFFFFF;
--fg: #2D2420;
--fg-2: #5C4F47;
--muted: #7A6D63;
--meta: #8B7E74;
--border: #E8DDD4;
--border-soft: #F0E8DF;
--accent: #E07A5F;
--accent-on: #FFF8F0;
--accent-hover: #D06A4F;
--accent-glow: rgba(224, 122, 95, 0.25);
--secondary: #81B29A;
--secondary-soft: #D4E8DC;
--tertiary: #F2CC8F;
--rose: #D4A5A5;
--focus-ring: 0 0 0 3px rgba(224, 122, 95, 0.45);
--shadow-accent: 0 4px 14px rgba(224, 122, 95, 0.25);
--elev-soft: 0 2px 12px rgba(45, 36, 32, 0.06);
--elev-medium: 0 4px 20px rgba(45, 36, 32, 0.08);
--elev-float: 0 8px 32px rgba(45, 36, 32, 0.12);
--font-display: 'Quicksand', 'Nunito', sans-serif;
--font-body: 'Nunito', sans-serif;
}
[data-theme="pine"] {
--bg: #F2F3F0;
--surface: #FFFFFF;
--fg: #23272F;
--fg-2: #484E58;
--muted: #6E7380;
--meta: #8A8F9A;
--border: #D5D2CD;
--border-soft: #E3E1DC;
--accent: #4A7B9D;
--accent-on: #FFFFFF;
--accent-hover: #3F6A8A;
--accent-glow: rgba(74, 123, 157, 0.25);
--secondary: #5B9E7A;
--secondary-soft: #D6E8DE;
--tertiary: #C49A3C;
--rose: #7A8B6A;
--focus-ring: 0 0 0 3px rgba(74, 123, 157, 0.45);
--shadow-accent: 0 4px 14px rgba(74, 123, 157, 0.25);
--elev-soft: 0 2px 12px rgba(35, 39, 47, 0.06);
--elev-medium: 0 4px 20px rgba(35, 39, 47, 0.08);
--elev-float: 0 8px 32px rgba(35, 39, 47, 0.12);
}
html { -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }
body {
font-family: var(--font-body);
background: linear-gradient(180deg, var(--bg) 0%, var(--tertiary-soft, #FFE8D6) 50%, var(--bg) 100%);
color: var(--fg);
min-height: 100vh;
}
/* Header */
.hero {
text-align: center;
padding: 80px 24px 60px;
position: relative;
overflow: hidden;
}
.hero::before {
content: '';
position: absolute;
top: -50%;
left: -20%;
width: 140%;
height: 200%;
background: radial-gradient(ellipse at center, color-mix(in oklab, var(--accent) 6%, transparent) 0%, transparent 60%);
pointer-events: none;
}
.hero-badge {
display: inline-flex; align-items: center; gap: 8px;
padding: 6px 16px; border-radius: 999px;
background: color-mix(in oklab, var(--accent) 10%, transparent);
color: var(--accent); font-size: 13px;
font-weight: 600; margin-bottom: 20px;
}
.hero h1 {
font-family: var(--font-display);
font-size: clamp(36px, 5vw, 56px);
font-weight: 700; letter-spacing: 1px;
margin-bottom: 12px;
}
.hero h1 span { color: var(--accent); }
.hero .subtitle {
font-size: clamp(15px, 2vw, 18px);
color: var(--muted); max-width: 500px;
margin: 0 auto 32px; line-height: 1.6;
}
.hero-meta {
display: flex; justify-content: center;
gap: 24px; flex-wrap: wrap;
}
.hero-meta span {
display: flex; align-items: center; gap: 6px;
font-size: 14px; color: var(--fg-2);
}
.hero-meta .dot {
width: 8px; height: 8px; border-radius: 50%;
}
/* Platform tabs */
.platform-tabs {
display: flex;
justify-content: center;
gap: 8px;
margin-bottom: 32px;
}
.platform-tab {
padding: 10px 24px;
border-radius: 999px;
border: 1.5px solid var(--border);
background: var(--surface);
font-family: var(--font-display);
font-size: 14px;
font-weight: 600;
color: var(--muted);
cursor: pointer;
transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.platform-tab:hover { border-color: var(--accent); color: var(--accent); }
.platform-tab.active { background: var(--accent); color: var(--accent-on); border-color: var(--accent); }
.platform-section { display: none; }
.platform-section.active { display: block; }
/* Tablet frame */
.tablet-frame {
width: 480px;
height: 360px;
border-radius: 16px;
overflow: hidden;
box-shadow: 0 8px 32px rgba(45,36,32,0.12), 0 0 0 1px var(--border-soft);
background: white;
transition: box-shadow 0.3s;
}
.tablet-card:hover .tablet-frame {
box-shadow: var(--shadow-accent), 0 0 0 1px var(--accent);
}
.tablet-frame iframe {
width: 1024px;
height: 768px;
border: none;
transform: scale(0.469);
transform-origin: top left;
pointer-events: none;
}
.tablet-card {
flex-shrink: 0;
scroll-snap-align: start;
width: 480px;
cursor: pointer;
transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.tablet-card:hover { transform: translateY(-8px); }
/* Desktop frame */
.desktop-frame {
width: 640px;
height: 400px;
border-radius: 12px;
overflow: hidden;
box-shadow: 0 8px 32px rgba(45,36,32,0.12), 0 0 0 1px var(--border-soft);
background: white;
transition: box-shadow 0.3s;
}
.desktop-card:hover .desktop-frame {
box-shadow: var(--shadow-accent), 0 0 0 1px var(--accent);
}
.desktop-frame iframe {
width: 1440px;
height: 900px;
border: none;
transform: scale(0.444);
transform-origin: top left;
pointer-events: none;
}
.desktop-card {
flex-shrink: 0;
scroll-snap-align: start;
width: 640px;
cursor: pointer;
transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.desktop-card:hover { transform: translateY(-8px); }
/* Section */
.section {
max-width: 1400px;
margin: 0 auto;
padding: 40px 24px;
}
.section-title {
font-family: var(--font-display);
font-size: 28px; font-weight: 700;
margin-bottom: 8px;
}
.section-desc {
font-size: 15px; color: var(--muted);
margin-bottom: 32px;
}
/* Screen gallery */
.screen-gallery {
display: flex;
gap: 32px;
overflow-x: auto;
padding-bottom: 24px;
scroll-snap-type: x mandatory;
scrollbar-width: thin;
scrollbar-color: var(--border) transparent;
}
.screen-gallery::-webkit-scrollbar { height: 6px; }
.screen-gallery::-webkit-scrollbar-track { background: transparent; }
.screen-gallery::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.screen-card {
flex-shrink: 0;
scroll-snap-align: start;
width: 240px;
cursor: pointer;
transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.screen-card:hover { transform: translateY(-8px); }
.screen-frame {
width: 240px;
height: 520px;
border-radius: 28px;
overflow: hidden;
box-shadow: 0 8px 32px rgba(45,36,32,0.12), 0 0 0 1px var(--border-soft);
position: relative;
background: white;
transition: box-shadow 0.3s;
}
.screen-card:hover .screen-frame {
box-shadow: var(--shadow-accent), 0 0 0 1px var(--accent);
}
.screen-frame iframe {
width: 390px;
height: 844px;
border: none;
transform: scale(0.615);
transform-origin: top left;
pointer-events: none;
}
.screen-label {
margin-top: 16px;
text-align: center;
}
.screen-label .name {
font-family: var(--font-display);
font-size: 15px; font-weight: 600;
color: var(--fg);
}
.screen-label .desc {
font-size: 12px; color: var(--muted);
margin-top: 2px;
}
/* Device showcase */
.device-showcase {
display: flex;
justify-content: center;
gap: 48px;
flex-wrap: wrap;
padding: 40px 0;
}
.device-col {
display: flex;
flex-direction: column;
align-items: center;
gap: 16px;
}
.device-frame-wrapper {
border-radius: 28px;
overflow: hidden;
box-shadow: 0 8px 40px rgba(45,36,32,0.12);
border: 1px solid var(--border-soft);
transition: box-shadow 0.3s;
}
.device-frame-wrapper:hover {
box-shadow: var(--shadow-accent);
}
.device-frame-wrapper iframe {
border: none;
display: block;
}
.device-label {
font-family: var(--font-display);
font-size: 15px; font-weight: 600;
color: var(--fg-2);
}
.device-sub {
font-size: 12px; color: var(--muted);
}
/* Design tokens */
.tokens-section {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
gap: 16px;
margin-top: 24px;
}
.token-card {
background: var(--surface);
border-radius: 14px;
padding: 16px;
border: 1px solid var(--border-soft);
box-shadow: 0 2px 8px rgba(45,36,32,0.04);
}
.token-swatch {
width: 100%;
aspect-ratio: 1.4;
border-radius: 10px;
margin-bottom: 10px;
}
.token-name {
font-family: var(--font-display);
font-size: 13px; font-weight: 600;
margin-bottom: 2px;
}
.token-value {
font-size: 12px; color: var(--muted);
font-family: ui-monospace, monospace;
}
/* Footer */
footer {
text-align: center;
padding: 60px 24px 40px;
color: var(--muted);
font-size: 14px;
}
footer a { color: var(--accent); text-decoration: none; }
/* Responsive */
@media (max-width: 768px) {
.hero { padding: 60px 20px 40px; }
.section { padding: 24px 16px; }
.screen-gallery { gap: 20px; }
.screen-card { width: 200px; }
.screen-frame { width: 200px; height: 434px; }
.screen-frame iframe { transform: scale(0.513); }
.device-showcase { gap: 32px; }
}
</style>
</head>
<body>
<!-- Hero -->
<header class="hero">
<div class="hero-badge">Design System v1.0</div>
<h1><span>暖记</span> · 手账日记</h1>
<p class="subtitle">用温暖的方式记录每一天。面向学生的多终端手账日记App融合日记记录、贴纸装饰、模板系统、心情追踪、登录注册、发现探索与搜索。</p>
<div class="hero-meta">
<span><span class="dot" style="background:var(--accent)"></span>温暖治愈风</span>
<span><span class="dot" style="background:var(--secondary)"></span>iOS / Android / iPad / Desktop</span>
<span><span class="dot" style="background:var(--tertiary)"></span>27 页面 · 3 终端</span>
<span><span class="dot" style="background:var(--rose)"></span>学生向</span>
</div>
</header>
<!-- Platform tabs -->
<div class="platform-tabs" style="margin-top:-20px; position:relative; z-index:10">
<button class="platform-tab active" onclick="switchPlatform('mobile', this)">手机端</button>
<button class="platform-tab" onclick="switchPlatform('tablet', this)">平板端</button>
<button class="platform-tab" onclick="switchPlatform('desktop', this)">桌面端</button>
</div>
<!-- Mobile Screens -->
<section class="section platform-section active" id="mobile-section">
<div class="section-title">手机端 · 14个页面</div>
<div class="section-desc">iOS / Android — 从启动到日常使用的完整流程,含登录注册、发现探索、搜索筛选</div>
<div class="screen-gallery" id="gallery">
<div class="screen-card">
<div class="screen-frame"><iframe src="screens/splash.html" loading="lazy"></iframe></div>
<div class="screen-label"><div class="name">启动页</div><div class="desc">品牌展示 · 进入引导</div></div>
</div>
<div class="screen-card">
<div class="screen-frame"><iframe src="screens/onboarding.html" loading="lazy"></iframe></div>
<div class="screen-label"><div class="name">引导页</div><div class="desc">3步了解核心功能</div></div>
</div>
<div class="screen-card">
<div class="screen-frame"><iframe src="screens/home-daily.html" loading="lazy"></iframe></div>
<div class="screen-label"><div class="name">首页 · 日记流</div><div class="desc">心情 · 今日日记 · 历史</div></div>
</div>
<div class="screen-card">
<div class="screen-frame"><iframe src="screens/editor.html" loading="lazy"></iframe></div>
<div class="screen-label"><div class="name">手账编辑器</div><div class="desc">文字 · 贴纸 · 画笔 · 照片</div></div>
</div>
<div class="screen-card">
<div class="screen-frame"><iframe src="screens/calendar.html" loading="lazy"></iframe></div>
<div class="screen-label"><div class="name">日历视图</div><div class="desc">月历 · 心情 · 时间轴</div></div>
</div>
<div class="screen-card">
<div class="screen-frame"><iframe src="screens/mood-tracker.html" loading="lazy"></iframe></div>
<div class="screen-label"><div class="name">心情追踪</div><div class="desc">心情趋势 · 天气 · 洞察</div></div>
</div>
<div class="screen-card">
<div class="screen-frame"><iframe src="screens/stickers.html" loading="lazy"></iframe></div>
<div class="screen-label"><div class="name">贴纸素材库</div><div class="desc">分类浏览 · 素材包 · 收藏</div></div>
</div>
<div class="screen-card">
<div class="screen-frame"><iframe src="screens/templates.html" loading="lazy"></iframe></div>
<div class="screen-label"><div class="name">模板画廊</div><div class="desc">日/周/月视图模板</div></div>
</div>
<div class="screen-card">
<div class="screen-frame"><iframe src="screens/weekly.html" loading="lazy"></iframe></div>
<div class="screen-label"><div class="name">周概览</div><div class="desc">一周七天 · 总结统计</div></div>
</div>
<div class="screen-card">
<div class="screen-frame"><iframe src="screens/monthly.html" loading="lazy"></iframe></div>
<div class="screen-label"><div class="name">月度概览</div><div class="desc">心情色彩日历 · 精选</div></div>
</div>
<div class="screen-card">
<div class="screen-frame"><iframe src="screens/profile.html" loading="lazy"></iframe></div>
<div class="screen-label"><div class="name">个人中心</div><div class="desc">成就 · 设置 · 同步</div></div>
</div>
<div class="screen-card">
<div class="screen-frame"><iframe src="screens/login.html" loading="lazy"></iframe></div>
<div class="screen-label"><div class="name">登录/注册</div><div class="desc">手机号+社交登录+注册切换</div></div>
</div>
<div class="screen-card">
<div class="screen-frame"><iframe src="screens/discover.html" loading="lazy"></iframe></div>
<div class="screen-label"><div class="name">发现页</div><div class="desc">搜索+热门话题+精选模板+达人日记</div></div>
</div>
<div class="screen-card">
<div class="screen-frame"><iframe src="screens/search.html" loading="lazy"></iframe></div>
<div class="screen-label"><div class="name">搜索结果</div><div class="desc">搜索历史+结果分类筛选</div></div>
</div>
</div>
</section>
<!-- Tablet Screens -->
<section class="section platform-section" id="tablet-section">
<div class="section-title">平板端 · 6个页面</div>
<div class="section-desc">iPad 1024×768 — 侧边栏导航 + 双列布局 + 分栏编辑器 + 登录注册 + 发现搜索</div>
<div class="screen-gallery">
<div class="tablet-card">
<div class="tablet-frame"><iframe src="screens/tablet/home-daily.html" loading="lazy"></iframe></div>
<div class="screen-label"><div class="name">首页日记流</div><div class="desc">侧边栏 + 双列内容 + 心情选择</div></div>
</div>
<div class="tablet-card">
<div class="tablet-frame"><iframe src="screens/tablet/editor.html" loading="lazy"></iframe></div>
<div class="screen-label"><div class="name">手账编辑器</div><div class="desc">宽画布 + 右侧贴纸面板</div></div>
</div>
<div class="tablet-card">
<div class="tablet-frame"><iframe src="screens/tablet/calendar.html" loading="lazy"></iframe></div>
<div class="screen-label"><div class="name">日历视图</div><div class="desc">月历 + 时间轴双栏并排</div></div>
</div>
<div class="tablet-card">
<div class="tablet-frame"><iframe src="screens/tablet/login.html" loading="lazy"></iframe></div>
<div class="screen-label"><div class="name">登录/注册</div><div class="desc">宽屏双栏登录 + 社交账号</div></div>
</div>
<div class="tablet-card">
<div class="tablet-frame"><iframe src="screens/tablet/discover.html" loading="lazy"></iframe></div>
<div class="screen-label"><div class="name">发现页</div><div class="desc">热门话题 + 精选模板 + 达人日记</div></div>
</div>
<div class="tablet-card">
<div class="tablet-frame"><iframe src="screens/tablet/search.html" loading="lazy"></iframe></div>
<div class="screen-label"><div class="name">搜索结果</div><div class="desc">搜索历史 + 结果分类筛选</div></div>
</div>
</div>
</section>
<!-- Desktop Screens -->
<section class="section platform-section" id="desktop-section">
<div class="section-title">桌面端 · 6个页面</div>
<div class="section-desc">1440×900 — 固定侧边栏 + 多列布局 + 高信息密度 + 登录注册 + 发现搜索</div>
<div class="screen-gallery">
<div class="desktop-card">
<div class="desktop-frame"><iframe src="screens/desktop/home-daily.html" loading="lazy"></iframe></div>
<div class="screen-label"><div class="name">首页日记流</div><div class="desc">侧边栏 + 日记流 + 心情/统计面板</div></div>
</div>
<div class="desktop-card">
<div class="desktop-frame"><iframe src="screens/desktop/editor.html" loading="lazy"></iframe></div>
<div class="screen-label"><div class="name">手账编辑器</div><div class="desc">工具条 + 全宽画布 + 右侧属性面板</div></div>
</div>
<div class="desktop-card">
<div class="desktop-frame"><iframe src="screens/desktop/calendar.html" loading="lazy"></iframe></div>
<div class="screen-label"><div class="name">日历视图</div><div class="desc">统计 + 月历 + 日记详情三栏</div></div>
</div>
<div class="desktop-card">
<div class="desktop-frame"><iframe src="screens/desktop/login.html" loading="lazy"></iframe></div>
<div class="screen-label"><div class="name">登录/注册</div><div class="desc">桌面端全屏登录 + 社交账号</div></div>
</div>
<div class="desktop-card">
<div class="desktop-frame"><iframe src="screens/desktop/discover.html" loading="lazy"></iframe></div>
<div class="screen-label"><div class="name">发现页</div><div class="desc">热门话题 + 精选模板 + 达人日记</div></div>
</div>
<div class="desktop-card">
<div class="desktop-frame"><iframe src="screens/desktop/search.html" loading="lazy"></iframe></div>
<div class="screen-label"><div class="name">搜索结果</div><div class="desc">搜索历史 + 结果分类筛选</div></div>
</div>
</div>
</section>
<!-- Design Tokens -->
<section class="section">
<div class="section-title">视觉系统</div>
<div class="section-desc">暖记的色彩体系与排版规则</div>
<div class="tokens-section">
<div class="token-card">
<div class="token-swatch" style="background:#FFF8F0;border:1px solid #E8DDD4"></div>
<div class="token-name">Background</div>
<div class="token-value">#FFF8F0</div>
</div>
<div class="token-card">
<div class="token-swatch" style="background:#E07A5F"></div>
<div class="token-name">Accent</div>
<div class="token-value">#E07A5F</div>
</div>
<div class="token-card">
<div class="token-swatch" style="background:#81B29A"></div>
<div class="token-name">Secondary</div>
<div class="token-value">#81B29A</div>
</div>
<div class="token-card">
<div class="token-swatch" style="background:#F2CC8F"></div>
<div class="token-name">Tertiary</div>
<div class="token-value">#F2CC8F</div>
</div>
<div class="token-card">
<div class="token-swatch" style="background:#D4A5A5"></div>
<div class="token-name">Rose</div>
<div class="token-value">#D4A5A5</div>
</div>
<div class="token-card">
<div class="token-swatch" style="background:#2D2420"></div>
<div class="token-name">Foreground</div>
<div class="token-value">#2D2420</div>
</div>
<div class="token-card">
<div class="token-swatch" style="background:#8B7E74"></div>
<div class="token-name">Muted</div>
<div class="token-value">#8B7E74</div>
</div>
<div class="token-card">
<div class="token-swatch" style="background:#E8DDD4"></div>
<div class="token-name">Border</div>
<div class="token-value">#E8DDD4</div>
</div>
</div>
</section>
<!-- Footer -->
<footer>
<p>暖记 Warm Notes — 多终端手账日记App设计稿</p>
<p style="margin-top:8px">27 页面 · 手机 14 + 平板 6 + 桌面 6 · 温暖治愈视觉系统</p>
</footer>
<script>
function switchPlatform(platform, btn) {
document.querySelectorAll('.platform-section').forEach(s => s.classList.remove('active'));
document.querySelectorAll('.platform-tab').forEach(t => t.classList.remove('active'));
document.getElementById(platform + '-section').classList.add('active');
btn.classList.add('active');
}
</script>
<script src="js/theme-switcher.js"></script>
</body>
</html>

View File

@@ -0,0 +1,103 @@
/* ─────────────────────────────────────────────────────────
* 暖记 Theme Switcher
* Handles theme toggling + localStorage persistence
* ───────────────────────────────────────────────────────── */
(function () {
var THEMES = [
{ id: 'warm', name: '暖阳', swatch: '#E07A5F' },
{ id: 'pine', name: '松风', swatch: '#4A7B9D' }
];
var STORAGE_KEY = 'warmnotes-theme';
function getCurrent() {
return localStorage.getItem(STORAGE_KEY) || 'warm';
}
function apply(id) {
if (id === 'warm') {
document.documentElement.removeAttribute('data-theme');
} else {
document.documentElement.setAttribute('data-theme', id);
}
localStorage.setItem(STORAGE_KEY, id);
}
function cycle() {
var cur = getCurrent();
var idx = 0;
for (var i = 0; i < THEMES.length; i++) {
if (THEMES[i].id === cur) { idx = i; break; }
}
var next = THEMES[(idx + 1) % THEMES.length];
apply(next.id);
updateBtn(next);
}
function updateBtn(theme) {
var btn = document.getElementById('theme-toggle-btn');
if (!btn) return;
var dot = btn.querySelector('.theme-dot');
var label = btn.querySelector('.theme-label');
if (dot) dot.style.background = theme.swatch;
if (label) label.textContent = theme.name;
btn.setAttribute('aria-label', 'Switch theme (current: ' + theme.name + ')');
}
// Apply stored theme immediately (prevent flash)
var saved = getCurrent();
apply(saved);
// Wait for DOM then inject toggle button
function init() {
if (document.getElementById('theme-toggle-btn')) return;
var cur = THEMES.filter(function (t) { return t.id === saved; })[0] || THEMES[0];
var wrap = document.createElement('div');
wrap.id = 'theme-toggle-btn';
wrap.setAttribute('role', 'button');
wrap.setAttribute('tabindex', '0');
wrap.setAttribute('aria-label', 'Switch theme (current: ' + cur.name + ')');
wrap.onclick = function () { saved = getCurrent(); cycle(); };
wrap.onkeydown = function (e) { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); cycle(); } };
var style = document.createElement('style');
style.textContent = '\
#theme-toggle-btn{position:fixed;top:8px;right:8px;z-index:10000;display:flex;align-items:center;gap:6px;\
padding:5px 12px 5px 8px;border-radius:20px;border:1px solid var(--border);\
background:var(--surface);color:var(--fg);font-size:11px;font-family:var(--font-body);\
cursor:pointer;box-shadow:var(--elev-medium);transition:all .2s ease;user-select:none;line-height:1;}\
#theme-toggle-btn:hover{box-shadow:var(--elev-float);}\
#theme-toggle-btn:focus-visible{outline:none;box-shadow:var(--focus-ring);}\
.theme-dot{width:14px;height:14px;border-radius:50%;flex-shrink:0;border:1.5px solid var(--border);}\
.theme-label{white-space:nowrap;font-weight:600;}';
document.head.appendChild(style);
var dot = document.createElement('span');
dot.className = 'theme-dot';
dot.style.background = cur.swatch;
var label = document.createElement('span');
label.className = 'theme-label';
label.textContent = cur.name;
wrap.appendChild(dot);
wrap.appendChild(label);
document.body.appendChild(wrap);
}
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', init);
} else {
init();
}
// Cross-tab sync
window.addEventListener('storage', function (e) {
if (e.key === STORAGE_KEY && e.newValue) {
apply(e.newValue);
var t = THEMES.filter(function (th) { return th.id === e.newValue; })[0] || THEMES[0];
updateBtn(t);
}
});
})();

View File

@@ -0,0 +1,514 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=390, height=844, initial-scale=1, viewport-fit=cover">
<title>暖记 — 日历视图</title>
<link href="https://fonts.googleapis.com/css2?family=Caveat:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="../css/tokens.css">
<link rel="stylesheet" href="../css/components.css">
<style>
body {
width: 390px;
height: 844px;
overflow: hidden;
background: var(--bg);
position: relative;
}
/* Global focus styles */
button:focus-visible, a:focus-visible, [role="tab"]:focus-visible {
box-shadow: 0 0 0 3px var(--focus-ring);
outline: none;
}
.content-area {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: calc(var(--tab-height) + var(--safe-bottom));
overflow-y: auto;
padding: 0 var(--space-5);
padding-top: calc(var(--safe-top) + var(--space-2));
scrollbar-width: none;
}
.content-area::-webkit-scrollbar { display: none; }
/* Month header */
.month-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: var(--space-5);
}
.month-title {
font-family: var(--font-display);
font-size: var(--text-2xl);
font-weight: 700;
}
.month-nav {
display: flex;
gap: var(--space-2);
}
.month-nav button {
min-width: 44px;
min-height: 44px;
border-radius: 50%;
border: 1.5px solid var(--border);
background: var(--surface);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
color: var(--fg);
transition: all var(--motion-fast);
}
.month-nav button:hover { border-color: var(--accent); color: var(--accent); }
.month-nav button svg { width: 18px; height: 18px; }
/* View toggle */
.view-toggle {
display: flex;
background: var(--surface);
border-radius: var(--radius-pill);
padding: 3px;
margin-bottom: var(--space-5);
border: 1px solid var(--border-soft);
}
.view-toggle button {
flex: 1;
padding: 8px 0;
min-height: 44px;
border: none;
border-radius: var(--radius-pill);
background: transparent;
font-size: var(--text-sm);
font-weight: 500;
color: var(--muted);
cursor: pointer;
transition: all var(--motion-fast);
}
.view-toggle button.active {
background: var(--accent);
color: var(--accent-on);
box-shadow: var(--elev-soft);
}
/* Calendar grid */
.weekday-row {
display: grid;
grid-template-columns: repeat(7, 1fr);
text-align: center;
margin-bottom: var(--space-2);
}
.weekday-row span {
font-size: var(--text-xs);
color: var(--meta);
font-weight: 500;
}
.calendar-grid {
display: grid;
grid-template-columns: repeat(7, 1fr);
gap: 4px;
margin-bottom: var(--space-6);
}
.cal-day {
aspect-ratio: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
border-radius: var(--radius-sm);
cursor: pointer;
position: relative;
transition: all var(--motion-fast);
background: transparent;
border: none;
font-size: var(--text-sm);
color: var(--fg);
gap: 2px;
min-height: 44px;
}
.cal-day:hover { background: var(--surface-warm); }
.cal-day.empty { cursor: default; }
.cal-day.empty:hover { background: transparent; }
.cal-day.other-month { color: var(--meta); }
.cal-day.today {
background: var(--accent);
color: var(--accent-on);
font-weight: 700;
border-radius: var(--radius-sm);
}
.cal-day.selected {
background: var(--surface-warm);
border: 2px solid var(--accent);
}
.cal-day.today.selected {
background: var(--accent);
border: 2px solid var(--accent);
}
.mood-dot {
width: 6px;
height: 6px;
border-radius: 50%;
position: absolute;
bottom: 4px;
}
.mood-dot.happy { background: var(--secondary); }
.mood-dot.love { background: var(--accent); }
.mood-dot.calm { background: var(--tertiary); }
.mood-dot.sad { background: #5B7DB1; }
.mood-dot.tired { background: #8B7E74; }
/* Entry indicator dot */
.entry-indicator {
position: absolute;
top: 3px;
right: 5px;
width: 5px;
height: 5px;
border-radius: 50%;
background: var(--accent);
}
.cal-day.today .entry-indicator { background: var(--accent-on); }
/* Timeline section */
.timeline-section {
margin-top: var(--space-2);
}
.timeline-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: var(--space-4);
}
.timeline-header h3 {
font-family: var(--font-display);
font-size: var(--text-lg);
font-weight: 700;
}
.timeline-count {
font-size: var(--text-sm);
color: var(--muted);
}
.timeline-item {
display: flex;
gap: var(--space-4);
margin-bottom: var(--space-4);
position: relative;
}
.timeline-line {
width: 2px;
background: var(--border);
position: absolute;
left: 19px;
top: 36px;
bottom: -16px;
}
.timeline-item:last-child .timeline-line { display: none; }
.timeline-dot {
width: 40px;
height: 40px;
border-radius: 50%;
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
font-size: 18px;
background: var(--surface);
border: 2px solid var(--border-soft);
position: relative;
z-index: 1;
}
.timeline-content {
flex: 1;
background: var(--surface);
border-radius: var(--radius-md);
padding: var(--space-4);
box-shadow: var(--elev-soft);
border: 1px solid var(--border-soft);
cursor: pointer;
transition: transform var(--motion-fast);
}
.timeline-content:hover { transform: translateY(-1px); }
.tl-time {
font-size: var(--text-xs);
color: var(--muted);
margin-bottom: 4px;
}
.tl-title {
font-family: var(--font-display);
font-size: var(--text-base);
font-weight: 600;
color: var(--fg);
margin-bottom: 4px;
}
.tl-excerpt {
font-size: var(--text-sm);
color: var(--muted);
line-height: 1.5;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
/* Mood summary */
.mood-summary {
background: var(--surface);
border-radius: var(--radius-md);
padding: var(--space-5);
margin-bottom: var(--space-5);
box-shadow: var(--elev-soft);
border: 1px solid var(--border-soft);
}
.mood-summary h4 {
font-family: var(--font-display);
font-size: var(--text-base);
font-weight: 600;
margin-bottom: var(--space-4);
color: var(--fg);
}
.mood-bar-chart {
display: flex;
align-items: flex-end;
gap: var(--space-3);
height: 80px;
margin-bottom: var(--space-3);
}
.mood-bar {
flex: 1;
border-radius: 6px 6px 0 0;
display: flex;
align-items: flex-end;
justify-content: center;
padding-bottom: 4px;
font-size: 16px;
transition: height var(--motion-base) var(--ease-bounce);
}
.mood-labels {
display: flex;
gap: var(--space-3);
}
.mood-labels span {
flex: 1;
text-align: center;
font-size: 11px;
color: var(--muted);
}
/* Empty state for no entries on a day */
.empty-day {
display: none; /* Shown via JS when no entries exist */
flex-direction: column;
align-items: center;
justify-content: center;
padding: var(--space-8) var(--space-5);
text-align: center;
}
.empty-day .empty-circle {
width: 64px;
height: 64px;
border-radius: 50%;
border: 2px dashed var(--border);
display: flex;
align-items: center;
justify-content: center;
margin-bottom: var(--space-3);
font-size: 24px;
opacity: 0.6;
}
.empty-day .empty-text {
font-size: var(--text-base);
color: var(--muted);
font-weight: 500;
margin-bottom: var(--space-2);
}
.empty-day .empty-hint {
font-size: var(--text-sm);
color: var(--meta);
}
</style>
</head>
<body>
<div class="content-area">
<!-- Month header -->
<div class="month-header anim-fade">
<div class="month-title">2026年5月</div>
<div class="month-nav">
<button aria-label="上个月"><svg viewBox="0 0 18 18" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M11 14l-5-5 5-5"/></svg></button>
<button aria-label="下个月"><svg viewBox="0 0 18 18" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M7 4l5 5-5 5"/></svg></button>
</div>
</div>
<!-- View toggle -->
<div class="view-toggle anim-fade" style="animation-delay: 0.1s" role="tablist">
<button class="active" role="tab" aria-label="月视图" aria-selected="true">月视图</button>
<button role="tab" aria-label="周视图" aria-selected="false">周视图</button>
<button role="tab" aria-label="时间轴" aria-selected="false">时间轴</button>
</div>
<!-- Mood summary - using standardized 5 moods -->
<div class="mood-summary anim-fade" style="animation-delay: 0.15s">
<h4>本月心情概览</h4>
<div class="mood-bar-chart">
<div class="mood-bar" style="height:65%;background:var(--secondary)">😊</div>
<div class="mood-bar" style="height:45%;background:var(--tertiary)">😐</div>
<div class="mood-bar" style="height:20%;background:#5B7DB1">😢</div>
<div class="mood-bar" style="height:10%;background:var(--accent)">😡</div>
<div class="mood-bar" style="height:15%;background:#8B7E74">🤔</div>
</div>
<div class="mood-labels">
<span>开心 12天</span>
<span>平静 8天</span>
<span>难过 2天</span>
<span>生气 1天</span>
<span>思考 3天</span>
</div>
</div>
<!-- Weekday row -->
<div class="weekday-row anim-fade" style="animation-delay: 0.2s" aria-hidden="true">
<span></span><span></span><span></span><span></span><span></span><span></span><span></span>
</div>
<!-- Calendar grid -->
<div class="calendar-grid anim-fade" style="animation-delay: 0.25s">
<!-- Row 1: May starts on Friday -->
<div class="cal-day empty"></div>
<div class="cal-day empty"></div>
<div class="cal-day empty"></div>
<div class="cal-day empty"></div>
<div class="cal-day empty"></div>
<div class="cal-day" data-day="1"><span>1</span><div class="mood-dot happy"></div></div>
<div class="cal-day" data-day="2"><span>2</span><div class="mood-dot happy"></div><div class="entry-indicator"></div></div>
<!-- Row 2 -->
<div class="cal-day" data-day="3"><span>3</span><div class="mood-dot calm"></div></div>
<div class="cal-day" data-day="4"><span>4</span><div class="mood-dot love"></div><div class="entry-indicator"></div></div>
<div class="cal-day" data-day="5"><span>5</span><div class="mood-dot happy"></div><div class="entry-indicator"></div></div>
<div class="cal-day" data-day="6"><span>6</span><div class="mood-dot happy"></div></div>
<div class="cal-day" data-day="7"><span>7</span><div class="mood-dot tired"></div><div class="entry-indicator"></div></div>
<div class="cal-day" data-day="8"><span>8</span><div class="mood-dot happy"></div></div>
<div class="cal-day" data-day="9"><span>9</span><div class="mood-dot love"></div><div class="entry-indicator"></div></div>
<!-- Row 3 -->
<div class="cal-day" data-day="10"><span>10</span><div class="mood-dot calm"></div></div>
<div class="cal-day" data-day="11"><span>11</span><div class="mood-dot happy"></div><div class="entry-indicator"></div></div>
<div class="cal-day" data-day="12"><span>12</span><div class="mood-dot tired"></div></div>
<div class="cal-day" data-day="13"><span>13</span><div class="mood-dot happy"></div><div class="entry-indicator"></div></div>
<div class="cal-day" data-day="14"><span>14</span><div class="mood-dot love"></div><div class="entry-indicator"></div></div>
<div class="cal-day" data-day="15"><span>15</span><div class="mood-dot calm"></div></div>
<div class="cal-day" data-day="16"><span>16</span><div class="mood-dot happy"></div><div class="entry-indicator"></div></div>
<!-- Row 4 -->
<div class="cal-day" data-day="17"><span>17</span><div class="mood-dot sad"></div><div class="entry-indicator"></div></div>
<div class="cal-day" data-day="18"><span>18</span><div class="mood-dot calm"></div></div>
<div class="cal-day" data-day="19"><span>19</span><div class="mood-dot happy"></div><div class="entry-indicator"></div></div>
<div class="cal-day" data-day="20"><span>20</span><div class="mood-dot happy"></div><div class="entry-indicator"></div></div>
<div class="cal-day" data-day="21"><span>21</span><div class="mood-dot love"></div><div class="entry-indicator"></div></div>
<div class="cal-day" data-day="22"><span>22</span><div class="mood-dot tired"></div></div>
<div class="cal-day" data-day="23"><span>23</span><div class="mood-dot happy"></div><div class="entry-indicator"></div></div>
<!-- Row 5 -->
<div class="cal-day" data-day="24"><span>24</span><div class="mood-dot happy"></div><div class="entry-indicator"></div></div>
<div class="cal-day" data-day="25"><span>25</span><div class="mood-dot calm"></div></div>
<div class="cal-day" data-day="26"><span>26</span><div class="mood-dot love"></div><div class="entry-indicator"></div></div>
<div class="cal-day" data-day="27"><span>27</span><div class="mood-dot happy"></div><div class="entry-indicator"></div></div>
<div class="cal-day" data-day="28"><span>28</span><div class="mood-dot happy"></div><div class="entry-indicator"></div></div>
<div class="cal-day" data-day="29"><span>29</span><div class="mood-dot love"></div><div class="entry-indicator"></div></div>
<div class="cal-day" data-day="30"><span>30</span><div class="mood-dot happy"></div><div class="entry-indicator"></div></div>
<!-- Row 6 -->
<div class="cal-day today selected" data-day="31"><span>31</span><div class="mood-dot love" style="background:var(--accent-on)"></div></div>
</div>
<!-- Today's timeline -->
<div class="timeline-section">
<div class="timeline-header">
<h3>5月31日 · 今天</h3>
<span class="timeline-count">3条记录</span>
</div>
<div class="timeline-item">
<div class="timeline-line" aria-hidden="true"></div>
<div class="timeline-dot" aria-hidden="true">😊</div>
<div class="timeline-content">
<div class="tl-time">14:30 · 心情: 开心</div>
<div class="tl-title">图书馆的午后时光</div>
<div class="tl-excerpt">今天下午去图书馆自习,阳光从窗外洒进来,暖暖的...</div>
</div>
</div>
<div class="timeline-item">
<div class="timeline-line" aria-hidden="true"></div>
<div class="timeline-dot" aria-hidden="true">😊</div>
<div class="timeline-content">
<div class="tl-time">09:15 · 心情: 开心</div>
<div class="tl-title">周末早起的奖励</div>
<div class="tl-excerpt">难得周末早起,去食堂吃了喜欢的豆浆油条,还买了一束花...</div>
</div>
</div>
<div class="timeline-item">
<div class="timeline-line" aria-hidden="true"></div>
<div class="timeline-dot" aria-hidden="true">😐</div>
<div class="timeline-content">
<div class="tl-time">07:00 · 心情: 平静</div>
<div class="tl-title">晨跑记录</div>
<div class="tl-excerpt">早起跑了两圈操场,空气很清新。看到有人在遛小狗...</div>
</div>
</div>
</div>
<!-- Empty state for no entries on a day (hidden by default) -->
<div class="empty-day" id="emptyDay">
<div class="empty-circle">📝</div>
<div class="empty-text">这一天没有记录</div>
<div class="empty-hint">点击 + 开始记录这一天的心情和故事</div>
</div>
<div style="height: var(--space-8)"></div>
</div>
<!-- Tab bar -->
<nav class="tab-bar" role="tablist">
<button class="tab-item" role="tab" aria-label="首页" aria-selected="false">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M3 9l9-7 9 7v11a2 2 0 01-2 2H5a2 2 0 01-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/></svg>
<span>首页</span>
</button>
<button class="tab-item active" role="tab" aria-label="日历" aria-selected="true">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><rect x="3" y="4" width="18" height="18" rx="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg>
<span>日历</span>
</button>
<button class="tab-item" role="tab" aria-label="写日记" aria-selected="false" style="position:relative">
<div style="width:44px;height:44px;border-radius:50%;background:var(--accent);display:flex;align-items:center;justify-content:center;margin-top:-16px;box-shadow:0 4px 12px var(--shadow-accent)">
<svg viewBox="0 0 24 24" fill="none" stroke-width="2.5" stroke-linecap="round" style="width:22px;height:22px;stroke:var(--accent-on)" aria-hidden="true"><path d="M12 5v14M5 12h14"/></svg>
</div>
<span style="margin-top:2px">写日记</span>
</button>
<button class="tab-item" role="tab" aria-label="发现" aria-selected="false">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
<span>发现</span>
</button>
<button class="tab-item" role="tab" aria-label="我的" aria-selected="false">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2"/><circle cx="12" cy="7" r="4"/></svg>
<span>我的</span>
</button>
</nav>
<div class="dynamic-island" aria-hidden="true"></div>
<div class="home-indicator" style="position:absolute;bottom:8px;left:50%;transform:translateX(-50%);z-index:101" aria-hidden="true"></div>
<script src="../js/theme-switcher.js"></script>
</body>
</html>

View File

@@ -0,0 +1,629 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=1440, height=900, initial-scale=1">
<title>暖记 — 桌面端日历</title>
<link rel="stylesheet" href="../css/tokens.css">
<link rel="stylesheet" href="../css/components.css">
<link rel="stylesheet" href="shared.css">
<style>
body {
width: 1440px;
height: 900px;
overflow: hidden;
background: var(--bg);
font-family: var(--font-body);
}
.cal-layout {
display: flex;
height: 900px;
padding-top: 32px;
}
.sidebar { position: relative; flex-shrink: 0; }
.cal-main {
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
}
/* Top bar */
.cal-topbar {
height: 56px;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 var(--space-8);
background: var(--surface);
border-bottom: 1px solid var(--border-soft);
flex-shrink: 0;
}
.cal-topbar-left {
display: flex;
align-items: center;
gap: var(--space-5);
}
.cal-topbar-title {
font-family: var(--font-display);
font-size: var(--text-xl);
font-weight: 700;
}
.cal-nav {
display: flex;
gap: var(--space-2);
}
.cal-nav button {
width: 34px;
height: 34px;
border-radius: 50%;
border: 1.5px solid var(--border);
background: var(--surface);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
color: var(--fg);
transition: all var(--motion-fast);
}
.cal-nav button:hover { border-color: var(--accent); color: var(--accent); }
.cal-nav button svg { width: 16px; height: 16px; }
.cal-month-label {
font-size: var(--text-md);
color: var(--fg-2);
font-weight: 500;
}
.view-toggle {
display: flex;
background: var(--surface-warm);
border-radius: var(--radius-pill);
padding: 3px;
border: 1px solid var(--border-soft);
}
.view-toggle button {
padding: 7px 20px;
border: none;
border-radius: var(--radius-pill);
background: transparent;
font-size: var(--text-sm);
font-weight: 500;
color: var(--muted);
cursor: pointer;
transition: all var(--motion-fast);
}
.view-toggle button.active {
background: var(--accent);
color: var(--accent-on);
box-shadow: var(--elev-soft);
}
/* Three-column body */
.cal-body {
flex: 1;
display: flex;
overflow: hidden;
}
/* Left: mini stats */
.cal-left-panel {
width: 280px;
background: var(--surface);
border-right: 1px solid var(--border-soft);
overflow-y: auto;
scrollbar-width: thin;
flex-shrink: 0;
padding: var(--space-6);
}
.cal-left-panel::-webkit-scrollbar { width: 4px; }
.cal-left-panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.mini-stats {
margin-bottom: var(--space-6);
}
.mini-stats h4 {
font-family: var(--font-display);
font-size: var(--text-base);
font-weight: 600;
margin-bottom: var(--space-4);
color: var(--fg);
}
.mini-stat-row {
display: flex;
align-items: center;
gap: var(--space-3);
padding: var(--space-3) 0;
border-bottom: 1px solid var(--border-soft);
}
.mini-stat-row:last-child { border-bottom: none; }
.mini-stat-icon { font-size: 20px; }
.mini-stat-info { flex: 1; }
.mini-stat-value {
font-family: var(--font-display);
font-size: var(--text-md);
font-weight: 700;
}
.mini-stat-label {
font-size: var(--text-xs);
color: var(--muted);
}
.mood-summary-mini {
margin-bottom: var(--space-6);
}
.mood-summary-mini h4 {
font-family: var(--font-display);
font-size: var(--text-base);
font-weight: 600;
margin-bottom: var(--space-4);
}
.mood-bar-chart {
display: flex;
align-items: flex-end;
gap: var(--space-4);
height: 80px;
margin-bottom: var(--space-3);
}
.mood-bar {
flex: 1;
border-radius: 6px 6px 0 0;
display: flex;
align-items: flex-end;
justify-content: center;
padding-bottom: 4px;
font-size: 14px;
}
.mood-labels {
display: flex;
gap: var(--space-3);
}
.mood-labels span {
flex: 1;
text-align: center;
font-size: 10px;
color: var(--muted);
}
/* Quick tags */
.tag-list { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.tag-item {
padding: 5px 12px;
border-radius: var(--radius-pill);
font-size: var(--text-xs);
font-weight: 500;
background: var(--surface-warm);
color: var(--fg-2);
border: 1px solid var(--border-soft);
cursor: pointer;
transition: all var(--motion-fast);
}
.tag-item:hover { border-color: var(--accent); color: var(--accent); }
/* Center: calendar grid */
.cal-center {
flex: 1;
padding: var(--space-6);
overflow-y: auto;
scrollbar-width: thin;
scrollbar-color: var(--border) transparent;
}
.cal-center::-webkit-scrollbar { width: 4px; }
.cal-center::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.weekday-row {
display: grid;
grid-template-columns: repeat(7, 1fr);
text-align: center;
margin-bottom: var(--space-2);
}
.weekday-row span {
font-size: var(--text-xs);
color: var(--meta);
font-weight: 500;
padding: var(--space-2);
}
.calendar-grid {
display: grid;
grid-template-columns: repeat(7, 1fr);
gap: 4px;
}
.cal-day {
aspect-ratio: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
border-radius: var(--radius-sm);
cursor: pointer;
position: relative;
transition: all var(--motion-fast);
background: transparent;
border: none;
font-size: var(--text-md);
color: var(--fg);
gap: 2px;
}
.cal-day:hover { background: var(--surface-warm); }
.cal-day.empty { cursor: default; }
.cal-day.empty:hover { background: transparent; }
.cal-day.today {
background: var(--accent);
color: var(--accent-on);
font-weight: 700;
}
.cal-day.selected {
background: var(--surface-warm);
border: 2px solid var(--accent);
}
.cal-day.today.selected { background: var(--accent); border: 2px solid var(--accent); }
.mood-dot {
width: 7px;
height: 7px;
border-radius: 50%;
position: absolute;
bottom: 5px;
}
.mood-dot.happy { background: var(--secondary); }
.mood-dot.love { background: var(--accent); }
.mood-dot.calm { background: var(--tertiary); }
.mood-dot.sad { background: #5B7DB1; }
.mood-dot.tired { background: #8B7E74; }
.entry-indicator {
position: absolute;
top: 4px;
right: 6px;
width: 5px;
height: 5px;
border-radius: 50%;
background: var(--accent);
}
.cal-day.today .entry-indicator { background: var(--accent-on); }
/* Right: timeline detail */
.cal-right-panel {
width: 360px;
background: var(--surface);
border-left: 1px solid var(--border-soft);
overflow-y: auto;
scrollbar-width: thin;
flex-shrink: 0;
padding: var(--space-6);
}
.cal-right-panel::-webkit-scrollbar { width: 4px; }
.cal-right-panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.detail-title {
font-family: var(--font-display);
font-size: var(--text-xl);
font-weight: 700;
margin-bottom: var(--space-1);
}
.detail-date {
font-size: var(--text-sm);
color: var(--muted);
margin-bottom: var(--space-6);
}
.detail-count {
font-size: var(--text-sm);
color: var(--accent);
font-weight: 500;
}
.timeline-item {
display: flex;
gap: var(--space-3);
margin-bottom: var(--space-5);
position: relative;
}
.timeline-line {
width: 2px;
background: var(--border);
position: absolute;
left: 18px;
top: 42px;
bottom: -16px;
}
.timeline-item:last-child .timeline-line { display: none; }
.timeline-dot {
width: 38px;
height: 38px;
border-radius: 50%;
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
font-size: 18px;
background: var(--bg);
border: 2px solid var(--border-soft);
position: relative;
z-index: 1;
}
.timeline-content {
flex: 1;
background: var(--bg);
border-radius: var(--radius-md);
padding: var(--space-4);
border: 1px solid var(--border-soft);
cursor: pointer;
transition: transform var(--motion-fast);
}
.timeline-content:hover { transform: translateY(-1px); box-shadow: var(--elev-soft); }
.tl-time {
font-size: var(--text-xs);
color: var(--muted);
margin-bottom: 4px;
}
.tl-title {
font-family: var(--font-display);
font-size: var(--text-md);
font-weight: 600;
color: var(--fg);
margin-bottom: 4px;
}
.tl-excerpt {
font-size: var(--text-sm);
color: var(--muted);
line-height: 1.5;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
}
.tl-tags {
display: flex;
gap: var(--space-1);
margin-top: var(--space-2);
}
.tl-tag {
padding: 2px 8px;
border-radius: var(--radius-pill);
font-size: 10px;
font-weight: 500;
background: var(--surface-warm);
color: var(--fg-2);
}
</style>
</head>
<body>
<div class="cal-layout">
<!-- Sidebar -->
<nav class="sidebar" role="navigation" aria-label="主导航">
<div class="sidebar-brand">
<div class="sidebar-logo">📖</div>
<div>
<div class="sidebar-brand-text">暖记</div>
<div class="sidebar-brand-sub">Warm Notes</div>
</div>
</div>
<div class="sidebar-nav">
<button class="sidebar-nav-item" aria-label="首页">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M3 9l9-7 9 7v11a2 2 0 01-2 2H5a2 2 0 01-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/></svg>
首页
</button>
<button class="sidebar-nav-item active" aria-label="日历">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><rect x="3" y="4" width="18" height="18" rx="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg>
日历
</button>
<button class="sidebar-nav-item" aria-label="心情追踪">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M20.84 4.61a5.5 5.5 0 00-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 00-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 000-7.78z"/></svg>
心情追踪
</button>
<button class="sidebar-nav-item" aria-label="贴纸库">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><rect x="3" y="3" width="18" height="18" rx="3"/><circle cx="9" cy="10" r="1.5" fill="currentColor"/><circle cx="15" cy="10" r="1.5" fill="currentColor"/><path d="M9 15c.8.8 2.2 1.2 3 1.2s2.2-.4 3-1.2"/></svg>
贴纸库
</button>
<button class="sidebar-nav-item" aria-label="模板">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><rect x="3" y="3" width="7" height="7" rx="1"/><rect x="14" y="3" width="7" height="7" rx="1"/><rect x="3" y="14" width="7" height="7" rx="1"/><rect x="14" y="14" width="7" height="7" rx="1"/></svg>
模板
</button>
<button class="sidebar-nav-item" aria-label="发现">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
发现
</button>
</div>
<button class="sidebar-write-btn" aria-label="写日记">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"><path d="M12 5v14M5 12h14"/></svg>
写日记
</button>
<div class="sidebar-footer">
<div class="sidebar-avatar">🐱</div>
<div>
<div class="sidebar-user-name">小暖</div>
<div class="sidebar-user-streak">连续记录 12 天</div>
</div>
</div>
</nav>
<main class="cal-main" role="main">
<!-- Top bar -->
<div class="cal-topbar">
<div class="cal-topbar-left">
<div class="cal-topbar-title">日历</div>
<div class="cal-nav">
<button aria-label="上一月"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M10 14l-5-5 5-5"/></svg></button>
<button aria-label="下一月"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M6 2l5 5-5 5"/></svg></button>
</div>
<span class="cal-month-label">2026年5月</span>
</div>
<div class="view-toggle">
<button class="active">月视图</button>
<button>周视图</button>
<button>时间轴</button>
</div>
</div>
<!-- Three-column body -->
<div class="cal-body">
<!-- Left: stats -->
<aside class="cal-left-panel" role="complementary" aria-label="月度统计">
<div class="mini-stats">
<h4>本月统计</h4>
<div class="mini-stat-row">
<span class="mini-stat-icon">📝</span>
<div class="mini-stat-info">
<div class="mini-stat-value" style="color:var(--accent)">28</div>
<div class="mini-stat-label">日记篇数</div>
</div>
</div>
<div class="mini-stat-row">
<span class="mini-stat-icon">🔥</span>
<div class="mini-stat-info">
<div class="mini-stat-value" style="color:var(--secondary)">12天</div>
<div class="mini-stat-label">最长连续</div>
</div>
</div>
<div class="mini-stat-row">
<span class="mini-stat-icon">😊</span>
<div class="mini-stat-info">
<div class="mini-stat-value">72%</div>
<div class="mini-stat-label">好心情占比</div>
</div>
</div>
<div class="mini-stat-row">
<span class="mini-stat-icon">📸</span>
<div class="mini-stat-info">
<div class="mini-stat-value">45</div>
<div class="mini-stat-label">添加照片</div>
</div>
</div>
</div>
<div class="mood-summary-mini">
<h4>心情分布</h4>
<div class="mood-bar-chart">
<div class="mood-bar" style="height:65%;background:var(--secondary)">😊</div>
<div class="mood-bar" style="height:45%;background:var(--accent)">🥰</div>
<div class="mood-bar" style="height:30%;background:var(--tertiary)">😌</div>
<div class="mood-bar" style="height:15%;background:#5B7DB1">😔</div>
<div class="mood-bar" style="height:20%;background:#8B7E74">😴</div>
</div>
<div class="mood-labels">
<span>12天</span><span>8天</span><span>5天</span><span>2天</span><span>3天</span>
</div>
</div>
<div>
<h4 style="font-family:var(--font-display);font-size:var(--text-base);font-weight:600;margin-bottom:var(--space-3)">常用标签</h4>
<div class="tag-list">
<span class="tag-item">学习</span>
<span class="tag-item">朋友</span>
<span class="tag-item">美食</span>
<span class="tag-item">运动</span>
<span class="tag-item">读书</span>
<span class="tag-item">旅行</span>
<span class="tag-item">心情</span>
</div>
</div>
</div>
<!-- Center: calendar -->
<div class="cal-center">
<div class="weekday-row">
<span>周日</span><span>周一</span><span>周二</span><span>周三</span><span>周四</span><span>周五</span><span>周六</span>
</div>
<div class="calendar-grid">
<div class="cal-day empty"></div><div class="cal-day empty"></div><div class="cal-day empty"></div><div class="cal-day empty"></div><div class="cal-day empty"></div>
<div class="cal-day"><span>1</span><div class="mood-dot happy"></div></div>
<div class="cal-day"><span>2</span><div class="mood-dot happy"></div><div class="entry-indicator"></div></div>
<div class="cal-day"><span>3</span><div class="mood-dot calm"></div></div>
<div class="cal-day"><span>4</span><div class="mood-dot love"></div><div class="entry-indicator"></div></div>
<div class="cal-day"><span>5</span><div class="mood-dot happy"></div><div class="entry-indicator"></div></div>
<div class="cal-day"><span>6</span><div class="mood-dot happy"></div></div>
<div class="cal-day"><span>7</span><div class="mood-dot tired"></div><div class="entry-indicator"></div></div>
<div class="cal-day"><span>8</span><div class="mood-dot happy"></div></div>
<div class="cal-day"><span>9</span><div class="mood-dot love"></div><div class="entry-indicator"></div></div>
<div class="cal-day"><span>10</span><div class="mood-dot calm"></div></div>
<div class="cal-day"><span>11</span><div class="mood-dot happy"></div><div class="entry-indicator"></div></div>
<div class="cal-day"><span>12</span><div class="mood-dot tired"></div></div>
<div class="cal-day"><span>13</span><div class="mood-dot happy"></div><div class="entry-indicator"></div></div>
<div class="cal-day"><span>14</span><div class="mood-dot love"></div><div class="entry-indicator"></div></div>
<div class="cal-day"><span>15</span><div class="mood-dot calm"></div></div>
<div class="cal-day"><span>16</span><div class="mood-dot happy"></div><div class="entry-indicator"></div></div>
<div class="cal-day"><span>17</span><div class="mood-dot sad"></div><div class="entry-indicator"></div></div>
<div class="cal-day"><span>18</span><div class="mood-dot calm"></div></div>
<div class="cal-day"><span>19</span><div class="mood-dot happy"></div><div class="entry-indicator"></div></div>
<div class="cal-day"><span>20</span><div class="mood-dot happy"></div><div class="entry-indicator"></div></div>
<div class="cal-day"><span>21</span><div class="mood-dot love"></div><div class="entry-indicator"></div></div>
<div class="cal-day"><span>22</span><div class="mood-dot tired"></div></div>
<div class="cal-day"><span>23</span><div class="mood-dot happy"></div><div class="entry-indicator"></div></div>
<div class="cal-day"><span>24</span><div class="mood-dot happy"></div><div class="entry-indicator"></div></div>
<div class="cal-day"><span>25</span><div class="mood-dot calm"></div></div>
<div class="cal-day"><span>26</span><div class="mood-dot love"></div><div class="entry-indicator"></div></div>
<div class="cal-day"><span>27</span><div class="mood-dot happy"></div><div class="entry-indicator"></div></div>
<div class="cal-day"><span>28</span><div class="mood-dot happy"></div><div class="entry-indicator"></div></div>
<div class="cal-day"><span>29</span><div class="mood-dot love"></div><div class="entry-indicator"></div></div>
<div class="cal-day"><span>30</span><div class="mood-dot happy"></div><div class="entry-indicator"></div></div>
<div class="cal-day today selected"><span>31</span><div class="mood-dot love" style="background:var(--accent-on)"></div></div>
</div>
</div>
<!-- Right: timeline detail -->
<aside class="cal-right-panel" role="complementary" aria-label="日期详情">
<div class="detail-title">5月31日 · 今天</div>
<div class="detail-date">星期日 · <span class="detail-count">3条记录</span></div>
<div class="timeline-item">
<div class="timeline-line"></div>
<div class="timeline-dot">🥰</div>
<div class="timeline-content">
<div class="tl-time">14:30 · 心情: 幸福</div>
<div class="tl-title">图书馆的午后时光</div>
<div class="tl-excerpt">今天下午去图书馆自习,阳光从窗外洒进来,暖暖的。不知不觉就学了三个小时,中间喝了一杯抹茶拿铁☕</div>
<div class="tl-tags">
<span class="tl-tag">学习</span>
<span class="tl-tag">校园</span>
</div>
</div>
</div>
<div class="timeline-item">
<div class="timeline-line"></div>
<div class="timeline-dot">😊</div>
<div class="timeline-content">
<div class="tl-time">09:15 · 心情: 开心</div>
<div class="tl-title">周末早起的奖励</div>
<div class="tl-excerpt">难得周末早起,去食堂吃了喜欢的豆浆油条,还买了一束花放在书桌上</div>
<div class="tl-tags">
<span class="tl-tag">美食</span>
<span class="tl-tag">心情</span>
</div>
</div>
</div>
<div class="timeline-item">
<div class="timeline-line"></div>
<div class="timeline-dot">😌</div>
<div class="timeline-content">
<div class="tl-time">07:00 · 心情: 平静</div>
<div class="tl-title">晨跑记录</div>
<div class="tl-excerpt">早起跑了两圈操场,空气很清新。看到有人在遛小狗,好可爱</div>
<div class="tl-tags">
<span class="tl-tag">运动</span>
</div>
</div>
</div>
</aside>
</div>
</main>
</div>
<!-- Status bar -->
<div class="desktop-statusbar">
<div class="traffic-lights">
<div class="dot" style="background:#FF5F57"></div>
<div class="dot" style="background:#FEBC2E"></div>
<div class="dot" style="background:#28C840"></div>
</div>
<span>暖记 — 日历</span>
<span style="font-variant-numeric:tabular-nums">14:32</span>
</div>
<script src="../../js/theme-switcher.js"></script>
</body>
</html>

View File

@@ -0,0 +1,648 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=1440, height=900, initial-scale=1">
<title>暖记 — 桌面端发现</title>
<link rel="stylesheet" href="../css/tokens.css">
<link rel="stylesheet" href="../css/components.css">
<link rel="stylesheet" href="shared.css">
<style>
body {
width: 1440px;
height: 900px;
overflow: hidden;
background: var(--bg);
font-family: var(--font-body);
}
.main-content { height: 900px; padding-top: 32px; }
.content-inner {
padding: var(--space-6) var(--space-10);
max-width: none;
}
/* Search bar */
.search-bar {
display: flex;
align-items: center;
gap: var(--space-3);
background: var(--surface);
border-radius: var(--radius-pill);
padding: var(--space-3) var(--space-5);
margin-bottom: var(--space-6);
border: 1px solid var(--border-soft);
box-shadow: var(--elev-soft);
transition: border-color var(--motion-fast) var(--ease-standard);
}
.search-bar:focus-within {
border-color: var(--accent);
}
.search-bar svg {
width: 20px;
height: 20px;
color: var(--muted);
flex-shrink: 0;
}
.search-bar input {
flex: 1;
border: none;
background: none;
font-family: var(--font-body);
font-size: var(--text-md);
color: var(--fg);
outline: none;
}
.search-bar input::placeholder {
color: var(--meta);
}
/* Hero inspiration card */
.inspiration-hero {
background: linear-gradient(135deg, var(--accent) 0%, var(--tertiary) 100%);
border-radius: var(--radius-lg);
padding: var(--space-8) var(--space-10);
margin-bottom: var(--space-6);
position: relative;
overflow: hidden;
cursor: pointer;
display: flex;
align-items: center;
gap: var(--space-8);
transition: transform var(--motion-fast) var(--ease-bounce);
}
.inspiration-hero:hover { transform: translateY(-2px); }
.inspiration-hero::before {
content: '';
position: absolute;
top: -50px;
right: -50px;
width: 200px;
height: 200px;
border-radius: 50%;
background: rgba(255,255,255,0.12);
}
.inspiration-hero::after {
content: '';
position: absolute;
bottom: -30px;
left: 60px;
width: 120px;
height: 120px;
border-radius: 50%;
background: rgba(255,255,255,0.08);
}
.inspiration-label {
font-size: var(--text-xs);
color: rgba(255,255,255,0.7);
font-weight: 500;
margin-bottom: var(--space-2);
text-transform: uppercase;
letter-spacing: 0.5px;
}
.inspiration-thumb {
width: 120px;
height: 120px;
border-radius: var(--radius-md);
background: rgba(255,255,255,0.2);
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
font-size: 52px;
backdrop-filter: blur(4px);
}
.inspiration-info {
flex: 1;
min-width: 0;
position: relative;
z-index: 1;
}
.inspiration-title {
font-family: var(--font-display);
font-size: var(--text-2xl);
font-weight: 700;
color: white;
margin-bottom: var(--space-2);
}
.inspiration-desc {
font-size: var(--text-base);
color: rgba(255,255,255,0.8);
margin-bottom: var(--space-3);
max-width: 500px;
}
.inspiration-author {
font-size: var(--text-sm);
color: rgba(255,255,255,0.7);
}
.inspiration-action {
display: inline-flex;
align-items: center;
gap: var(--space-2);
padding: var(--space-3) var(--space-5);
background: white;
color: var(--accent);
border: none;
border-radius: var(--radius-pill);
font-family: var(--font-display);
font-size: var(--text-base);
font-weight: 600;
cursor: pointer;
transition: all var(--motion-fast) var(--ease-bounce);
flex-shrink: 0;
position: relative;
z-index: 1;
}
.inspiration-action:hover { transform: scale(1.05); }
.inspiration-action:focus-visible { box-shadow: var(--focus-ring); outline: none; }
.inspiration-action svg { width: 18px; height: 18px; }
/* Three-column grid */
.discover-grid {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
gap: var(--space-6);
}
/* Section heading */
.section-heading {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: var(--space-4);
}
.section-heading h3 {
font-family: var(--font-display);
font-size: var(--text-lg);
font-weight: 700;
}
.section-heading .more {
font-size: var(--text-sm);
color: var(--accent);
cursor: pointer;
background: none;
border: none;
font-weight: 500;
min-height: 44px;
display: inline-flex;
align-items: center;
}
.section-heading .more:focus-visible {
box-shadow: var(--focus-ring);
outline: none;
border-radius: 4px;
}
/* Topics */
.topics-scroll {
display: flex;
flex-wrap: wrap;
gap: var(--space-2);
}
.topic-chip {
display: inline-flex;
align-items: center;
gap: var(--space-1);
padding: var(--space-2) var(--space-4);
border-radius: var(--radius-pill);
font-size: var(--text-sm);
font-weight: 500;
white-space: nowrap;
cursor: pointer;
border: 1px solid var(--border);
background: var(--surface);
color: var(--fg-2);
transition: all var(--motion-fast) var(--ease-standard);
box-shadow: var(--elev-soft);
}
.topic-chip:hover {
border-color: var(--accent);
color: var(--accent);
}
.topic-chip:focus-visible {
box-shadow: var(--focus-ring);
outline: none;
}
.topic-chip.active {
background: var(--accent);
color: var(--accent-on);
border-color: var(--accent);
}
.topic-chip .emoji {
font-size: 16px;
}
/* Templates grid */
.templates-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: var(--space-3);
}
.template-card {
background: var(--surface);
border-radius: var(--radius-md);
overflow: hidden;
box-shadow: var(--elev-soft);
border: 1px solid var(--border-soft);
cursor: pointer;
transition: transform var(--motion-fast) var(--ease-standard);
}
.template-card:hover { transform: translateY(-2px); }
.template-card:active { transform: scale(0.97); }
.template-thumb {
height: 80px;
display: flex;
align-items: center;
justify-content: center;
font-size: 28px;
}
.template-info {
padding: var(--space-3);
}
.template-name {
font-family: var(--font-display);
font-size: var(--text-sm);
font-weight: 600;
color: var(--fg);
margin-bottom: var(--space-1);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.template-users {
font-size: var(--text-xs);
color: var(--muted);
display: flex;
align-items: center;
gap: 4px;
}
.template-users svg {
width: 12px;
height: 12px;
}
/* Expert diary cards */
.experts-list {
display: flex;
flex-direction: column;
gap: var(--space-3);
}
.expert-card {
background: var(--surface);
border-radius: var(--radius-md);
padding: var(--space-4);
box-shadow: var(--elev-soft);
border: 1px solid var(--border-soft);
display: flex;
gap: var(--space-3);
cursor: pointer;
transition: transform var(--motion-fast) var(--ease-standard);
}
.expert-card:hover { transform: translateY(-2px); }
.expert-card:active { transform: scale(0.98); }
.expert-avatar {
width: 48px;
height: 48px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 22px;
flex-shrink: 0;
}
.expert-info {
flex: 1;
min-width: 0;
}
.expert-name {
font-size: var(--text-xs);
color: var(--muted);
margin-bottom: 2px;
}
.expert-title {
font-family: var(--font-display);
font-size: var(--text-base);
font-weight: 600;
color: var(--fg);
margin-bottom: 4px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.expert-preview {
font-size: var(--text-sm);
color: var(--muted);
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
line-height: 1.5;
}
.expert-likes {
display: flex;
align-items: center;
gap: 4px;
font-size: var(--text-xs);
color: var(--muted);
flex-shrink: 0;
margin-top: 4px;
}
.expert-likes svg {
width: 14px;
height: 14px;
color: var(--rose);
}
/* Empty state */
.empty-state {
display: none;
flex-direction: column;
align-items: center;
justify-content: center;
padding: var(--space-10) var(--space-5);
text-align: center;
}
.empty-state.visible {
display: flex;
}
.empty-state .icon {
font-size: 48px;
margin-bottom: var(--space-4);
opacity: 0.6;
}
.empty-state .text {
font-family: var(--font-display);
font-size: var(--text-md);
font-weight: 600;
color: var(--fg-2);
margin-bottom: var(--space-2);
}
.empty-state .subtext {
font-size: var(--text-sm);
color: var(--muted);
}
/* Animations */
@keyframes fadeIn {
from { opacity: 0; transform: translateY(12px); }
to { opacity: 1; transform: translateY(0); }
}
.anim-fade { animation: fadeIn 0.5s var(--ease-standard) both; }
@media (prefers-reduced-motion: reduce) {
.inspiration-hero,
.template-card,
.expert-card,
.topic-chip,
.inspiration-action {
transition: none;
}
.anim-fade { animation: none; }
}
</style>
</head>
<body>
<!-- Status bar -->
<div class="desktop-statusbar">
<div class="traffic-lights">
<div class="dot" style="background:#FF5F57"></div>
<div class="dot" style="background:#FEBC2E"></div>
<div class="dot" style="background:#28C840"></div>
</div>
<span>暖记 Warm Notes</span>
<span style="font-variant-numeric:tabular-nums">14:32</span>
</div>
<!-- Sidebar -->
<nav class="sidebar" aria-label="侧边导航">
<div class="sidebar-brand">
<div class="sidebar-logo">📖</div>
<div>
<div class="sidebar-brand-text">暖记</div>
<div class="sidebar-brand-sub">Warm Notes</div>
</div>
</div>
<div class="sidebar-nav">
<button class="sidebar-nav-item" aria-label="首页">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M3 9l9-7 9 7v11a2 2 0 01-2 2H5a2 2 0 01-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/></svg>
首页
</button>
<button class="sidebar-nav-item" aria-label="日历">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><rect x="3" y="4" width="18" height="18" rx="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg>
日历
</button>
<button class="sidebar-nav-item" aria-label="心情追踪">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M20.84 4.61a5.5 5.5 0 00-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 00-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 000-7.78z"/></svg>
心情追踪
</button>
<button class="sidebar-nav-item" aria-label="贴纸库">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><rect x="3" y="3" width="18" height="18" rx="3"/><circle cx="9" cy="10" r="1.5" fill="currentColor"/><circle cx="15" cy="10" r="1.5" fill="currentColor"/><path d="M9 15c.8.8 2.2 1.2 3 1.2s2.2-.4 3-1.2"/></svg>
贴纸库
</button>
<button class="sidebar-nav-item" aria-label="模板">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><rect x="3" y="3" width="7" height="7" rx="1"/><rect x="14" y="3" width="7" height="7" rx="1"/><rect x="3" y="14" width="7" height="7" rx="1"/><rect x="14" y="14" width="7" height="7" rx="1"/></svg>
模板
</button>
<button class="sidebar-nav-item active" aria-label="发现">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
发现
</button>
</div>
<button class="sidebar-write-btn" aria-label="写日记">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"><path d="M12 5v14M5 12h14"/></svg>
写日记
</button>
<div class="sidebar-footer">
<div class="sidebar-avatar">🐱</div>
<div>
<div class="sidebar-user-name">小暖</div>
<div class="sidebar-user-streak">连续记录 12 天</div>
</div>
</div>
</nav>
<!-- Main Content -->
<div class="main-content">
<!-- Top bar -->
<div class="desktop-topbar">
<div class="desktop-topbar-title">发现</div>
<div class="desktop-topbar-actions">
<button class="topbar-action-btn" aria-label="搜索">
<svg viewBox="0 0 18 18" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><circle cx="8" cy="8" r="6"/><line x1="12.5" y1="12.5" x2="16" y2="16"/></svg>
</button>
<button class="topbar-action-btn" aria-label="筛选">
<svg viewBox="0 0 18 18" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><path d="M4 6h10M4 9h10M4 12h7"/></svg>
</button>
</div>
</div>
<div class="content-inner">
<!-- Search bar -->
<div class="search-bar anim-fade" data-od-id="discover-search">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true">
<circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/>
</svg>
<input type="text" placeholder="搜索日记、模板、话题..." aria-label="搜索日记、模板、话题">
</div>
<!-- Empty state -->
<div class="empty-state" data-od-id="discover-empty" role="status">
<span class="icon" aria-hidden="true">🔍</span>
<div class="text">没有找到相关内容</div>
<div class="subtext">换个关键词试试吧</div>
</div>
<!-- Hero inspiration -->
<section data-od-id="discover-inspiration" aria-label="每日灵感" class="anim-fade" style="animation-delay:0.1s">
<div class="inspiration-hero" role="article" aria-label="今日灵感推荐:旅行手账排版技巧">
<div class="inspiration-thumb" aria-hidden="true">🗺️</div>
<div class="inspiration-info">
<div class="inspiration-label">今日推荐</div>
<div class="inspiration-title">旅行手账排版技巧</div>
<div class="inspiration-desc">学习如何用简单的素材和排版技巧,让你的旅行手账充满故事感。从照片布局到文字装饰,一步步教你做出精美的旅行记录。</div>
<div class="inspiration-author">by 手账达人小林</div>
</div>
<button class="inspiration-action" aria-label="查看详情">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M5 12h14M12 5l7 7-7 7"/></svg>
查看详情
</button>
</div>
</section>
<!-- Three-column grid -->
<div class="discover-grid anim-fade" style="animation-delay:0.2s">
<!-- Column 1: Hot topics -->
<section data-od-id="discover-topics" aria-label="热门话题">
<div class="section-heading">
<h3>热门话题</h3>
<button class="more" aria-label="查看更多话题">更多</button>
</div>
<div class="topics-scroll" role="list">
<button class="topic-chip active" role="listitem" aria-label="话题:期末备考">
<span class="emoji" aria-hidden="true">📚</span>#期末备考
</button>
<button class="topic-chip" role="listitem" aria-label="话题:读书笔记">
<span class="emoji" aria-hidden="true">📖</span>#读书笔记
</button>
<button class="topic-chip" role="listitem" aria-label="话题:旅行手账">
<span class="emoji" aria-hidden="true">✈️</span>#旅行手账
</button>
<button class="topic-chip" role="listitem" aria-label="话题:美食记录">
<span class="emoji" aria-hidden="true">🍜</span>#美食记录
</button>
<button class="topic-chip" role="listitem" aria-label="话题:校园生活">
<span class="emoji" aria-hidden="true">🎓</span>#校园生活
</button>
<button class="topic-chip" role="listitem" aria-label="话题:自我成长">
<span class="emoji" aria-hidden="true">🌱</span>#自我成长
</button>
</div>
</section>
<!-- Column 2: Featured templates -->
<section data-od-id="discover-templates" aria-label="精选模板">
<div class="section-heading">
<h3>精选模板</h3>
<button class="more" aria-label="查看更多模板">更多</button>
</div>
<div class="templates-grid">
<div class="template-card" role="article" aria-label="模板:考试周复习计划">
<div class="template-thumb" style="background: var(--tertiary-soft)" aria-hidden="true">📝</div>
<div class="template-info">
<div class="template-name">考试周复习计划</div>
<div class="template-users">
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><path d="M10 3a3 3 0 11-6 0 3 3 0 016 0zM2 14v-1a4 4 0 014-4h4a4 4 0 014 4v1"/></svg>
2.3k 人使用
</div>
</div>
</div>
<div class="template-card" role="article" aria-label="模板:读书笔记手账">
<div class="template-thumb" style="background: var(--secondary-soft)" aria-hidden="true">📖</div>
<div class="template-info">
<div class="template-name">读书笔记手账</div>
<div class="template-users">
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><path d="M10 3a3 3 0 11-6 0 3 3 0 016 0zM2 14v-1a4 4 0 014-4h4a4 4 0 014 4v1"/></svg>
1.8k 人使用
</div>
</div>
</div>
<div class="template-card" role="article" aria-label="模板:月度心情打卡">
<div class="template-thumb" style="background: var(--rose-soft)" aria-hidden="true">💫</div>
<div class="template-info">
<div class="template-name">月度心情打卡</div>
<div class="template-users">
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><path d="M10 3a3 3 0 11-6 0 3 3 0 016 0zM2 14v-1a4 4 0 014-4h4a4 4 0 014 4v1"/></svg>
3.1k 人使用
</div>
</div>
</div>
<div class="template-card" role="article" aria-label="模板:旅行日记模板">
<div class="template-thumb" style="background: var(--surface-warm)" aria-hidden="true">🗺️</div>
<div class="template-info">
<div class="template-name">旅行日记模板</div>
<div class="template-users">
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><path d="M10 3a3 3 0 11-6 0 3 3 0 016 0zM2 14v-1a4 4 0 014-4h4a4 4 0 014 4v1"/></svg>
1.5k 人使用
</div>
</div>
</div>
</div>
</section>
<!-- Column 3: Expert diaries -->
<section data-od-id="discover-experts" aria-label="达人日记">
<div class="section-heading">
<h3>达人日记</h3>
<button class="more" aria-label="查看更多达人日记">更多</button>
</div>
<div class="experts-list">
<div class="expert-card" role="article" aria-label="达人日记我的大学生活第100天">
<div class="expert-avatar" style="background: var(--tertiary-soft)" aria-hidden="true">🌸</div>
<div class="expert-info">
<div class="expert-name">小暖</div>
<div class="expert-title">我的大学生活第100天</div>
<div class="expert-preview">不知不觉大学生活已经过了100天了从最初的迷茫到现在的适应记录下这段珍贵的时光...</div>
</div>
<div class="expert-likes">
<svg viewBox="0 0 16 16" fill="currentColor"><path d="M8 14s-5.5-3.5-5.5-7.5C2.5 3.5 4 2 5.75 2 6.86 2 7.86 2.56 8 3.5 8.14 2.56 9.14 2 10.25 2 12 2 13.5 3.5 13.5 6.5 13.5 10.5 8 14 8 14z"/></svg>
328
</div>
</div>
<div class="expert-card" role="article" aria-label="达人日记考研倒计时30天手账">
<div class="expert-avatar" style="background: var(--secondary-soft)" aria-hidden="true">✏️</div>
<div class="expert-info">
<div class="expert-name">手账少女</div>
<div class="expert-title">考研倒计时30天手账</div>
<div class="expert-preview">最后冲刺阶段,用手账记录每一天的复习进度和心情变化,给自己加油打气...</div>
</div>
<div class="expert-likes">
<svg viewBox="0 0 16 16" fill="currentColor"><path d="M8 14s-5.5-3.5-5.5-7.5C2.5 3.5 4 2 5.75 2 6.86 2 7.86 2.56 8 3.5 8.14 2.56 9.14 2 10.25 2 12 2 13.5 3.5 13.5 6.5 13.5 10.5 8 14 8 14z"/></svg>
512
</div>
</div>
<div class="expert-card" role="article" aria-label="达人日记:秋日校园手账记录">
<div class="expert-avatar" style="background: var(--rose-soft)" aria-hidden="true">🍂</div>
<div class="expert-info">
<div class="expert-name">阿月</div>
<div class="expert-title">秋日校园手账记录</div>
<div class="expert-preview">银杏叶黄了,校园美得像画一样。收集了几片落叶夹在手账里,记录这个温柔的秋天...</div>
</div>
<div class="expert-likes">
<svg viewBox="0 0 16 16" fill="currentColor"><path d="M8 14s-5.5-3.5-5.5-7.5C2.5 3.5 4 2 5.75 2 6.86 2 7.86 2.56 8 3.5 8.14 2.56 9.14 2 10.25 2 12 2 13.5 3.5 13.5 6.5 13.5 10.5 8 14 8 14z"/></svg>
276
</div>
</div>
</div>
</section>
</div>
</div>
</div>
<script src="../../js/theme-switcher.js"></script>
</body>
</html>

View File

@@ -0,0 +1,479 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=1440, height=900, initial-scale=1">
<title>暖记 — 桌面端编辑器</title>
<link rel="stylesheet" href="../css/tokens.css">
<link rel="stylesheet" href="../css/components.css">
<link rel="stylesheet" href="../css/editor-common.css">
<link rel="stylesheet" href="shared.css">
<style>
body {
width: 1440px;
height: 900px;
overflow: hidden;
background: var(--bg);
font-family: var(--font-body);
}
.editor-layout {
display: flex;
height: 900px;
padding-top: 32px;
}
.sidebar { position: relative; flex-shrink: 0; }
.editor-main {
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
}
.editor-topbar {
height: 56px;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 var(--space-8);
background: var(--surface);
border-bottom: 1px solid var(--border-soft);
flex-shrink: 0;
}
.topbar-left, .topbar-right {
display: flex;
align-items: center;
gap: var(--space-3);
}
.topbar-btn {
width: 38px; height: 38px; border-radius: var(--radius-pill); border: none; background: none;
display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--fg);
transition: background var(--motion-fast);
}
.topbar-btn:hover { background: var(--surface-warm); }
.topbar-btn svg { width: 20px; height: 20px; }
.topbar-center {
font-family: var(--font-display); font-size: var(--text-md); font-weight: 600; color: var(--fg-2);
display: flex; align-items: center; gap: var(--space-4);
}
.topbar-center .date-mood {
display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm);
color: var(--muted); font-weight: 400;
}
.topbar-center .date-mood strong { color: var(--fg); font-weight: 600; }
.mood-mini {
width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--border);
display: flex; align-items: center; justify-content: center; font-size: 15px;
background: var(--surface); cursor: pointer;
}
.mood-mini.selected { border-color: var(--accent); background: var(--surface-warm); }
.topbar-undo-redo { display: flex; align-items: center; gap: 2px; }
.undo-btn, .redo-btn {
width: 34px; height: 34px; border-radius: var(--radius-pill); border: none; background: none;
display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--muted);
transition: all var(--motion-fast);
}
.undo-btn:hover:not(:disabled), .redo-btn:hover:not(:disabled) { background: var(--surface-warm); color: var(--fg); }
.undo-btn:disabled, .redo-btn:disabled { opacity: 0.35; cursor: default; }
.undo-btn svg, .redo-btn svg { width: 18px; height: 18px; }
.autosave-status { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--success); font-weight: 500; }
.autosave-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }
.save-btn {
padding: 10px 28px; background: var(--accent); color: var(--accent-on); border: none;
border-radius: var(--radius-pill); font-family: var(--font-display); font-size: var(--text-sm);
font-weight: 600; cursor: pointer; transition: all var(--motion-fast);
}
.save-btn:hover { background: var(--accent-hover); }
.editor-body { flex: 1; display: flex; overflow: hidden; }
.tool-strip {
width: 64px; background: var(--surface); border-right: 1px solid var(--border-soft);
display: flex; flex-direction: column; align-items: center; padding: var(--space-4) 0;
gap: var(--space-2); flex-shrink: 0;
}
.strip-btn {
width: 48px; height: 48px; border-radius: var(--radius-sm); border: none; background: none;
display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
cursor: pointer; color: var(--muted); transition: all var(--motion-fast);
}
.strip-btn:hover { color: var(--accent); background: var(--surface-warm); }
.strip-btn.active { color: var(--accent); background: var(--surface-warm); }
.strip-btn svg { width: 22px; height: 22px; }
.strip-btn span { font-size: 9px; font-weight: 500; }
.strip-divider { width: 32px; height: 1px; background: var(--border-soft); margin: var(--space-2) 0; }
.canvas-wrapper { flex: 1; padding: var(--space-6); overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.canvas-wrapper::-webkit-scrollbar { width: 4px; }
.canvas-wrapper::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.canvas-paper {
max-width: 720px; margin: 0 auto; background: var(--surface); border-radius: var(--radius-md);
box-shadow: var(--elev-medium); border: 1px solid var(--border-soft); padding: var(--space-10);
min-height: 700px; position: relative;
}
.canvas-grid {
position: absolute; inset: 0; background-image: radial-gradient(circle, var(--border) 1px, transparent 1px);
background-size: 28px 28px; opacity: 0.35; pointer-events: none; border-radius: var(--radius-md);
}
.washi-tape {
position: absolute; top: 20px; right: 50px; width: 120px; height: 24px;
background: repeating-linear-gradient(45deg, var(--tertiary), var(--tertiary) 4px, var(--surface-warm) 4px, var(--surface-warm) 8px);
transform: rotate(-8deg); border-radius: 2px; opacity: 0.8;
}
.placed-sticker { position: absolute; font-size: 40px; cursor: move; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1)); }
.journal-content { position: relative; z-index: 1; }
.journal-title {
font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 700; color: var(--fg);
margin-bottom: var(--space-4); border: none; outline: none; width: 100%; background: transparent;
}
.format-bar {
display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) 0;
margin-bottom: var(--space-5); border-bottom: 1px solid var(--border-soft);
}
.format-btn {
width: 34px; height: 34px; border-radius: 6px; border: none; background: none;
display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--muted);
font-size: var(--text-sm); font-weight: 600; transition: all var(--motion-fast);
}
.format-btn:hover { background: var(--surface-warm); color: var(--fg); }
.format-btn.active { background: var(--accent); color: var(--accent-on); }
.format-divider { width: 1px; height: 22px; background: var(--border); }
.color-dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; transition: all var(--motion-fast); }
.color-dot:hover { transform: scale(1.15); }
.color-dot.active { border-color: var(--fg); }
.journal-body {
font-size: var(--text-md); line-height: 2; color: var(--fg-2); border: none; outline: none;
width: 100%; background: transparent; resize: none; min-height: 280px;
}
.placed-photo {
width: 100%; height: 180px; border-radius: var(--radius-sm);
background: linear-gradient(135deg, var(--secondary-soft), var(--secondary-soft)); margin: var(--space-6) 0;
display: flex; align-items: center; justify-content: center;
}
.tool-panel-side {
width: 360px; background: var(--surface); border-left: 1px solid var(--border-soft);
overflow-y: auto; scrollbar-width: thin; flex-shrink: 0;
}
.tool-panel-side::-webkit-scrollbar { width: 4px; }
.tool-panel-side::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.panel-header { padding: var(--space-5); border-bottom: 1px solid var(--border-soft); display: flex; gap: var(--space-2); align-items: center; }
.panel-tab {
padding: 8px 18px; border-radius: var(--radius-pill); font-size: var(--text-sm); font-weight: 500;
background: var(--surface-warm); color: var(--fg-2); border: none; cursor: pointer;
white-space: nowrap; transition: all var(--motion-fast);
}
.panel-tab.active { background: var(--accent); color: var(--accent-on); }
.panel-content { padding: var(--space-5); }
.panel-sub-tabs { display: flex; gap: var(--space-2); margin-bottom: var(--space-5); flex-wrap: wrap; }
.sub-tab {
padding: 5px 14px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 500;
background: var(--surface-warm); color: var(--fg-2); border: none; cursor: pointer; transition: all var(--motion-fast);
}
.sub-tab.active { background: var(--accent); color: var(--accent-on); }
.sticker-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--space-3); }
.sticker-item {
aspect-ratio: 1; border-radius: var(--radius-sm); background: var(--surface-warm);
display: flex; align-items: center; justify-content: center; font-size: 28px; cursor: pointer;
transition: all var(--motion-fast) var(--ease-bounce); border: 1px solid transparent;
}
.sticker-item:hover { transform: scale(1.1); border-color: var(--accent); }
.template-preview { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); margin-top: var(--space-4); }
.template-thumb {
height: 160px; border-radius: var(--radius-sm); border: 2px solid var(--border); background: var(--bg);
cursor: pointer; transition: all var(--motion-fast); display: flex; align-items: center;
justify-content: center; flex-direction: column; gap: var(--space-2);
}
.template-thumb:hover { border-color: var(--accent); transform: translateY(-2px); }
.template-thumb .icon { font-size: 28px; }
.template-thumb .name { font-size: var(--text-xs); color: var(--muted); }
/* Brush panel */
.brush-section-title {
font-size: var(--text-xs); font-weight: 600; color: var(--muted);
text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: var(--space-3);
}
.brush-tools-row { display: flex; gap: var(--space-2); margin-bottom: var(--space-5); }
.brush-tool-btn {
display: flex; align-items: center; justify-content: center; width: 44px; height: 44px;
border-radius: var(--radius-sm); border: 2px solid transparent; background: var(--surface-warm);
cursor: pointer; color: var(--muted); transition: all var(--motion-fast);
}
.brush-tool-btn:hover { color: var(--fg); border-color: var(--border); }
.brush-tool-btn.active { border-color: var(--accent); color: var(--accent); }
.brush-tool-btn svg { width: 22px; height: 22px; }
.brush-size-row { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-5); }
.brush-size-label { font-size: var(--text-xs); color: var(--muted); font-weight: 500; min-width: 24px; }
.brush-slider { flex: 1; -webkit-appearance: none; appearance: none; height: 4px; border-radius: 2px; background: var(--border); outline: none; }
.brush-slider::-webkit-slider-thumb {
-webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
background: var(--accent); cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.brush-size-input {
width: 52px; height: 30px; border: 1px solid var(--border); border-radius: 6px;
text-align: center; font-size: var(--text-sm); font-weight: 600; color: var(--fg); background: var(--surface);
}
.brush-size-input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }
.brush-colors-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-3); margin-bottom: var(--space-4); }
.brush-color-dot { width: 100%; aspect-ratio: 1; border-radius: 50%; border: 3px solid transparent; cursor: pointer; transition: all var(--motion-fast); }
.brush-color-dot:hover { transform: scale(1.1); }
.brush-color-dot.active { border-color: var(--fg); box-shadow: 0 0 0 2px var(--surface); }
.brush-color-custom { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-5); }
.brush-color-custom input[type="color"] { width: 36px; height: 30px; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; padding: 2px; }
.brush-color-custom-label { font-size: var(--text-xs); color: var(--muted); }
.brush-opacity-row { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-5); transition: opacity var(--motion-fast); }
.brush-opacity-row.disabled { opacity: 0.35; pointer-events: none; }
.brush-opacity-label { font-size: var(--text-xs); color: var(--muted); font-weight: 500; min-width: 36px; }
.brush-opacity-input {
width: 52px; height: 30px; border: 1px solid var(--border); border-radius: 6px;
text-align: center; font-size: var(--text-sm); font-weight: 600; color: var(--fg); background: var(--surface);
}
.brush-opacity-input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }
.brush-shortcuts { background: var(--surface-warm); border-radius: var(--radius-sm); padding: var(--space-3); }
.brush-shortcut-item { display: flex; align-items: center; justify-content: space-between; padding: 4px 0; }
.brush-shortcut-item span { font-size: var(--text-xs); color: var(--muted); }
.brush-shortcut-key {
display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 22px;
padding: 0 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 4px;
font-size: 11px; font-weight: 600; color: var(--fg-2); font-family: var(--font-mono);
}
/* Tags panel */
.tags-section { margin-bottom: var(--space-5); }
.tag-selected-area {
display: flex; flex-wrap: wrap; gap: var(--space-2); min-height: 36px;
}
.tag-pill {
display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px;
border-radius: 9999px; background: var(--surface-warm); color: var(--accent);
font-size: 13px; font-weight: 500;
}
.tag-pill .remove {
width: 16px; height: 16px; border-radius: 50%; background: var(--accent);
color: var(--surface); display: flex; align-items: center; justify-content: center;
font-size: 10px; cursor: pointer; border: none; line-height: 1;
transition: background var(--motion-fast);
}
.tag-pill .remove:hover { background: var(--accent-hover); }
.tag-input-row { display: flex; }
.tag-input {
flex: 1; height: 36px; border: 1.5px solid var(--border); border-radius: var(--radius-pill);
padding: 0 var(--space-4); font-size: var(--text-sm); color: var(--fg);
background: var(--bg); outline: none; transition: border-color var(--motion-fast);
font-family: var(--font-body);
}
.tag-input::placeholder { color: var(--meta); }
.tag-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--shadow-input-focus); }
.tag-suggest-grid { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.tag-suggest-item {
display: inline-flex; align-items: center; padding: 6px 14px; border-radius: 9999px;
background: var(--surface-warm); color: var(--fg-2); font-size: var(--text-sm);
font-weight: 500; border: 1px solid transparent; cursor: pointer; white-space: nowrap;
transition: all var(--motion-fast);
}
.tag-suggest-item:hover { border-color: var(--accent); color: var(--accent); }
</style>
</head>
<body>
<div class="editor-layout">
<nav class="sidebar">
<div class="sidebar-brand"><div class="sidebar-logo">📖</div><div><div class="sidebar-brand-text">暖记</div><div class="sidebar-brand-sub">Warm Notes</div></div></div>
<div class="sidebar-nav">
<button class="sidebar-nav-item"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M3 9l9-7 9 7v11a2 2 0 01-2 2H5a2 2 0 01-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/></svg>首页</button>
<button class="sidebar-nav-item"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><rect x="3" y="4" width="18" height="18" rx="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg>日历</button>
<button class="sidebar-nav-item"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M20.84 4.61a5.5 5.5 0 00-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 00-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 000-7.78z"/></svg>心情追踪</button>
</div>
<div class="sidebar-footer"><div class="sidebar-avatar">🐱</div><div><div class="sidebar-user-name">小暖</div><div class="sidebar-user-streak">连续记录 12 天</div></div></div>
</nav>
<div class="editor-main">
<div class="editor-topbar">
<div class="topbar-left"><button class="topbar-btn"><svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M15 18l-6-6 6-6"/></svg></button></div>
<div class="topbar-center"><span>5月31日 · 周日</span><div class="date-mood"><strong>14:32</strong><span>· 晴 26°</span><div class="mood-mini" style="display:inline-flex">😊</div><div class="mood-mini selected" style="display:inline-flex">🥰</div></div></div>
<div class="topbar-right">
<div class="topbar-undo-redo">
<button class="undo-btn" disabled aria-label="撤销"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 10h10a5 5 0 015 5v2"/><polyline points="3 10 7 6"/><polyline points="3 10 7 14"/></svg></button>
<button class="redo-btn" disabled aria-label="重做"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 10H11a5 5 0 00-5 5v2"/><polyline points="21 10 17 6"/><polyline points="21 10 17 14"/></svg></button>
</div>
<div class="autosave-status" aria-live="polite"><span class="autosave-dot"></span><span>已保存</span></div>
<button class="topbar-btn"><svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M4 12v6h14v-6"/><polyline points="14 6 10 2 6 6"/><line x1="10" y1="2" x2="10" y2="13"/></svg></button>
<button class="topbar-btn"><svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><circle cx="10" cy="10" r="3"/><path d="M10 1v2M10 17v2M3.2 3.2l1.4 1.4M15.4 15.4l1.4 1.4M1 10h2M17 10h2M3.2 16.8l1.4-1.4M15.4 4.6l1.4-1.4"/></svg></button>
<button class="save-btn">保存</button>
</div>
</div>
<div class="editor-body">
<div class="tool-strip">
<button class="strip-btn active" onclick="switchRightPanel('stickers',this)"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><rect x="3" y="3" width="18" height="18" rx="3"/><circle cx="9" cy="10" r="1.5" fill="currentColor"/><circle cx="15" cy="10" r="1.5" fill="currentColor"/><path d="M9 15c.8.8 2.2 1.2 3 1.2s2.2-.4 3-1.2"/></svg><span>贴纸</span></button>
<button class="strip-btn" onclick="switchRightPanel('brush',this)"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M12 19l7-7 3 3-7 7-3-3z"/><path d="M18 13l-1.5-7.5L2 2l3.5 14.5L13 18l5-5z"/><path d="M2 2l7.586 7.586"/></svg><span>画笔</span></button>
<button class="strip-btn" onclick="switchRightPanel('templates',this)"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><rect x="3" y="3" width="7" height="7" rx="1"/><rect x="14" y="3" width="7" height="7" rx="1"/><rect x="3" y="14" width="7" height="7" rx="1"/><rect x="14" y="14" width="7" height="7" rx="1"/></svg><span>模板</span></button>
<button class="strip-btn" onclick="switchRightPanel('tags',this)"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M20.59 13.41l-7.17 7.17a2 2 0 01-2.83 0L2 12V2h10l8.59 8.59a2 2 0 010 2.82z"/><line x1="7" y1="7" x2="7.01" y2="7"/></svg><span>标签</span></button>
<div class="strip-divider"></div>
<button class="strip-btn"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><rect x="3" y="3" width="18" height="18" rx="2"/><circle cx="8.5" cy="8.5" r="1.5"/><polyline points="21 15 16 10 5 21"/></svg><span>照片</span></button>
<button class="strip-btn"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M4 7V4h16v3"/><path d="M9 20h6"/><path d="M12 4v16"/></svg><span>文字</span></button>
<div class="strip-divider"></div>
<button class="strip-btn"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><rect x="3" y="3" width="18" height="18" rx="2"/><path d="M3 9h18"/><path d="M9 21V9"/></svg><span>背景</span></button>
</div>
<div class="canvas-wrapper">
<div class="canvas-paper">
<div class="canvas-grid"></div>
<div class="washi-tape"></div>
<div class="placed-sticker" style="top:12px;left:12px">🌸</div>
<div class="placed-sticker" style="top:200px;right:20px"></div>
<div class="journal-content">
<input class="journal-title" type="text" value="图书馆的午后时光" placeholder="给日记起个标题...">
<div class="format-bar">
<button class="format-btn active" style="font-weight:800">B</button>
<button class="format-btn" style="font-style:italic">I</button>
<button class="format-btn" style="text-decoration:underline">U</button>
<button class="format-btn">S</button>
<div class="format-divider"></div>
<div class="color-dot active" style="background:#2D2420"></div>
<div class="color-dot" style="background:var(--accent)"></div>
<div class="color-dot" style="background:var(--secondary)"></div>
<div class="color-dot" style="background:#5B7DB1"></div>
<div class="color-dot" style="background:var(--rose)"></div>
<div class="format-divider"></div>
<button class="format-btn"><svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor"><rect x="1" y="3" width="14" height="2" rx="1"/><rect x="1" y="7" width="10" height="2" rx="1"/><rect x="1" y="11" width="6" height="2" rx="1"/></svg></button>
</div>
<textarea class="journal-body" rows="12">今天下午去图书馆自习,找了一个靠窗的位置。阳光从窗外洒进来,落在摊开的高数课本上,暖暖的。
不知不觉就学了三个小时,中间喝了一杯抹茶拿铁☕。虽然期末压力大,但看到窗外的樱花还在开,觉得一切都会好的。
晚上回宿舍路上,买了喜欢的草莓蛋糕犒劳自己 🍰
回到宿舍打开台灯,在日记本上贴了一张今天在校园里捡到的银杏叶,黄黄的好好看。希望能一直保持这种小确幸的感觉。</textarea>
<div class="placed-photo"><div style="text-align:center;color:var(--secondary)"><svg width="40" height="40" viewBox="0 0 32 32" fill="none" stroke="currentColor" stroke-width="1.5" style="margin-bottom:4px"><rect x="4" y="6" width="24" height="20" rx="3"/><circle cx="12" cy="14" r="3"/><path d="M4 22l6-6 4 4 6-8 8 10"/></svg><div style="font-size:14px">图书馆窗边的阳光 ☀</div></div></div>
</div>
</div>
</div>
<div class="tool-panel-side">
<div id="panelStickers">
<div class="panel-header"><button class="panel-tab active">贴纸</button><button class="panel-tab">模板</button><button class="panel-tab">背景</button></div>
<div class="panel-content">
<div class="panel-sub-tabs"><button class="sub-tab">热门</button><button class="sub-tab active">可爱</button><button class="sub-tab">植物</button><button class="sub-tab">天气</button><button class="sub-tab">节日</button><button class="sub-tab">校园</button><button class="sub-tab">手绘</button></div>
<div class="sticker-grid">
<div class="sticker-item">🌸</div><div class="sticker-item"></div><div class="sticker-item">🌿</div><div class="sticker-item">☀️</div><div class="sticker-item">🌙</div><div class="sticker-item">🍰</div><div class="sticker-item">📚</div><div class="sticker-item">🎵</div><div class="sticker-item">💡</div><div class="sticker-item">🎀</div><div class="sticker-item">🍂</div><div class="sticker-item"></div><div class="sticker-item">🌈</div><div class="sticker-item">✏️</div><div class="sticker-item">🦋</div><div class="sticker-item">🐱</div><div class="sticker-item">🎈</div><div class="sticker-item">🌻</div><div class="sticker-item">🎨</div><div class="sticker-item">🍀</div><div class="sticker-item">🎊</div><div class="sticker-item">💧</div><div class="sticker-item">🌙</div><div class="sticker-item">💌</div><div class="sticker-item">🐱</div>
</div>
</div>
</div>
<div id="panelBrush" style="display:none">
<div class="panel-header"><span style="font-family:var(--font-display);font-size:var(--text-base);font-weight:600;color:var(--fg)">画笔</span></div>
<div class="panel-content">
<div class="brush-section-title">工具</div>
<div class="brush-tools-row">
<button class="brush-tool-btn active" data-tool="pen" onclick="selectBrushTool(this,'pen')" title="钢笔"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M17 3l4 4L7 21H3v-4L17 3z"/></svg></button>
<button class="brush-tool-btn" data-tool="pencil" onclick="selectBrushTool(this,'pencil')" title="铅笔"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 20l1.5-5.5L18 2l4 4L9.5 18.5 4 20z"/><path d="M15 5l4 4"/></svg></button>
<button class="brush-tool-btn" data-tool="marker" onclick="selectBrushTool(this,'marker')" title="马克笔"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="6" y="3" width="14" height="8" rx="2" transform="rotate(45 13 7)"/><path d="M4 20l3-7"/></svg></button>
<button class="brush-tool-btn" data-tool="eraser" onclick="selectBrushTool(this,'eraser')" title="橡皮擦"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 20H9L3.5 14.5a2 2 0 010-2.83l9.17-9.17a2 2 0 012.83 0L20 7"/><path d="M6 12l6 6"/></svg></button>
</div>
<div class="brush-section-title">粗细</div>
<div class="brush-size-row">
<span class="brush-size-label">px</span>
<input type="range" class="brush-slider" id="brushSizeSlider" min="1" max="20" value="2">
<input type="number" class="brush-size-input" id="brushSizeInput" value="2" min="1" max="20">
</div>
<div class="brush-section-title">颜色</div>
<div class="brush-colors-grid">
<div class="brush-color-dot active" style="background:#2D2420" data-color="#2D2420" onclick="selectBrushColor(this)"></div>
<div class="brush-color-dot" style="background:var(--accent)" data-color="#E07A5F" onclick="selectBrushColor(this)"></div>
<div class="brush-color-dot" style="background:var(--secondary)" data-color="#81B29A" onclick="selectBrushColor(this)"></div>
<div class="brush-color-dot" style="background:var(--tertiary)" data-color="#F2CC8F" onclick="selectBrushColor(this)"></div>
<div class="brush-color-dot" style="background:var(--rose)" data-color="#D4A5A5" onclick="selectBrushColor(this)"></div>
<div class="brush-color-dot" style="background:#5B8FB9" data-color="#5B8FB9" onclick="selectBrushColor(this)"></div>
<div class="brush-color-dot" style="background:#9B72AA" data-color="#9B72AA" onclick="selectBrushColor(this)"></div>
<div class="brush-color-dot" style="background:#C93D3D" data-color="#C93D3D" onclick="selectBrushColor(this)"></div>
</div>
<div class="brush-color-custom">
<input type="color" id="brushCustomColor" value="#2D2420">
<span class="brush-color-custom-label">自定义颜色</span>
</div>
<div class="brush-opacity-row disabled" id="brushOpacityRow">
<span class="brush-opacity-label">透明度</span>
<input type="range" class="brush-slider" id="brushOpacitySlider" min="0" max="100" value="50">
<input type="number" class="brush-opacity-input" id="brushOpacityInput" value="50" min="0" max="100">
<span style="font-size:var(--text-xs);color:var(--muted)">%</span>
</div>
<div class="brush-section-title">快捷键</div>
<div class="brush-shortcuts">
<div class="brush-shortcut-item"><span>画笔工具</span><span class="brush-shortcut-key">B</span></div>
<div class="brush-shortcut-item"><span>橡皮擦</span><span class="brush-shortcut-key">E</span></div>
<div class="brush-shortcut-item"><span>减小粗细</span><span class="brush-shortcut-key">[</span></div>
<div class="brush-shortcut-item"><span>增大粗细</span><span class="brush-shortcut-key">]</span></div>
</div>
</div>
</div>
<div id="panelTemplates" style="display:none">
<div class="panel-header"><button class="panel-tab active">模板</button></div>
<div class="panel-content">
<div class="panel-sub-tabs"><button class="sub-tab active">日视图</button><button class="sub-tab">周视图</button><button class="sub-tab">月视图</button></div>
<div class="template-preview">
<div class="template-thumb"><div class="icon">📝</div><div class="name">简约日记</div></div>
<div class="template-thumb"><div class="icon">🌸</div><div class="name">手账风</div></div>
<div class="template-thumb"><div class="icon">📊</div><div class="name">数据日记</div></div>
<div class="template-thumb"><div class="icon">🎨</div><div class="name">自由画布</div></div>
</div>
</div>
</div>
<div id="panelTags" style="display:none">
<div class="panel-header"><span style="font-family:var(--font-display);font-size:var(--text-base);font-weight:600;color:var(--fg)">标签</span></div>
<div class="panel-content">
<div class="tags-section">
<div class="brush-section-title">已选标签</div>
<div class="tag-selected-area" id="tagSelectedArea">
<span class="tag-pill">#图书馆<span class="remove" aria-label="删除标签 图书馆" role="button" onclick="this.parentElement.remove()">&times;</span></span>
<span class="tag-pill">#学习<span class="remove" aria-label="删除标签 学习" role="button" onclick="this.parentElement.remove()">&times;</span></span>
</div>
</div>
<div class="tags-section">
<div class="brush-section-title">添加标签</div>
<div class="tag-input-row">
<input class="tag-input" type="text" id="tagInput" placeholder="输入标签后回车添加..." autocomplete="off" aria-label="输入新标签" onkeydown="handleTagInput(event)">
</div>
</div>
<div class="tags-section">
<div class="brush-section-title">推荐标签</div>
<div class="tag-suggest-grid">
<button class="tag-suggest-item" aria-label="添加标签 日常" onclick="addSuggestedTag(this)">#日常</button>
<button class="tag-suggest-item" aria-label="添加标签 学习" onclick="addSuggestedTag(this)">#学习</button>
<button class="tag-suggest-item" aria-label="添加标签 读书" onclick="addSuggestedTag(this)">#读书</button>
<button class="tag-suggest-item" aria-label="添加标签 运动" onclick="addSuggestedTag(this)">#运动</button>
<button class="tag-suggest-item" aria-label="添加标签 旅行" onclick="addSuggestedTag(this)">#旅行</button>
<button class="tag-suggest-item" aria-label="添加标签 美食" onclick="addSuggestedTag(this)">#美食</button>
<button class="tag-suggest-item" aria-label="添加标签 心情" onclick="addSuggestedTag(this)">#心情</button>
<button class="tag-suggest-item" aria-label="添加标签 灵感" onclick="addSuggestedTag(this)">#灵感</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="desktop-statusbar">
<div class="traffic-lights"><div class="dot" style="background:#FF5F57"></div><div class="dot" style="background:#FEBC2E"></div><div class="dot" style="background:#28C840"></div></div>
<span>暖记 — 手账编辑器</span>
<span style="font-variant-numeric:tabular-nums">14:32</span>
</div>
<script>
function switchRightPanel(name,stripBtn){var s=document.querySelectorAll('.strip-btn');for(var i=0;i<s.length;i++)s[i].classList.remove('active');stripBtn.classList.add('active');var p=['panelStickers','panelBrush','panelTemplates','panelTags'];var n=['stickers','brush','templates','tags'];for(var i=0;i<p.length;i++){var el=document.getElementById(p[i]);if(el)el.style.display=n[i]===name?'':'none';}}
function selectBrushTool(btn,tool){var b=document.querySelectorAll('.brush-tool-btn');for(var i=0;i<b.length;i++)b[i].classList.remove('active');btn.classList.add('active');var d={pen:2,pencil:3,marker:8,eraser:10};var v=d[tool]||2;document.getElementById('brushSizeSlider').value=v;document.getElementById('brushSizeInput').value=v;var o=document.getElementById('brushOpacityRow');if(tool==='marker'){o.classList.remove('disabled');}else{o.classList.add('disabled');}}
function selectBrushColor(dot){var d=document.querySelectorAll('.brush-color-dot');for(var i=0;i<d.length;i++)d[i].classList.remove('active');dot.classList.add('active');document.getElementById('brushCustomColor').value=dot.getAttribute('data-color');}
document.getElementById('brushSizeSlider').addEventListener('input',function(){document.getElementById('brushSizeInput').value=this.value;});
document.getElementById('brushSizeInput').addEventListener('input',function(){var v=Math.min(20,Math.max(1,parseInt(this.value)||1));document.getElementById('brushSizeSlider').value=v;});
document.getElementById('brushOpacitySlider').addEventListener('input',function(){document.getElementById('brushOpacityInput').value=this.value;});
document.getElementById('brushOpacityInput').addEventListener('input',function(){var v=Math.min(100,Math.max(0,parseInt(this.value)||0));document.getElementById('brushOpacitySlider').value=v;});
document.getElementById('brushCustomColor').addEventListener('input',function(){var d=document.querySelectorAll('.brush-color-dot');for(var i=0;i<d.length;i++)d[i].classList.remove('active');});
function handleTagInput(e){if(e.key==='Enter'){var input=e.target;var text=input.value.trim();if(text){if(!text.startsWith('#'))text='#'+text;var area=document.getElementById('tagSelectedArea');var pill=document.createElement('span');pill.className='tag-pill';pill.innerHTML=text+'<span class="remove" aria-label="删除标签 '+text.slice(1)+'" role="button" onclick="this.parentElement.remove()">&times;</span>';area.appendChild(pill);input.value='';}}}
function addSuggestedTag(btn){var text=btn.textContent.trim();var area=document.getElementById('tagSelectedArea');var pill=document.createElement('span');pill.className='tag-pill';pill.innerHTML=text+'<span class="remove" aria-label="删除标签 '+text.slice(1)+'" role="button" onclick="this.parentElement.remove()">&times;</span>';area.appendChild(pill);btn.style.display='none';}
</script>
<script src="../../js/theme-switcher.js"></script>
</body>
</html>

View File

@@ -0,0 +1,595 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=1440, height=900, initial-scale=1">
<title>暖记 — 桌面端首页</title>
<link rel="stylesheet" href="../css/tokens.css">
<link rel="stylesheet" href="../css/components.css">
<link rel="stylesheet" href="shared.css">
<style>
body {
width: 1440px;
height: 900px;
overflow: hidden;
background: var(--bg);
font-family: var(--font-body);
}
.main-content { height: 900px; padding-top: 32px; }
.content-inner {
padding: var(--space-6) var(--space-10);
max-width: none;
}
/* Greeting row */
.greeting-row {
display: flex;
justify-content: space-between;
align-items: flex-end;
margin-bottom: var(--space-6);
}
.greeting-date {
font-size: var(--text-sm);
color: var(--muted);
font-weight: 500;
margin-bottom: var(--space-1);
}
.greeting-text {
font-family: var(--font-display);
font-size: var(--text-4xl);
font-weight: 700;
color: var(--fg);
}
.greeting-text span { color: var(--accent); }
.streak-badge {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 8px 16px;
background: var(--tertiary-soft);
border-radius: var(--radius-pill);
font-size: var(--text-sm);
font-weight: 600;
color: #B8860B;
}
/* Three column layout */
.home-grid {
display: grid;
grid-template-columns: 1fr 380px;
gap: var(--space-6);
}
/* Left column: mood + today + entries */
.left-col {}
.mood-section {
background: var(--surface);
border-radius: var(--radius-md);
padding: var(--space-5);
margin-bottom: var(--space-5);
box-shadow: var(--elev-soft);
border: 1px solid var(--border-soft);
}
.mood-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: var(--space-4);
}
.mood-header span {
font-size: var(--text-md);
font-weight: 600;
color: var(--fg-2);
}
.mood-header .weather {
font-size: var(--text-sm);
color: var(--muted);
display: flex;
align-items: center;
gap: 4px;
}
.mood-options {
display: flex;
justify-content: space-between;
max-width: 500px;
}
.mood-opt {
display: flex;
flex-direction: column;
align-items: center;
gap: 4px;
background: none;
border: none;
cursor: pointer;
padding: var(--space-3) var(--space-4);
border-radius: var(--radius-sm);
transition: all var(--motion-fast) var(--ease-bounce);
}
.mood-opt:hover { background: var(--surface-warm); }
.mood-opt.selected { background: var(--surface-warm); }
.mood-opt .face { font-size: 32px; }
.mood-opt .label { font-size: var(--text-xs); color: var(--muted); }
.mood-opt.selected .label { color: var(--accent); font-weight: 600; }
.today-card {
background: linear-gradient(135deg, var(--accent) 0%, var(--tertiary) 100%);
border-radius: var(--radius-lg);
padding: var(--space-6);
margin-bottom: var(--space-5);
position: relative;
overflow: hidden;
cursor: pointer;
display: flex;
align-items: center;
justify-content: space-between;
}
.today-card:hover { transform: translateY(-2px); transition: transform var(--motion-fast) var(--ease-bounce); }
.today-card::before {
content: '';
position: absolute;
top: -30px;
right: -30px;
width: 160px;
height: 160px;
border-radius: 50%;
background: rgba(255,255,255,0.12);
}
.today-card .label {
font-size: var(--text-sm);
color: var(--accent-on);
font-weight: 500;
margin-bottom: var(--space-2);
opacity: 0.85;
}
.today-card .title {
font-family: var(--font-display);
font-size: var(--text-xl);
font-weight: 700;
color: var(--accent-on);
margin-bottom: var(--space-1);
}
.today-card .prompt {
font-size: var(--text-sm);
color: var(--accent-on);
opacity: 0.7;
}
.today-card .write-btn {
width: 56px;
height: 56px;
border-radius: 50%;
background: white;
border: none;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 4px 14px rgba(0,0,0,0.1);
cursor: pointer;
transition: transform var(--motion-fast) var(--ease-bounce);
flex-shrink: 0;
}
.today-card .write-btn:hover { transform: scale(1.1); }
.today-card .write-btn svg { width: 24px; height: 24px; color: var(--accent); }
/* Entries grid — 3 columns */
.recent-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: var(--space-4);
}
.recent-header h3 {
font-family: var(--font-display);
font-size: var(--text-lg);
font-weight: 700;
}
.recent-header a {
font-size: var(--text-sm);
color: var(--accent);
text-decoration: none;
font-weight: 500;
}
.entries-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: var(--space-4);
}
.entry-card {
background: var(--surface);
border-radius: var(--radius-md);
padding: var(--space-4);
box-shadow: var(--elev-soft);
border: 1px solid var(--border-soft);
cursor: pointer;
transition: transform var(--motion-fast) var(--ease-standard);
}
.entry-card:hover { transform: translateY(-2px); }
.entry-top {
display: flex;
justify-content: space-between;
align-items: flex-start;
margin-bottom: var(--space-2);
}
.entry-date { font-size: var(--text-xs); color: var(--muted); }
.entry-mood { font-size: 18px; }
.entry-title {
font-family: var(--font-display);
font-size: var(--text-md);
font-weight: 600;
color: var(--fg);
margin-bottom: var(--space-1);
}
.entry-excerpt {
font-size: var(--text-sm);
color: var(--muted);
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
line-height: 1.5;
}
.entry-preview-thumb {
width: 100%;
height: 72px;
border-radius: var(--radius-sm);
margin-top: var(--space-3);
background: var(--surface-warm);
display: flex;
align-items: center;
justify-content: center;
font-size: 24px;
}
/* Right column: stats + mood chart */
.right-col {
display: flex;
flex-direction: column;
gap: var(--space-5);
}
.stat-cards {
display: grid;
grid-template-columns: 1fr 1fr;
gap: var(--space-3);
}
.stat-card {
background: var(--surface);
border-radius: var(--radius-md);
padding: var(--space-5);
box-shadow: var(--elev-soft);
border: 1px solid var(--border-soft);
}
.stat-card .num {
font-family: var(--font-display);
font-size: var(--text-2xl);
font-weight: 700;
}
.stat-card .num.accent { color: var(--accent); }
.stat-card .num.green { color: var(--secondary); }
.stat-card .label {
font-size: var(--text-sm);
color: var(--muted);
margin-top: 4px;
}
/* Mood chart */
.mood-chart-card {
background: var(--surface);
border-radius: var(--radius-md);
padding: var(--space-5);
box-shadow: var(--elev-soft);
border: 1px solid var(--border-soft);
}
.mood-chart-card h4 {
font-family: var(--font-display);
font-size: var(--text-base);
font-weight: 600;
margin-bottom: var(--space-4);
}
.chart-period {
display: flex;
gap: var(--space-2);
margin-bottom: var(--space-4);
}
.period-btn {
padding: 6px 16px;
border-radius: var(--radius-pill);
border: none;
font-size: var(--text-sm);
font-weight: 500;
background: var(--surface-warm);
color: var(--fg-2);
cursor: pointer;
}
.period-btn.active { background: var(--accent); color: var(--accent-on); }
.mood-line-chart {
height: 100px;
display: flex;
align-items: flex-end;
gap: 4px;
padding-bottom: 24px;
position: relative;
}
.mood-line-chart::after {
content: '';
position: absolute;
bottom: 20px;
left: 0;
right: 0;
height: 1px;
background: var(--border-soft);
}
.chart-bar {
flex: 1;
border-radius: 6px 6px 0 0;
position: relative;
cursor: pointer;
transition: height var(--motion-base) var(--ease-bounce);
}
.chart-bar:hover { opacity: 0.8; }
.chart-date {
position: absolute;
bottom: -20px;
left: 50%;
transform: translateX(-50%);
font-size: 10px;
color: var(--meta);
white-space: nowrap;
}
/* Insight mini card */
.insight-mini {
background: var(--surface);
border-radius: var(--radius-md);
padding: var(--space-5);
box-shadow: var(--elev-soft);
border: 1px solid var(--border-soft);
}
.insight-mini h4 {
font-family: var(--font-display);
font-size: var(--text-base);
font-weight: 600;
margin-bottom: var(--space-3);
}
.insight-row {
display: flex;
align-items: center;
gap: var(--space-3);
padding: var(--space-2) 0;
}
.insight-row .icon {
font-size: 20px;
}
.insight-row .text {
flex: 1;
font-size: var(--text-sm);
color: var(--fg-2);
}
.insight-row .badge {
padding: 4px 10px;
border-radius: var(--radius-pill);
font-size: 11px;
font-weight: 600;
background: var(--secondary-soft);
color: #2D7D46;
}
/* Animations */
@keyframes fadeIn {
from { opacity: 0; transform: translateY(12px); }
to { opacity: 1; transform: translateY(0); }
}
.anim-fade { animation: fadeIn 0.5s var(--ease-standard) both; }
</style>
</head>
<body>
<!-- Status bar -->
<div class="desktop-statusbar">
<div class="traffic-lights">
<div class="dot" style="background:#FF5F57"></div>
<div class="dot" style="background:#FEBC2E"></div>
<div class="dot" style="background:#28C840"></div>
</div>
<span>暖记 Warm Notes</span>
<span style="font-variant-numeric:tabular-nums">14:32</span>
</div>
<!-- Sidebar -->
<nav class="sidebar" role="navigation" aria-label="主导航">
<div class="sidebar-brand">
<div class="sidebar-logo">📖</div>
<div>
<div class="sidebar-brand-text">暖记</div>
<div class="sidebar-brand-sub">Warm Notes</div>
</div>
</div>
<div class="sidebar-nav">
<button class="sidebar-nav-item active" aria-label="首页">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M3 9l9-7 9 7v11a2 2 0 01-2 2H5a2 2 0 01-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/></svg>
首页
</button>
<button class="sidebar-nav-item" aria-label="日历">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><rect x="3" y="4" width="18" height="18" rx="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg>
日历
</button>
<button class="sidebar-nav-item" aria-label="心情追踪">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M20.84 4.61a5.5 5.5 0 00-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 00-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 000-7.78z"/></svg>
心情追踪
</button>
<button class="sidebar-nav-item" aria-label="贴纸库">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><rect x="3" y="3" width="18" height="18" rx="3"/><circle cx="9" cy="10" r="1.5" fill="currentColor"/><circle cx="15" cy="10" r="1.5" fill="currentColor"/><path d="M9 15c.8.8 2.2 1.2 3 1.2s2.2-.4 3-1.2"/></svg>
贴纸库
</button>
<button class="sidebar-nav-item" aria-label="模板">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><rect x="3" y="3" width="7" height="7" rx="1"/><rect x="14" y="3" width="7" height="7" rx="1"/><rect x="3" y="14" width="7" height="7" rx="1"/><rect x="14" y="14" width="7" height="7" rx="1"/></svg>
模板
</button>
<button class="sidebar-nav-item" aria-label="发现">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
发现
</button>
</div>
<button class="sidebar-write-btn" aria-label="写日记">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"><path d="M12 5v14M5 12h14"/></svg>
写日记
</button>
<div class="sidebar-footer">
<div class="sidebar-avatar">🐱</div>
<div>
<div class="sidebar-user-name">小暖</div>
<div class="sidebar-user-streak">连续记录 12 天</div>
</div>
</div>
</nav>
<!-- Main Content -->
<main class="main-content" role="main">
<!-- Top bar -->
<div class="desktop-topbar">
<div class="desktop-topbar-title">首页</div>
<div class="desktop-topbar-actions">
<button class="topbar-action-btn" aria-label="搜索">
<svg viewBox="0 0 18 18" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><circle cx="8" cy="8" r="6"/><line x1="12.5" y1="12.5" x2="16" y2="16"/></svg>
</button>
<button class="topbar-action-btn" aria-label="菜单">
<svg viewBox="0 0 18 18" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><path d="M4 6h10M4 9h10M4 12h7"/></svg>
</button>
</div>
</div>
<div class="content-inner">
<!-- Greeting -->
<div class="greeting-row anim-fade">
<div>
<div class="greeting-date">2026年5月31日 · 星期日</div>
<div class="greeting-text">下午好,<span>小暖</span></div>
</div>
<div class="streak-badge">
<svg width="16" height="16" viewBox="0 0 16 16" fill="#B8860B"><path d="M8 1l2 5h5l-4 3 1.5 5L8 11 3.5 14 5 9 1 6h5z"/></svg>
连续记录 12 天
</div>
</div>
<!-- Two-column grid -->
<div class="home-grid anim-fade" style="animation-delay:0.1s">
<div class="left-col">
<!-- Mood -->
<div class="mood-section">
<div class="mood-header">
<span>今天心情如何?</span>
<div class="weather">
<svg width="16" height="16" viewBox="0 0 16 16" fill="var(--tertiary)"><circle cx="8" cy="8" r="5"/></svg>
晴 26°
</div>
</div>
<div class="mood-options">
<button class="mood-opt" aria-label="开心"><span class="face">😊</span><span class="label">开心</span></button>
<button class="mood-opt" aria-label="平静"><span class="face">😌</span><span class="label">平静</span></button>
<button class="mood-opt selected" aria-label="幸福"><span class="face">🥰</span><span class="label">幸福</span></button>
<button class="mood-opt" aria-label="疲惫"><span class="face">😴</span><span class="label">疲惫</span></button>
<button class="mood-opt" aria-label="低落"><span class="face">😔</span><span class="label">低落</span></button>
</div>
</div>
<!-- Today card -->
<div class="today-card">
<div>
<div class="label">今天的日记</div>
<div class="title">写点什么吧...</div>
<div class="prompt">记录一个温暖的瞬间,或者今天发生的小事</div>
</div>
<button class="write-btn" aria-label="开始写日记">
<svg viewBox="0 0 24 24" fill="none"><path d="M11 5v12M5 11h12" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"/></svg>
</button>
</div>
<!-- Recent entries -->
<div class="recent-header">
<h3>最近记录</h3>
<a href="#">查看全部</a>
</div>
<div class="entries-grid">
<div class="entry-card">
<div class="entry-top"><div class="entry-date">5月30日 · 周六</div><div class="entry-mood">😊</div></div>
<div class="entry-title">图书馆的午后</div>
<div class="entry-excerpt">今天在图书馆自习,窗外的阳光洒进来,暖暖的。复习了高数第三章...</div>
<div class="entry-preview-thumb" style="background:var(--surface-warm)">🌸</div>
</div>
<div class="entry-card">
<div class="entry-top"><div class="entry-date">5月29日 · 周五</div><div class="entry-mood">🥰</div></div>
<div class="entry-title">和舍友的火锅局</div>
<div class="entry-excerpt">考完试和舍友们去吃了火锅庆祝,大家都好开心...</div>
<div class="entry-preview-thumb" style="background:var(--secondary-soft)">🍃</div>
</div>
<div class="entry-card">
<div class="entry-top"><div class="entry-date">5月28日 · 周四</div><div class="entry-mood">😌</div></div>
<div class="entry-title">期末考试第一天</div>
<div class="entry-excerpt">终于考完了英语,感觉发挥还可以。明天继续加油!</div>
<div class="entry-preview-thumb" style="background:var(--tertiary-soft)">📝</div>
</div>
<div class="entry-card">
<div class="entry-top"><div class="entry-date">5月27日 · 周三</div><div class="entry-mood">😌</div></div>
<div class="entry-title">夜跑打卡</div>
<div class="entry-excerpt">晚上去操场跑了三圈,吹着晚风特别舒服...</div>
<div class="entry-preview-thumb" style="background:var(--rose-soft)">🌙</div>
</div>
</div>
</div>
<!-- Right column -->
<div class="right-col">
<div class="stat-cards">
<div class="stat-card"><div class="num accent">28</div><div class="label">本月日记</div></div>
<div class="stat-card"><div class="num green">12</div><div class="label">连续天数</div></div>
<div class="stat-card"><div class="num">156</div><div class="label">总日记数</div></div>
<div class="stat-card"><div class="num" style="color:var(--rose)">72%</div><div class="label">好心情占比</div></div>
</div>
<div class="mood-chart-card">
<h4>心情趋势</h4>
<div class="chart-period">
<button class="period-btn active">近7天</button>
<button class="period-btn">近30天</button>
<button class="period-btn">近3月</button>
</div>
<div class="mood-line-chart">
<div class="chart-bar" style="height:70%;background:var(--secondary)"><span class="chart-date">25日</span></div>
<div class="chart-bar" style="height:50%;background:var(--tertiary)"><span class="chart-date">26日</span></div>
<div class="chart-bar" style="height:85%;background:var(--accent)"><span class="chart-date">27日</span></div>
<div class="chart-bar" style="height:75%;background:var(--secondary)"><span class="chart-date">28日</span></div>
<div class="chart-bar" style="height:90%;background:var(--accent)"><span class="chart-date">29日</span></div>
<div class="chart-bar" style="height:65%;background:var(--secondary)"><span class="chart-date">30日</span></div>
<div class="chart-bar" style="height:88%;background:var(--accent)"><span class="chart-date">31日</span></div>
</div>
</div>
<div class="insight-mini">
<h4>心情洞察</h4>
<div class="insight-row">
<span class="icon">🌟</span>
<span class="text">最佳心情日5月14日</span>
<span class="badge">开心</span>
</div>
<div class="insight-row">
<span class="icon">💡</span>
<span class="text">好心情常与「朋友」「美食」相关</span>
</div>
<div class="insight-row">
<span class="icon">📈</span>
<span class="text">心情较上月提升</span>
<span class="badge">+15%</span>
</div>
</div>
</div>
</div>
</div>
</main>
<script src="../../js/theme-switcher.js"></script>
</body>
</html>

View File

@@ -0,0 +1,725 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=1440, height=900, initial-scale=1">
<title>暖记 — 桌面端登录/注册</title>
<link rel="stylesheet" href="../css/tokens.css">
<link rel="stylesheet" href="../css/components.css">
<style>
body {
width: 1440px;
height: 900px;
overflow: hidden;
background: var(--bg);
font-family: var(--font-body);
display: flex;
}
/* Focus styles */
button:focus-visible, a:focus-visible, input:focus-visible {
box-shadow: 0 0 0 3px var(--focus-ring);
outline: none;
}
/* Split layout: 60% brand | 40% form */
.brand-side {
width: 60%;
height: 900px;
background: linear-gradient(160deg, var(--tertiary-soft) 0%, var(--rose-soft) 100%);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
position: relative;
overflow: hidden;
}
.form-side {
width: 40%;
height: 900px;
background: var(--surface);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
position: relative;
}
/* macOS status bar */
.statusbar {
position: absolute;
top: 0;
left: 0;
right: 0;
height: 32px;
background: var(--surface);
border-bottom: 1px solid var(--border-soft);
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 var(--space-6);
font-size: 13px;
color: var(--muted);
font-weight: 500;
z-index: 60;
}
.statusbar .traffic-lights {
display: flex;
gap: 8px;
}
.statusbar .dot {
width: 12px;
height: 12px;
border-radius: 50%;
}
/* Brand side content */
.brand-content {
display: flex;
flex-direction: column;
align-items: center;
z-index: 5;
}
/* CSS-drawn notebook logo */
.logo-wrap {
width: 100px;
height: 100px;
position: relative;
margin-bottom: var(--space-6);
}
.logo-notebook {
width: 76px;
height: 86px;
border: 3px solid var(--accent);
border-radius: 8px 12px 12px 8px;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
background: rgba(224, 122, 95, 0.06);
}
.logo-spine {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 3px;
height: 86px;
background: var(--accent);
border-radius: 2px;
}
.logo-heart {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -45%);
width: 22px;
height: 22px;
}
.logo-heart::before {
content: '';
position: absolute;
left: 50%;
top: 50%;
width: 22px;
height: 22px;
background: var(--accent);
clip-path: path('M11 19C11 19 2 13 2 8C2 4.5 4.5 2 7.5 2C9.3 2 10.7 2.8 11 3.8C11.3 2.8 12.7 2 14.5 2C17.5 2 20 4.5 20 8C20 13 11 19 11 19Z');
transform: translate(-50%, -50%);
}
.brand-title {
font-family: var(--font-display);
font-size: var(--text-4xl);
font-weight: 700;
color: var(--fg);
margin-bottom: var(--space-2);
}
.brand-tagline {
font-family: var(--font-handwritten);
font-size: var(--text-xl);
color: var(--accent);
font-weight: 500;
}
/* Feature cards */
.feature-cards {
display: flex;
gap: var(--space-5);
margin-top: var(--space-12);
z-index: 5;
}
.feature-card {
width: 180px;
padding: var(--space-5);
background: rgba(255, 255, 255, 0.6);
backdrop-filter: blur(8px);
-webkit-backdrop-filter: blur(8px);
border-radius: var(--radius-md);
border: 1px solid rgba(255, 255, 255, 0.5);
text-align: center;
transition: transform var(--motion-fast) var(--ease-bounce);
}
.feature-card:hover {
transform: translateY(-4px);
}
.feature-icon {
font-size: 32px;
margin-bottom: var(--space-3);
}
.feature-title {
font-family: var(--font-display);
font-size: var(--text-base);
font-weight: 700;
color: var(--fg);
margin-bottom: var(--space-1);
}
.feature-desc {
font-size: var(--text-xs);
color: var(--muted);
line-height: 1.4;
}
/* Floating decorations on brand side */
.deco {
position: absolute;
pointer-events: none;
opacity: 0.15;
}
.deco-circle1 {
width: 200px; height: 200px; border-radius: 50%;
background: var(--accent);
top: -60px; left: -40px;
opacity: 0.08;
}
.deco-circle2 {
width: 120px; height: 120px; border-radius: 50%;
background: var(--secondary);
bottom: 80px; right: 40px;
opacity: 0.1;
}
.deco-circle3 {
width: 60px; height: 60px; border-radius: 50%;
background: var(--tertiary);
top: 140px; right: 120px;
opacity: 0.12;
}
.deco-dot1 {
width: 10px; height: 10px; border-radius: 50%; background: var(--accent);
top: 200px; left: 80px; opacity: 0.2;
}
.deco-dot2 {
width: 8px; height: 8px; border-radius: 50%; background: var(--secondary);
bottom: 200px; left: 160px; opacity: 0.2;
}
.deco-wave1 {
top: 100px; right: 80px;
}
.deco-wave1 svg { width: 40px; height: 16px; }
.deco-wave2 {
bottom: 160px; left: 120px;
}
.deco-wave2 svg { width: 30px; height: 12px; }
/* Form side content */
.form-content {
width: 360px;
display: flex;
flex-direction: column;
padding-top: 32px;
}
.form-title {
font-family: var(--font-display);
font-size: var(--text-2xl);
font-weight: 700;
color: var(--fg);
margin-bottom: var(--space-8);
}
/* Input group */
.input-group {
position: relative;
margin-bottom: var(--space-4);
}
.input-group .input-icon {
position: absolute;
left: 16px;
top: 50%;
transform: translateY(-50%);
width: 20px;
height: 20px;
color: var(--muted);
pointer-events: none;
display: flex;
align-items: center;
justify-content: center;
}
.input-group input {
width: 100%;
height: 50px;
padding: 0 16px 0 46px;
border: 1.5px solid var(--border);
border-radius: var(--radius-pill);
font-family: var(--font-body);
font-size: var(--text-base);
color: var(--fg);
background: var(--surface);
transition: border-color var(--motion-fast) var(--ease-standard);
}
.input-group input::placeholder {
color: var(--meta);
}
.input-group input:focus {
outline: none;
border-color: var(--accent);
box-shadow: 0 0 0 3px var(--shadow-input-focus);
}
/* Verification code */
.input-group.has-action input {
padding-right: 120px;
}
.input-group .input-action {
position: absolute;
right: 6px;
top: 50%;
transform: translateY(-50%);
padding: 8px 14px;
background: none;
border: none;
font-family: var(--font-body);
font-size: var(--text-sm);
font-weight: 600;
color: var(--accent);
cursor: pointer;
min-height: 38px;
border-radius: var(--radius-pill);
transition: background var(--motion-fast);
}
.input-group .input-action:hover {
background: var(--surface-warm);
}
/* Password toggle */
.input-group.has-toggle input {
padding-right: 50px;
}
.input-group .toggle-password {
position: absolute;
right: 14px;
top: 50%;
transform: translateY(-50%);
width: 24px;
height: 24px;
background: none;
border: none;
color: var(--muted);
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
padding: 0;
min-height: 36px;
min-width: 36px;
border-radius: 50%;
}
.input-group .toggle-password:hover { color: var(--fg); }
.input-group .toggle-password svg { width: 20px; height: 20px; }
/* Agreement */
.agreement {
display: flex;
align-items: flex-start;
gap: var(--space-2);
margin-bottom: var(--space-4);
font-size: var(--text-sm);
color: var(--muted);
line-height: 1.4;
}
.agreement input[type="checkbox"] {
width: 18px; height: 18px;
accent-color: var(--accent);
margin-top: 2px;
flex-shrink: 0;
cursor: pointer;
}
.agreement a {
color: var(--accent);
text-decoration: none;
font-weight: 500;
}
.agreement a:focus-visible {
box-shadow: 0 0 0 3px var(--focus-ring);
outline: none;
border-radius: 2px;
}
/* Submit button */
.btn-login {
width: 100%;
min-height: 50px;
border: none;
border-radius: var(--radius-pill);
background: var(--accent);
color: var(--bg);
font-family: var(--font-display);
font-size: 18px;
font-weight: 700;
cursor: pointer;
transition: all var(--motion-fast) var(--ease-standard);
margin-bottom: var(--space-5);
}
.btn-login:hover {
background: var(--accent-hover);
transform: translateY(-1px);
box-shadow: 0 4px 16px var(--shadow-accent-hover);
}
.btn-login:active {
background: var(--accent-active);
transform: scale(0.98);
}
/* Divider */
.divider {
display: flex;
align-items: center;
gap: var(--space-4);
margin-bottom: var(--space-5);
color: var(--meta);
font-size: var(--text-sm);
}
.divider::before,
.divider::after {
content: '';
flex: 1;
height: 1px;
background: var(--border);
}
/* Social buttons */
.social-row {
display: flex;
justify-content: center;
gap: var(--space-5);
margin-bottom: var(--space-6);
}
.social-btn {
width: 56px;
height: 56px;
border-radius: 50%;
border: 1.5px solid var(--border);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all var(--motion-fast) var(--ease-standard);
background: var(--surface);
}
.social-btn:hover {
transform: translateY(-2px);
box-shadow: var(--elev-soft);
}
.social-btn:active { transform: scale(0.95); }
.social-btn svg { width: 28px; height: 28px; }
.social-btn.wechat { background: #07C160; border-color: #07C160; }
.social-btn.wechat:hover { background: #06AD56; border-color: #06AD56; }
.social-btn.apple { background: #1D1D1F; border-color: #1D1D1F; }
.social-btn.apple:hover { background: #333; border-color: #333; }
.social-btn.google { background: var(--surface); }
/* Bottom link */
.bottom-link {
text-align: center;
font-size: var(--text-sm);
color: var(--muted);
}
.bottom-link a {
color: var(--accent);
text-decoration: none;
font-weight: 600;
cursor: pointer;
background: none;
border: none;
font-size: inherit;
font-family: inherit;
}
.bottom-link a:hover { text-decoration: underline; }
/* State toggling */
.register-fields { display: none; }
.is-register .register-fields { display: block; }
.is-register .login-only { display: none; }
/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
}
/* Animations */
@keyframes fadeIn {
from { opacity: 0; transform: translateY(12px); }
to { opacity: 1; transform: translateY(0); }
}
@keyframes float {
0%, 100% { transform: translateY(0); }
50% { transform: translateY(-8px); }
}
.anim-fade { animation: fadeIn 0.5s var(--ease-standard) both; }
.anim-float { animation: float 6s ease-in-out infinite; }
</style>
</head>
<body>
<!-- Left: Brand side (60%) -->
<div class="brand-side">
<!-- Decorative elements -->
<div class="deco deco-circle1 anim-float" aria-hidden="true" style="animation-delay: 0s"></div>
<div class="deco deco-circle2 anim-float" aria-hidden="true" style="animation-delay: 2s"></div>
<div class="deco deco-circle3 anim-float" aria-hidden="true" style="animation-delay: 1s"></div>
<div class="deco deco-dot1" aria-hidden="true"></div>
<div class="deco deco-dot2" aria-hidden="true"></div>
<div class="deco deco-wave1" aria-hidden="true">
<svg viewBox="0 0 40 16" fill="none" stroke="var(--accent)" stroke-width="2" stroke-linecap="round">
<path d="M2 10 Q10 2, 20 10 Q30 18, 38 10"/>
</svg>
</div>
<div class="deco deco-wave2" aria-hidden="true">
<svg viewBox="0 0 30 12" fill="none" stroke="var(--secondary)" stroke-width="2" stroke-linecap="round">
<path d="M2 8 Q8 2, 15 8 Q22 14, 28 8"/>
</svg>
</div>
<!-- Brand content -->
<div class="brand-content">
<div class="logo-wrap anim-fade" aria-hidden="true">
<div class="logo-notebook"></div>
<div class="logo-spine"></div>
<div class="logo-heart"></div>
</div>
<div class="brand-title anim-fade" style="animation-delay:0.1s">暖记</div>
<div class="brand-tagline anim-fade" style="animation-delay:0.15s">用温暖记录每一天</div>
<!-- Feature cards -->
<div class="feature-cards anim-fade" style="animation-delay:0.25s">
<div class="feature-card">
<div class="feature-icon" aria-hidden="true">📝</div>
<div class="feature-title">记录每一天</div>
<div class="feature-desc">用文字、贴纸和照片记录生活中的温暖瞬间</div>
</div>
<div class="feature-card">
<div class="feature-icon" aria-hidden="true">🎨</div>
<div class="feature-title">用贴纸装饰</div>
<div class="feature-desc">丰富的手绘贴纸让你的日记更加生动有趣</div>
</div>
<div class="feature-card">
<div class="feature-icon" aria-hidden="true">💭</div>
<div class="feature-title">追踪你的心情</div>
<div class="feature-desc">记录并可视化心情变化,更好地了解自己</div>
</div>
</div>
</div>
</div>
<!-- Right: Form side (40%) -->
<div class="form-side">
<!-- macOS status bar -->
<div class="statusbar" aria-hidden="true">
<div class="traffic-lights">
<div class="dot" style="background:#FF5F57"></div>
<div class="dot" style="background:#FEBC2E"></div>
<div class="dot" style="background:#28C840"></div>
</div>
<span>暖记 Warm Notes</span>
<span style="font-variant-numeric:tabular-nums">14:32</span>
</div>
<div class="form-content" id="formArea">
<h1 class="form-title anim-fade" style="animation-delay:0.2s" id="formTitle">欢迎回来</h1>
<form id="loginForm" autocomplete="on" novalidate>
<!-- Register: nickname -->
<div class="register-fields anim-fade">
<div class="input-group">
<span class="input-icon" aria-hidden="true">
<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round">
<circle cx="10" cy="7" r="4"/><path d="M3 18c0-3.3 3.1-6 7-6s7 2.7 7 6"/>
</svg>
</span>
<input type="text" id="nickname" name="nickname" placeholder="请输入昵称" autocomplete="nickname" aria-label="昵称">
</div>
</div>
<!-- Phone -->
<div class="input-group anim-fade" style="animation-delay:0.25s">
<span class="input-icon" aria-hidden="true">
<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round">
<rect x="5" y="2" width="10" height="16" rx="2"/><line x1="8" y1="15" x2="12" y2="15"/>
</svg>
</span>
<input type="tel" id="phone" name="phone" placeholder="请输入手机号" autocomplete="tel" pattern="[0-9]*" aria-label="手机号">
</div>
<!-- Register: password -->
<div class="register-fields anim-fade">
<div class="input-group has-toggle">
<span class="input-icon" aria-hidden="true">
<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round">
<rect x="3" y="9" width="14" height="9" rx="2"/><path d="M6 9V6a4 4 0 018 0v3"/>
</svg>
</span>
<input type="password" id="regPassword" name="password" placeholder="请输入密码" autocomplete="new-password" aria-label="密码">
<button type="button" class="toggle-password" aria-label="显示密码" onclick="togglePwd('regPassword', this)">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round">
<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/>
</svg>
</button>
</div>
</div>
<!-- Verification code -->
<div class="input-group has-action anim-fade" style="animation-delay:0.3s">
<span class="input-icon" aria-hidden="true">
<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round">
<rect x="2" y="4" width="16" height="12" rx="2"/><path d="M6 8v4M10 7v6M14 8v4"/>
</svg>
</span>
<input type="tel" id="code" name="code" placeholder="请输入验证码" autocomplete="one-time-code" pattern="[0-9]*" aria-label="验证码">
<button type="button" class="input-action" aria-label="获取验证码" id="getCodeBtn" onclick="sendCode()">获取验证码</button>
</div>
<!-- Register: agreement -->
<div class="register-fields anim-fade">
<label class="agreement">
<input type="checkbox" id="agreement" aria-label="同意用户协议">
<span>我已阅读并同意<a href="#" onclick="return false">《用户协议》</a><a href="#" onclick="return false">《隐私政策》</a></span>
</label>
</div>
<!-- Submit -->
<button type="submit" class="btn-login anim-fade" style="animation-delay:0.35s" id="submitBtn" aria-label="登录">登录</button>
</form>
<!-- Divider -->
<div class="divider anim-fade" style="animation-delay:0.4s">其他登录方式</div>
<!-- Social buttons -->
<div class="social-row anim-fade" style="animation-delay:0.45s">
<button type="button" class="social-btn wechat" aria-label="微信登录">
<svg viewBox="0 0 28 28" fill="none">
<path d="M19.1 12.5c-.2-3.3-3.2-5.9-6.8-5.9-3.8 0-6.9 2.8-6.9 6.3 0 1.8.9 3.4 2.3 4.5l-.6 1.8 2.1-1.1c.7.2 1.5.3 2.3.3h.4c-.1-.4-.2-.8-.2-1.2.1-2.6 2.7-4.7 5.9-4.7h.2c.1-.1.2-.1.3 0z" fill="#FFF"/>
<path d="M11.6 11.5c-.5 0-1-.4-1-1s.4-1 1-1 1 .4 1 1-.5 1-1 1zM14.8 10.5c-.5 0-1 .4-1 1s.4 1 1 1 1-.4 1-1-.5-1-1-1z" fill="#07C160"/>
<path d="M25.5 16.8c0-2.9-2.9-5.3-6.3-5.3s-6.3 2.4-6.3 5.3 2.9 5.3 6.3 5.3c.7 0 1.4-.1 2-.3l1.7.9-.5-1.5c1.3-1 2.1-2.5 2.1-4.1 0 .1 0-.1 0-.3zm-8.6-1c-.4 0-.8-.3-.8-.8s.3-.8.8-.8.8.3.8.8-.4.8-.8.8zm4.6 0c-.4 0-.8-.3-.8-.8s.3-.8.8-.8.8.3.8.8-.4.8-.8.8z" fill="#FFF"/>
</svg>
</button>
<button type="button" class="social-btn apple" aria-label="Apple登录">
<svg viewBox="0 0 28 28" fill="#FFF">
<path d="M20.2 14.3c0-2 1.2-3.1 1.3-3.2-0.7-1-1.8-1.6-3-1.6-1.3 0-2 .8-2.7.8-.7 0-1.4-.8-2.5-.8-1.7 0-3.5 1.4-3.5 4.1 0 1.6.6 3.3 1.4 4.5.7 1 1.4 1.8 2.3 1.8.9 0 1.3-.7 2.5-.7 1.2 0 1.5.7 2.5.7.9 0 1.6-.8 2.2-1.7.4-.6.7-1.2.9-1.9-2-.8-2.4-3.8-.4-5zm-1.8-3.3c.5-.6.9-1.4.8-2.2-.8 0-1.8.5-2.3 1.2-.5.6-.9 1.4-.8 2.2.8 0 1.7-.5 2.3-1.2z"/>
</svg>
</button>
<button type="button" class="social-btn google" aria-label="Google登录">
<svg viewBox="0 0 28 28">
<path d="M14 11.5v5.2h7.3c-.3 1.7-1.3 3.1-2.7 4.1l4.4 3.4c2.6-2.4 4-5.9 4-10.1 0-1-.1-1.9-.3-2.8H14z" fill="#4285F4"/>
<path d="M6.3 16.4c-.4-1-.6-2.2-.6-3.4s.2-2.3.6-3.4L1.9 6.2C.7 8.5 0 11.2 0 14s.7 5.5 1.9 7.8l4.4-3.4z" fill="#FBBC05"/>
<path d="M14 28c3.7 0 6.8-1.2 9.1-3.3l-4.4-3.4c-1.2.8-2.8 1.3-4.7 1.3-3.6 0-6.7-2.4-7.8-5.7l-4.4 3.4C4.2 24.7 8.7 28 14 28z" fill="#34A853"/>
<path d="M14 5.6c2 0 3.9.7 5.3 2l4-4C20.8 1.2 17.7 0 14 0 8.7 0 4.2 3.3 2.1 8.1l4.4 3.4c1.1-3.3 4.2-5.9 7.5-5.9z" fill="#EA4335"/>
</svg>
</button>
</div>
<!-- Bottom link -->
<div class="bottom-link anim-fade" style="animation-delay:0.5s">
<span class="login-only">还没有账号?</span>
<a href="#" id="toggleLink" role="button" aria-label="切换到注册">立即注册</a>
</div>
</div>
</div>
<script>
(function() {
var isRegister = false;
var formArea = document.getElementById('formArea');
var formTitle = document.getElementById('formTitle');
var submitBtn = document.getElementById('submitBtn');
var toggleLink = document.getElementById('toggleLink');
var phoneInput = document.getElementById('phone');
phoneInput.addEventListener('input', function() {
this.value = this.value.replace(/[^0-9]/g, '');
});
var codeInput = document.getElementById('code');
codeInput.addEventListener('input', function() {
this.value = this.value.replace(/[^0-9]/g, '');
});
toggleLink.addEventListener('click', function(e) {
e.preventDefault();
isRegister = !isRegister;
if (isRegister) {
formArea.classList.add('is-register');
formTitle.textContent = '创建账号';
submitBtn.textContent = '注册';
submitBtn.setAttribute('aria-label', '注册');
toggleLink.textContent = '立即登录';
toggleLink.setAttribute('aria-label', '切换到登录');
toggleLink.previousElementSibling.textContent = '已有账号?';
} else {
formArea.classList.remove('is-register');
formTitle.textContent = '欢迎回来';
submitBtn.textContent = '登录';
submitBtn.setAttribute('aria-label', '登录');
toggleLink.textContent = '立即注册';
toggleLink.setAttribute('aria-label', '切换到注册');
toggleLink.previousElementSibling.textContent = '还没有账号?';
}
});
document.getElementById('loginForm').addEventListener('submit', function(e) {
e.preventDefault();
});
})();
function togglePwd(inputId, btn) {
var input = document.getElementById(inputId);
if (input.type === 'password') {
input.type = 'text';
btn.setAttribute('aria-label', '隐藏密码');
btn.innerHTML = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><path d="M17.94 17.94A10.07 10.07 0 0112 20c-7 0-11-8-11-8a18.45 18.45 0 015.06-5.94M9.9 4.24A9.12 9.12 0 0112 4c7 0 11 8 11 8a18.5 18.5 0 01-2.16 3.19m-6.72-1.07a3 3 0 11-4.24-4.24"/><line x1="1" y1="1" x2="23" y2="23"/></svg>';
} else {
input.type = 'password';
btn.setAttribute('aria-label', '显示密码');
btn.innerHTML = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/></svg>';
}
}
function sendCode() {
var btn = document.getElementById('getCodeBtn');
var seconds = 60;
btn.disabled = true;
btn.style.opacity = '0.6';
btn.textContent = seconds + 's';
var timer = setInterval(function() {
seconds--;
if (seconds <= 0) {
clearInterval(timer);
btn.disabled = false;
btn.style.opacity = '1';
btn.textContent = '获取验证码';
} else {
btn.textContent = seconds + 's';
}
}, 1000);
}
</script>
<script src="../../js/theme-switcher.js"></script>
</body>
</html>

View File

@@ -0,0 +1,535 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=1440, height=900, initial-scale=1">
<title>暖记 — 桌面端搜索</title>
<link rel="stylesheet" href="../css/tokens.css">
<link rel="stylesheet" href="../css/components.css">
<link rel="stylesheet" href="shared.css">
<style>
body {
width: 1440px;
height: 900px;
overflow: hidden;
background: var(--bg);
font-family: var(--font-body);
}
.search-layout {
display: flex;
height: 900px;
padding-top: 32px;
}
.search-main {
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
}
/* Top bar */
.search-bar {
height: 64px;
display: flex;
align-items: center;
gap: var(--space-4);
padding: 0 var(--space-8);
background: var(--surface);
border-bottom: 1px solid var(--border-soft);
flex-shrink: 0;
}
.search-back-btn {
width: 38px;
height: 38px;
border-radius: var(--radius-pill);
border: none;
background: none;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
color: var(--fg);
transition: background var(--motion-fast);
}
.search-back-btn:hover { background: var(--surface-warm); }
.search-back-btn svg { width: 20px; height: 20px; }
.search-input-wrap {
flex: 1;
max-width: 680px;
position: relative;
display: flex;
align-items: center;
}
.search-input-wrap svg {
position: absolute;
left: var(--space-4);
width: 18px;
height: 18px;
color: var(--muted);
pointer-events: none;
}
.search-input {
width: 100%;
height: 44px;
border: none;
border-radius: var(--radius-pill);
background: var(--surface-warm);
padding: 0 var(--space-4) 0 44px;
font-size: var(--text-base);
color: var(--fg);
outline: none;
font-family: var(--font-body);
}
.search-input::placeholder { color: var(--meta); }
.search-cancel-btn {
border: none;
background: none;
color: var(--accent);
font-size: var(--text-base);
font-weight: 600;
cursor: pointer;
min-height: 36px;
display: flex;
align-items: center;
}
.search-cancel-btn:hover { opacity: 0.7; }
/* Content area */
.search-content {
flex: 1;
overflow-y: auto;
padding: var(--space-8) var(--space-10);
scrollbar-width: thin;
scrollbar-color: var(--border) transparent;
max-width: 1120px;
width: 100%;
}
.search-content::-webkit-scrollbar { width: 6px; }
.search-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.search-section { margin-bottom: var(--space-8); }
.search-section-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: var(--space-4);
}
.search-section-title {
font-family: var(--font-display);
font-size: var(--text-lg);
font-weight: 700;
color: var(--fg);
}
.search-section-action {
font-size: var(--text-sm);
color: var(--accent);
background: none;
border: none;
cursor: pointer;
font-weight: 500;
min-height: 36px;
display: inline-flex;
align-items: center;
}
.search-tags { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.search-tag {
padding: 8px 18px;
border-radius: var(--radius-pill);
background: var(--surface-warm);
color: var(--fg-2);
font-size: var(--text-sm);
font-weight: 500;
border: 1px solid transparent;
cursor: pointer;
min-height: 36px;
display: inline-flex;
align-items: center;
transition: all var(--motion-fast);
}
.search-tag:hover { border-color: var(--accent); color: var(--accent); }
/* Result tabs */
.result-tabs {
display: flex;
gap: var(--space-1);
margin-bottom: var(--space-6);
border-bottom: 1px solid var(--border-soft);
padding-bottom: 2px;
}
.result-tab {
padding: var(--space-3) var(--space-5);
background: none;
border: none;
font-size: var(--text-sm);
font-weight: 600;
color: var(--muted);
cursor: pointer;
min-height: 36px;
position: relative;
transition: color var(--motion-fast);
}
.result-tab.active { color: var(--accent); }
.result-tab.active::after {
content: '';
position: absolute;
bottom: -3px;
left: var(--space-5);
right: var(--space-5);
height: 3px;
border-radius: 2px;
background: var(--accent);
}
/* Three-column results */
.result-grid {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
gap: var(--space-4);
}
.result-card {
background: var(--surface);
border-radius: var(--radius-md);
padding: var(--space-4);
box-shadow: var(--elev-soft);
border: 1px solid var(--border-soft);
cursor: pointer;
transition: transform var(--motion-fast) var(--ease-standard);
}
.result-card:hover { transform: translateY(-1px); }
.result-card-top {
display: flex;
justify-content: space-between;
align-items: flex-start;
margin-bottom: 4px;
}
.result-card-title {
font-family: var(--font-display);
font-size: var(--text-base);
font-weight: 600;
color: var(--fg);
}
.result-card-title mark {
background: var(--tertiary-soft);
color: var(--accent);
border-radius: 2px;
padding: 0 2px;
}
.result-card-date {
font-size: var(--text-xs);
color: var(--muted);
white-space: nowrap;
margin-left: var(--space-3);
}
.result-card-excerpt {
font-size: var(--text-sm);
color: var(--muted);
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
line-height: 1.5;
}
.result-card-excerpt mark {
background: var(--tertiary-soft);
color: var(--accent);
border-radius: 2px;
padding: 0 2px;
}
.result-card-tags { display: flex; gap: var(--space-1); margin-top: var(--space-2); }
.result-card-tag {
font-size: var(--text-xs);
color: var(--accent);
background: var(--surface-warm);
padding: 2px 8px;
border-radius: var(--radius-pill);
}
.result-template-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: var(--space-5);
}
.result-template-card {
background: var(--surface);
border-radius: var(--radius-md);
padding: var(--space-6);
box-shadow: var(--elev-soft);
border: 1px solid var(--border-soft);
text-align: center;
cursor: pointer;
transition: all var(--motion-fast);
}
.result-template-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.result-template-icon { font-size: 40px; margin-bottom: var(--space-3); }
.result-template-name {
font-family: var(--font-display);
font-size: var(--text-sm);
font-weight: 600;
color: var(--fg);
margin-bottom: 4px;
}
.result-template-name mark {
background: var(--tertiary-soft);
color: var(--accent);
border-radius: 2px;
padding: 0 2px;
}
.result-template-desc { font-size: var(--text-xs); color: var(--muted); }
</style>
</head>
<body>
<div class="search-layout">
<!-- Sidebar -->
<nav class="sidebar" role="navigation" aria-label="主导航">
<div class="sidebar-brand">
<div class="sidebar-logo">📖</div>
<div>
<div class="sidebar-brand-text">暖记</div>
<div class="sidebar-brand-sub">Warm Notes</div>
</div>
</div>
<div class="sidebar-nav">
<button class="sidebar-nav-item">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M3 9l9-7 9 7v11a2 2 0 01-2 2H5a2 2 0 01-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/></svg>
首页
</button>
<button class="sidebar-nav-item">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><rect x="3" y="4" width="18" height="18" rx="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg>
日历
</button>
<button class="sidebar-nav-item active">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
搜索
</button>
<button class="sidebar-nav-item">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M20.84 4.61a5.5 5.5 0 00-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 00-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 000-7.78z"/></svg>
心情追踪
</button>
</div>
<div class="sidebar-footer">
<div class="sidebar-avatar">🐱</div>
<div>
<div class="sidebar-user-name">小暖</div>
<div class="sidebar-user-streak">连续记录 12 天</div>
</div>
</div>
</nav>
<div class="search-main">
<div class="search-bar">
<button class="search-back-btn" aria-label="返回">
<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M15 18l-6-6 6-6"/></svg>
</button>
<div class="search-input-wrap">
<svg viewBox="0 0 22 22" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><line x1="16" y1="16" x2="20" y2="20"/></svg>
<input class="search-input" type="text" id="searchInput" placeholder="搜索日记、模板、标签..." autocomplete="off" aria-label="搜索" autofocus>
</div>
<button class="search-cancel-btn" aria-label="取消搜索">取消</button>
</div>
<div class="search-content">
<!-- Before-search state -->
<div id="searchBefore">
<div class="search-section">
<div class="search-section-header">
<span class="search-section-title">最近搜索</span>
<button class="search-section-action" aria-label="清除搜索历史">清除</button>
</div>
<div class="search-tags">
<button class="search-tag" aria-label="搜索 期末考试">期末考试</button>
<button class="search-tag" aria-label="搜索 读书笔记">读书笔记</button>
<button class="search-tag" aria-label="搜索 旅行计划">旅行计划</button>
<button class="search-tag" aria-label="搜索 心情">心情</button>
</div>
</div>
<div class="search-section">
<div class="search-section-header">
<span class="search-section-title">热门搜索</span>
</div>
<div class="search-tags">
<button class="search-tag" aria-label="搜索 期末">#期末</button>
<button class="search-tag" aria-label="搜索 读书">#读书</button>
<button class="search-tag" aria-label="搜索 心情">#心情</button>
<button class="search-tag" aria-label="搜索 旅行">#旅行</button>
<button class="search-tag" aria-label="搜索 美食">#美食</button>
<button class="search-tag" aria-label="搜索 学习">#学习</button>
<button class="search-tag" aria-label="搜索 运动">#运动</button>
<button class="search-tag" aria-label="搜索 灵感">#灵感</button>
</div>
</div>
</div>
<!-- Search results -->
<div id="searchResults" style="display:none">
<div class="result-tabs" role="tablist">
<button class="result-tab active" role="tab" aria-label="全部结果" aria-selected="true">全部</button>
<button class="result-tab" role="tab" aria-label="日记结果" aria-selected="false">日记</button>
<button class="result-tab" role="tab" aria-label="模板结果" aria-selected="false">模板</button>
<button class="result-tab" role="tab" aria-label="标签结果" aria-selected="false">标签</button>
</div>
<div id="resultDiary">
<div class="result-grid">
<div class="result-card" aria-label="打开日记 期末考试周复习计划">
<div class="result-card-top">
<span class="result-card-title">期末<mark>考试</mark>周复习计划</span>
<span class="result-card-date">2025年12月15日</span>
</div>
<div class="result-card-excerpt">今天开始了为期两周的期末<mark>考试</mark>复习,列了详细的计划表,每一科都安排了时间...</div>
<div class="result-card-tags">
<span class="result-card-tag">#学习</span>
<span class="result-card-tag">#期末</span>
</div>
</div>
<div class="result-card" aria-label="打开日记 考研倒计时30天">
<div class="result-card-top">
<span class="result-card-title">考研倒计时30天</span>
<span class="result-card-date">2025年11月25日</span>
</div>
<div class="result-card-excerpt">距离考研还有30天今天复习了英语阅读和政治感觉<mark>考试</mark>越来越近了...</div>
<div class="result-card-tags">
<span class="result-card-tag">#学习</span>
<span class="result-card-tag">#考研</span>
</div>
</div>
<div class="result-card" aria-label="打开日记 考试后的放松手账">
<div class="result-card-top">
<span class="result-card-title"><mark>考试</mark>后的放松手账</span>
<span class="result-card-date">2025年6月20日</span>
</div>
<div class="result-card-excerpt">终于考完试了!用手账记录了<mark>考试</mark>结束那一刻的心情,画了一幅小小的庆祝插画...</div>
<div class="result-card-tags">
<span class="result-card-tag">#心情</span>
<span class="result-card-tag">#手账</span>
</div>
</div>
<div class="result-card" aria-label="打开日记 图书馆的午后">
<div class="result-card-top">
<span class="result-card-title">图书馆的午后</span>
<span class="result-card-date">2025年5月30日</span>
</div>
<div class="result-card-excerpt">今天在图书馆自习,窗外的阳光洒进来,暖暖的。复习了高数第三章...</div>
<div class="result-card-tags">
<span class="result-card-tag">#日常</span>
<span class="result-card-tag">#学习</span>
</div>
</div>
<div class="result-card" aria-label="打开日记 和舍友的火锅局">
<div class="result-card-top">
<span class="result-card-title">和舍友的火锅局</span>
<span class="result-card-date">2025年5月29日</span>
</div>
<div class="result-card-excerpt">考完试和舍友们去吃了火锅庆祝,大家都好开心,聊了很多有趣的事...</div>
<div class="result-card-tags">
<span class="result-card-tag">#美食</span>
<span class="result-card-tag">#心情</span>
</div>
</div>
<div class="result-card" aria-label="打开日记 期末考试第一天">
<div class="result-card-top">
<span class="result-card-title">期末<mark>考试</mark>第一天</span>
<span class="result-card-date">2025年5月28日</span>
</div>
<div class="result-card-excerpt">终于考完了英语,感觉发挥还可以。明天继续加油!给自己打个气...</div>
<div class="result-card-tags">
<span class="result-card-tag">#学习</span>
<span class="result-card-tag">#期末</span>
</div>
</div>
</div>
</div>
<div id="resultTemplates" style="display:none">
<div class="result-template-grid">
<div class="result-template-card" aria-label="使用模板 考试复习计划">
<div class="result-template-icon">📝</div>
<div class="result-template-name"><mark>考试</mark>复习计划</div>
<div class="result-template-desc">适合期末<mark>考试</mark>周使用</div>
</div>
<div class="result-template-card" aria-label="使用模板 学习打卡">
<div class="result-template-icon">📚</div>
<div class="result-template-name">学习打卡</div>
<div class="result-template-desc">每日学习记录模板</div>
</div>
<div class="result-template-card" aria-label="使用模板 成绩分析">
<div class="result-template-icon">📊</div>
<div class="result-template-name">成绩分析</div>
<div class="result-template-desc"><mark>考试</mark>成绩复盘模板</div>
</div>
<div class="result-template-card" aria-label="使用模板 目标追踪">
<div class="result-template-icon">🎯</div>
<div class="result-template-name">目标追踪</div>
<div class="result-template-desc">学期目标追踪模板</div>
</div>
</div>
</div>
<div id="resultTags" style="display:none">
<div class="search-tags" style="gap: var(--space-3);">
<button class="search-tag" style="padding: 12px 24px; font-size: var(--text-base);" aria-label="搜索标签 考试">#考试 (3篇)</button>
<button class="search-tag" style="padding: 12px 24px; font-size: var(--text-base);" aria-label="搜索标签 考研">#考研 (2篇)</button>
<button class="search-tag" style="padding: 12px 24px; font-size: var(--text-base);" aria-label="搜索标签 考试周">#考试周 (1篇)</button>
<button class="search-tag" style="padding: 12px 24px; font-size: var(--text-base);" aria-label="搜索标签 复习">#复习 (5篇)</button>
<button class="search-tag" style="padding: 12px 24px; font-size: var(--text-base);" aria-label="搜索标签 期末">#期末 (4篇)</button>
<button class="search-tag" style="padding: 12px 24px; font-size: var(--text-base);" aria-label="搜索标签 学习">#学习 (8篇)</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="desktop-statusbar">
<div class="traffic-lights"><div class="dot" style="background:#FF5F57"></div><div class="dot" style="background:#FEBC2E"></div><div class="dot" style="background:#28C840"></div></div>
<span>暖记 — 搜索日记</span>
<span style="font-variant-numeric:tabular-nums">14:32</span>
</div>
<script>
var input = document.getElementById('searchInput');
var beforeEl = document.getElementById('searchBefore');
var resultsEl = document.getElementById('searchResults');
var resultTabs = document.querySelectorAll('.result-tab');
var panels = ['resultDiary', 'resultTemplates', 'resultTags'];
input.addEventListener('input', function() {
if (this.value.trim().length > 0) {
beforeEl.style.display = 'none';
resultsEl.style.display = '';
} else {
beforeEl.style.display = '';
resultsEl.style.display = 'none';
}
});
document.querySelectorAll('.search-tag').forEach(function(tag) {
tag.addEventListener('click', function() {
input.value = this.textContent.trim();
input.dispatchEvent(new Event('input'));
});
});
resultTabs.forEach(function(tab, idx) {
tab.addEventListener('click', function() {
resultTabs.forEach(function(t) { t.classList.remove('active'); t.setAttribute('aria-selected', 'false'); });
tab.classList.add('active');
tab.setAttribute('aria-selected', 'true');
panels.forEach(function(p, i) {
document.getElementById(p).style.display = i === idx ? '' : 'none';
});
});
});
input.focus();
</script>
<script src="../../js/theme-switcher.js"></script>
</body>
</html>

View File

@@ -0,0 +1,312 @@
/* ─────────────────────────────────────────────────────────
* 暖记 — 桌面端 (1440×900) 共享布局组件
* ───────────────────────────────────────────────────────── */
/* Desktop sidebar (wider) */
.sidebar {
position: fixed;
left: 0;
top: 0;
bottom: 0;
width: 280px;
background: var(--surface);
border-right: 1px solid var(--border-soft);
display: flex;
flex-direction: column;
z-index: 100;
padding: var(--space-6) 0;
}
.sidebar-brand {
display: flex;
align-items: center;
gap: var(--space-4);
padding: 0 var(--space-6);
margin-bottom: var(--space-10);
}
.sidebar-logo {
width: 48px;
height: 48px;
border-radius: var(--radius-md);
background: linear-gradient(135deg, var(--accent), var(--tertiary));
display: flex;
align-items: center;
justify-content: center;
font-size: 24px;
}
.sidebar-brand-text {
font-family: var(--font-display);
font-size: var(--text-2xl);
font-weight: 700;
color: var(--fg);
}
.sidebar-brand-sub {
font-size: var(--text-xs);
color: var(--muted);
}
.sidebar-nav {
flex: 1;
display: flex;
flex-direction: column;
gap: 2px;
padding: 0 var(--space-4);
}
.sidebar-nav-item {
display: flex;
align-items: center;
gap: var(--space-3);
padding: var(--space-3) var(--space-5);
border-radius: var(--radius-sm);
font-size: var(--text-md);
font-weight: 500;
color: var(--muted);
cursor: pointer;
border: none;
background: none;
width: 100%;
text-align: left;
transition: all var(--motion-fast) var(--ease-standard);
}
.sidebar-nav-item:hover {
background: var(--surface-warm);
color: var(--fg);
}
.sidebar-nav-item.active {
background: var(--surface-warm);
color: var(--accent);
font-weight: 600;
}
.sidebar-nav-item svg {
width: 22px;
height: 22px;
flex-shrink: 0;
}
.sidebar-write-btn {
margin: var(--space-5) var(--space-5);
padding: var(--space-4) var(--space-6);
min-height: 36px;
background: var(--accent);
color: var(--accent-on);
border: none;
border-radius: var(--radius-md);
font-family: var(--font-display);
font-size: var(--text-md);
font-weight: 600;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
gap: var(--space-3);
transition: all var(--motion-fast) var(--ease-bounce);
box-shadow: var(--shadow-accent);
}
.sidebar-write-btn:hover {
transform: translateY(-2px);
box-shadow: var(--shadow-accent-hover);
}
.sidebar-write-btn:active { transform: scale(0.97); }
.sidebar-write-btn svg { width: 20px; height: 20px; }
.sidebar-footer {
padding: var(--space-4) var(--space-6);
border-top: 1px solid var(--border-soft);
display: flex;
align-items: center;
gap: var(--space-3);
}
.sidebar-avatar {
width: 40px;
height: 40px;
border-radius: 50%;
background: var(--secondary-soft);
display: flex;
align-items: center;
justify-content: center;
font-size: 18px;
}
.sidebar-user-name {
font-size: var(--text-base);
font-weight: 600;
color: var(--fg);
}
.sidebar-user-streak {
font-size: var(--text-xs);
color: var(--muted);
}
/* Main content area */
.main-content {
margin-left: 280px;
height: 100vh;
overflow-y: auto;
background: var(--bg);
scrollbar-width: thin;
scrollbar-color: var(--border) transparent;
}
.main-content::-webkit-scrollbar { width: 6px; }
.main-content::-webkit-scrollbar-track { background: transparent; }
.main-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
/* Desktop top bar */
.desktop-topbar {
position: sticky;
top: 0;
background: var(--bg-frosted);
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
border-bottom: 1px solid var(--border-soft);
padding: var(--space-4) var(--space-10);
display: flex;
align-items: center;
justify-content: space-between;
z-index: 50;
}
.desktop-topbar-title {
font-family: var(--font-display);
font-size: var(--text-lg);
font-weight: 700;
color: var(--fg);
}
.desktop-topbar-actions {
display: flex;
align-items: center;
gap: var(--space-3);
}
.topbar-action-btn {
width: 38px;
height: 38px;
border-radius: var(--radius-pill);
border: 1px solid var(--border);
background: var(--surface);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
color: var(--fg);
transition: all var(--motion-fast);
}
.topbar-action-btn:hover {
border-color: var(--accent);
color: var(--accent);
}
.topbar-action-btn svg { width: 18px; height: 18px; }
/* Three-column layout */
.three-col {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
gap: var(--space-5);
}
/* Two-column wider */
.two-col-wide {
display: grid;
grid-template-columns: 2fr 1fr;
gap: var(--space-6);
}
.content-inner {
padding: var(--space-8) var(--space-10);
max-width: 1120px;
}
/* Page header */
.page-header {
margin-bottom: var(--space-6);
}
.page-header h1 {
font-family: var(--font-display);
font-size: var(--text-3xl);
font-weight: 700;
color: var(--fg);
}
.page-header-sub {
font-size: var(--text-base);
color: var(--muted);
margin-top: var(--space-1);
}
/* Desktop status bar */
.desktop-statusbar {
position: fixed;
top: 0;
left: 280px;
right: 0;
height: 32px;
background: var(--surface);
border-bottom: 1px solid var(--border-soft);
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 var(--space-6);
font-size: 13px;
color: var(--muted);
font-weight: 500;
z-index: 60;
}
.desktop-statusbar .traffic-lights {
display: flex;
gap: 8px;
}
.desktop-statusbar .dot {
width: 12px;
height: 12px;
border-radius: 50%;
}
/* Focus visible styles for accessibility */
button:focus-visible,
a:focus-visible,
[role="button"]:focus-visible {
box-shadow: var(--focus-ring);
outline: none;
}
/* Desktop button minimum size */
button,
[role="button"] {
min-height: 36px;
}
/* Desktop hover enhancements */
.topbar-action-btn:hover {
transform: translateY(-1px);
}
.sidebar-nav-item:hover {
transform: translateX(2px);
}
/* Window overflow handling for narrow viewports */
.main-content {
min-width: 0;
overflow-x: hidden;
}
.content-inner {
min-width: 0;
}

View File

@@ -0,0 +1,555 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=390, height=844, initial-scale=1, viewport-fit=cover">
<title>暖记 — 发现</title>
<link href="https://fonts.googleapis.com/css2?family=Caveat:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="../css/tokens.css">
<link rel="stylesheet" href="../css/components.css">
<style>
body {
width: 390px;
height: 844px;
overflow: hidden;
background: var(--bg);
position: relative;
}
.content-area {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: calc(var(--tab-height) + var(--safe-bottom));
overflow-y: auto;
padding: 0 var(--space-5);
padding-top: calc(var(--safe-top) + var(--space-2));
scrollbar-width: none;
}
.content-area::-webkit-scrollbar { display: none; }
/* Search bar */
.search-bar {
display: flex;
align-items: center;
gap: var(--space-3);
background: var(--surface);
border-radius: var(--radius-pill);
padding: var(--space-3) var(--space-4);
margin-bottom: var(--space-5);
border: 1px solid var(--border-soft);
box-shadow: var(--elev-soft);
transition: border-color var(--motion-fast) var(--ease-standard);
}
.search-bar:focus-within {
border-color: var(--accent);
}
.search-bar svg {
width: 20px;
height: 20px;
color: var(--muted);
flex-shrink: 0;
}
.search-bar input {
flex: 1;
border: none;
background: none;
font-family: var(--font-body);
font-size: var(--text-base);
color: var(--fg);
outline: none;
}
.search-bar input::placeholder {
color: var(--meta);
}
/* Daily inspiration card */
.inspiration-card {
background: linear-gradient(135deg, var(--accent) 0%, var(--tertiary) 100%);
border-radius: var(--radius-lg);
padding: var(--space-5);
margin-bottom: var(--space-5);
position: relative;
overflow: hidden;
cursor: pointer;
transition: transform var(--motion-fast) var(--ease-bounce);
}
.inspiration-card:hover { transform: translateY(-2px); }
.inspiration-card:active { transform: scale(0.98); }
.inspiration-card::before {
content: '';
position: absolute;
top: -30px;
right: -30px;
width: 120px;
height: 120px;
border-radius: 50%;
background: rgba(255,255,255,0.12);
}
.inspiration-card::after {
content: '';
position: absolute;
bottom: -20px;
left: 30px;
width: 80px;
height: 80px;
border-radius: 50%;
background: rgba(255,255,255,0.08);
}
.inspiration-label {
font-size: var(--text-xs);
color: rgba(255,255,255,0.7);
font-weight: 500;
margin-bottom: var(--space-2);
text-transform: uppercase;
letter-spacing: 0.5px;
}
.inspiration-body {
display: flex;
gap: var(--space-4);
align-items: center;
}
.inspiration-thumb {
width: 80px;
height: 80px;
border-radius: var(--radius-sm);
background: rgba(255,255,255,0.2);
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
font-size: 36px;
backdrop-filter: blur(4px);
}
.inspiration-info {
flex: 1;
min-width: 0;
position: relative;
z-index: 1;
}
.inspiration-title {
font-family: var(--font-display);
font-size: var(--text-lg);
font-weight: 700;
color: white;
margin-bottom: var(--space-1);
}
.inspiration-author {
font-size: var(--text-sm);
color: rgba(255,255,255,0.75);
}
/* Topics section */
.topics-section {
margin-bottom: var(--space-5);
}
.topics-scroll {
display: flex;
gap: var(--space-2);
overflow-x: auto;
scrollbar-width: none;
padding-bottom: var(--space-2);
}
.topics-scroll::-webkit-scrollbar { display: none; }
.topic-chip {
display: inline-flex;
align-items: center;
gap: var(--space-1);
padding: var(--space-2) var(--space-4);
border-radius: var(--radius-pill);
font-size: var(--text-sm);
font-weight: 500;
white-space: nowrap;
cursor: pointer;
border: 1px solid var(--border);
background: var(--surface);
color: var(--fg-2);
transition: all var(--motion-fast) var(--ease-standard);
min-height: var(--touch-min);
box-shadow: var(--elev-soft);
}
.topic-chip:hover {
border-color: var(--accent);
color: var(--accent);
}
.topic-chip:focus-visible {
box-shadow: var(--focus-ring);
outline: none;
}
.topic-chip.active {
background: var(--accent);
color: var(--accent-on);
border-color: var(--accent);
}
.topic-chip .emoji {
font-size: 16px;
}
/* Templates grid */
.templates-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: var(--space-3);
margin-bottom: var(--space-5);
}
.template-card {
background: var(--surface);
border-radius: var(--radius-md);
overflow: hidden;
box-shadow: var(--elev-soft);
border: 1px solid var(--border-soft);
cursor: pointer;
transition: transform var(--motion-fast) var(--ease-standard);
}
.template-card:hover { transform: translateY(-2px); }
.template-card:active { transform: scale(0.97); }
.template-thumb {
height: 96px;
display: flex;
align-items: center;
justify-content: center;
font-size: 32px;
}
.template-info {
padding: var(--space-3);
}
.template-name {
font-family: var(--font-display);
font-size: var(--text-sm);
font-weight: 600;
color: var(--fg);
margin-bottom: var(--space-1);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.template-users {
font-size: var(--text-xs);
color: var(--muted);
display: flex;
align-items: center;
gap: 4px;
}
.template-users svg {
width: 12px;
height: 12px;
}
/* Experts diary list */
.experts-list {
display: flex;
flex-direction: column;
gap: var(--space-3);
margin-bottom: var(--space-6);
}
.expert-card {
background: var(--surface);
border-radius: var(--radius-md);
padding: var(--space-4);
box-shadow: var(--elev-soft);
border: 1px solid var(--border-soft);
display: flex;
gap: var(--space-3);
cursor: pointer;
transition: transform var(--motion-fast) var(--ease-standard);
}
.expert-card:hover { transform: translateY(-1px); }
.expert-card:active { transform: scale(0.98); }
.expert-avatar {
width: 44px;
height: 44px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 20px;
flex-shrink: 0;
}
.expert-info {
flex: 1;
min-width: 0;
}
.expert-name {
font-size: var(--text-xs);
color: var(--muted);
margin-bottom: 2px;
}
.expert-title {
font-family: var(--font-display);
font-size: var(--text-base);
font-weight: 600;
color: var(--fg);
margin-bottom: 4px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.expert-preview {
font-size: var(--text-sm);
color: var(--muted);
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
line-height: 1.5;
}
.expert-likes {
display: flex;
align-items: center;
gap: 4px;
font-size: var(--text-xs);
color: var(--muted);
flex-shrink: 0;
margin-top: 2px;
}
.expert-likes svg {
width: 14px;
height: 14px;
color: var(--rose);
}
/* Empty state */
.empty-state {
display: none;
flex-direction: column;
align-items: center;
justify-content: center;
padding: var(--space-10) var(--space-5);
text-align: center;
}
.empty-state.visible {
display: flex;
}
.empty-state .icon {
font-size: 48px;
margin-bottom: var(--space-4);
opacity: 0.6;
}
.empty-state .text {
font-family: var(--font-display);
font-size: var(--text-md);
font-weight: 600;
color: var(--fg-2);
margin-bottom: var(--space-2);
}
.empty-state .subtext {
font-size: var(--text-sm);
color: var(--muted);
}
/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
.inspiration-card,
.template-card,
.expert-card,
.topic-chip {
transition: none;
}
.anim-fade,
.anim-slide {
animation: none;
}
}
</style>
</head>
<body>
<div class="content-area">
<!-- Search bar -->
<div class="search-bar anim-fade" data-od-id="discover-search">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true">
<circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/>
</svg>
<input type="text" placeholder="搜索日记、模板、话题..." aria-label="搜索日记、模板、话题">
</div>
<!-- Empty state (shown when search has no results) -->
<div class="empty-state" data-od-id="discover-empty" role="status">
<span class="icon" aria-hidden="true">🔍</span>
<div class="text">没有找到相关内容</div>
<div class="subtext">换个关键词试试吧</div>
</div>
<!-- Discover content -->
<div id="discover-content">
<!-- Daily inspiration -->
<section data-od-id="discover-inspiration" class="anim-fade" style="animation-delay: 0.1s">
<div class="section-heading">
<h3>每日灵感</h3>
<button class="more" aria-label="查看更多灵感">更多</button>
</div>
<div class="inspiration-card" role="article" aria-label="今日灵感推荐:旅行手账排版技巧">
<div class="inspiration-label">今日推荐</div>
<div class="inspiration-body">
<div class="inspiration-thumb" aria-hidden="true">🗺️</div>
<div class="inspiration-info">
<div class="inspiration-title">旅行手账排版技巧</div>
<div class="inspiration-author">by 手账达人小林</div>
</div>
</div>
</div>
</section>
<!-- Hot topics -->
<section class="topics-section" data-od-id="discover-topics" aria-label="热门话题">
<div class="section-heading anim-fade" style="animation-delay: 0.15s">
<h3>热门话题</h3>
<button class="more" aria-label="查看更多话题">更多</button>
</div>
<div class="topics-scroll anim-fade" style="animation-delay: 0.2s" role="list">
<button class="topic-chip active" role="listitem" aria-label="话题:期末备考">
<span class="emoji" aria-hidden="true">📚</span>#期末备考
</button>
<button class="topic-chip" role="listitem" aria-label="话题:读书笔记">
<span class="emoji" aria-hidden="true">📖</span>#读书笔记
</button>
<button class="topic-chip" role="listitem" aria-label="话题:旅行手账">
<span class="emoji" aria-hidden="true">✈️</span>#旅行手账
</button>
<button class="topic-chip" role="listitem" aria-label="话题:美食记录">
<span class="emoji" aria-hidden="true">🍜</span>#美食记录
</button>
<button class="topic-chip" role="listitem" aria-label="话题:校园生活">
<span class="emoji" aria-hidden="true">🎓</span>#校园生活
</button>
<button class="topic-chip" role="listitem" aria-label="话题:自我成长">
<span class="emoji" aria-hidden="true">🌱</span>#自我成长
</button>
</div>
</section>
<!-- Featured templates -->
<section data-od-id="discover-templates" aria-label="精选模板">
<div class="section-heading anim-fade" style="animation-delay: 0.25s">
<h3>精选模板</h3>
<button class="more" aria-label="查看更多模板">更多</button>
</div>
<div class="templates-grid anim-fade" style="animation-delay: 0.3s">
<div class="template-card" role="article" aria-label="模板:考试周复习计划">
<div class="template-thumb" style="background: var(--tertiary-soft)" aria-hidden="true">📝</div>
<div class="template-info">
<div class="template-name">考试周复习计划</div>
<div class="template-users">
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><path d="M10 3a3 3 0 11-6 0 3 3 0 016 0zM2 14v-1a4 4 0 014-4h4a4 4 0 014 4v1"/></svg>
2.3k 人使用
</div>
</div>
</div>
<div class="template-card" role="article" aria-label="模板:读书笔记手账">
<div class="template-thumb" style="background: var(--secondary-soft)" aria-hidden="true">📖</div>
<div class="template-info">
<div class="template-name">读书笔记手账</div>
<div class="template-users">
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><path d="M10 3a3 3 0 11-6 0 3 3 0 016 0zM2 14v-1a4 4 0 014-4h4a4 4 0 014 4v1"/></svg>
1.8k 人使用
</div>
</div>
</div>
<div class="template-card" role="article" aria-label="模板:月度心情打卡">
<div class="template-thumb" style="background: var(--rose-soft)" aria-hidden="true">💫</div>
<div class="template-info">
<div class="template-name">月度心情打卡</div>
<div class="template-users">
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><path d="M10 3a3 3 0 11-6 0 3 3 0 016 0zM2 14v-1a4 4 0 014-4h4a4 4 0 014 4v1"/></svg>
3.1k 人使用
</div>
</div>
</div>
<div class="template-card" role="article" aria-label="模板:旅行日记模板">
<div class="template-thumb" style="background: var(--surface-warm)" aria-hidden="true">🗺️</div>
<div class="template-info">
<div class="template-name">旅行日记模板</div>
<div class="template-users">
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><path d="M10 3a3 3 0 11-6 0 3 3 0 016 0zM2 14v-1a4 4 0 014-4h4a4 4 0 014 4v1"/></svg>
1.5k 人使用
</div>
</div>
</div>
</div>
</section>
<!-- Expert diaries -->
<section data-od-id="discover-experts" aria-label="达人日记">
<div class="section-heading anim-fade" style="animation-delay: 0.35s">
<h3>达人日记</h3>
<button class="more" aria-label="查看更多达人日记">更多</button>
</div>
<div class="experts-list anim-fade" style="animation-delay: 0.4s">
<div class="expert-card" role="article" aria-label="达人日记我的大学生活第100天">
<div class="expert-avatar" style="background: var(--tertiary-soft)" aria-hidden="true">🌸</div>
<div class="expert-info">
<div class="expert-name">小暖</div>
<div class="expert-title">我的大学生活第100天</div>
<div class="expert-preview">不知不觉大学生活已经过了100天了从最初的迷茫到现在的适应记录下这段珍贵的时光...</div>
</div>
<div class="expert-likes">
<svg viewBox="0 0 16 16" fill="currentColor"><path d="M8 14s-5.5-3.5-5.5-7.5C2.5 3.5 4 2 5.75 2 6.86 2 7.86 2.56 8 3.5 8.14 2.56 9.14 2 10.25 2 12 2 13.5 3.5 13.5 6.5 13.5 10.5 8 14 8 14z"/></svg>
328
</div>
</div>
<div class="expert-card" role="article" aria-label="达人日记考研倒计时30天手账">
<div class="expert-avatar" style="background: var(--secondary-soft)" aria-hidden="true">✏️</div>
<div class="expert-info">
<div class="expert-name">手账少女</div>
<div class="expert-title">考研倒计时30天手账</div>
<div class="expert-preview">最后冲刺阶段,用手账记录每一天的复习进度和心情变化,给自己加油打气...</div>
</div>
<div class="expert-likes">
<svg viewBox="0 0 16 16" fill="currentColor"><path d="M8 14s-5.5-3.5-5.5-7.5C2.5 3.5 4 2 5.75 2 6.86 2 7.86 2.56 8 3.5 8.14 2.56 9.14 2 10.25 2 12 2 13.5 3.5 13.5 6.5 13.5 10.5 8 14 8 14z"/></svg>
512
</div>
</div>
<div class="expert-card" role="article" aria-label="达人日记:秋日校园手账记录">
<div class="expert-avatar" style="background: var(--rose-soft)" aria-hidden="true">🍂</div>
<div class="expert-info">
<div class="expert-name">阿月</div>
<div class="expert-title">秋日校园手账记录</div>
<div class="expert-preview">银杏叶黄了,校园美得像画一样。收集了几片落叶夹在手账里,记录这个温柔的秋天...</div>
</div>
<div class="expert-likes">
<svg viewBox="0 0 16 16" fill="currentColor"><path d="M8 14s-5.5-3.5-5.5-7.5C2.5 3.5 4 2 5.75 2 6.86 2 7.86 2.56 8 3.5 8.14 2.56 9.14 2 10.25 2 12 2 13.5 3.5 13.5 6.5 13.5 10.5 8 14 8 14z"/></svg>
276
</div>
</div>
</div>
</section>
<div style="height: var(--space-6)"></div>
</div>
</div>
<!-- Bottom Tab Bar -->
<nav class="tab-bar" aria-label="底部导航">
<button class="tab-item" aria-label="首页">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M3 9l9-7 9 7v11a2 2 0 01-2 2H5a2 2 0 01-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/></svg>
<span>首页</span>
</button>
<button class="tab-item" aria-label="日历">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><rect x="3" y="4" width="18" height="18" rx="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg>
<span>日历</span>
</button>
<button class="tab-item" style="position:relative" aria-label="写日记">
<div style="width:44px;height:44px;border-radius:50%;background:var(--accent);display:flex;align-items:center;justify-content:center;margin-top:-16px;box-shadow:0 4px 12px var(--shadow-accent)">
<svg viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2.5" stroke-linecap="round" style="width:22px;height:22px"><path d="M12 5v14M5 12h14"/></svg>
</div>
<span style="margin-top:2px">写日记</span>
</button>
<button class="tab-item active" aria-label="发现">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
<span>发现</span>
</button>
<button class="tab-item" aria-label="我的">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2"/><circle cx="12" cy="7" r="4"/></svg>
<span>我的</span>
</button>
</nav>
<div class="dynamic-island"></div>
<div class="home-indicator" style="position:absolute;bottom:8px;left:50%;transform:translateX(-50%);z-index:101"></div>
<script src="../js/theme-switcher.js"></script>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,519 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=390, height=844, initial-scale=1, viewport-fit=cover">
<title>暖记 — 首页日记流</title>
<link href="https://fonts.googleapis.com/css2?family=Caveat:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="../css/tokens.css">
<link rel="stylesheet" href="../css/components.css">
<style>
body {
width: 390px;
height: 844px;
overflow: hidden;
background: var(--bg);
position: relative;
}
/* Global focus styles */
button:focus-visible, a:focus-visible, [role="tab"]:focus-visible {
box-shadow: 0 0 0 3px var(--focus-ring);
outline: none;
}
.content-area {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: calc(var(--tab-height) + var(--safe-bottom));
overflow-y: auto;
padding: 0 var(--space-5);
padding-top: calc(var(--safe-top) + var(--space-2));
scrollbar-width: none;
}
.content-area::-webkit-scrollbar { display: none; }
/* Greeting header */
.greeting {
margin-bottom: var(--space-5);
display: flex;
align-items: flex-start;
justify-content: space-between;
}
.greeting-left {
flex: 1;
}
.greeting-date {
font-size: var(--text-sm);
color: var(--muted);
font-weight: 500;
margin-bottom: var(--space-1);
}
.greeting-text {
font-family: var(--font-display);
font-size: var(--text-2xl);
font-weight: 700;
color: var(--fg);
}
.greeting-text span { color: var(--accent); }
.greeting-search-btn {
width: 44px;
height: 44px;
border-radius: var(--radius-pill);
border: none;
background: var(--surface);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
color: var(--fg-2);
box-shadow: var(--elev-soft);
border: 1px solid var(--border-soft);
transition: all var(--motion-fast);
flex-shrink: 0;
margin-top: var(--space-3);
}
.greeting-search-btn:hover { color: var(--accent); border-color: var(--accent); }
.greeting-search-btn svg { width: 20px; height: 20px; }
/* Mood quick-select */
.mood-section {
background: var(--surface);
border-radius: var(--radius-md);
padding: var(--space-4) var(--space-5);
margin-bottom: var(--space-5);
box-shadow: var(--elev-soft);
border: 1px solid var(--border-soft);
}
.mood-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: var(--space-3);
}
.mood-header span {
font-family: var(--font-handwritten);
font-size: var(--text-md);
font-weight: 600;
color: var(--fg-2);
}
.mood-header .weather {
font-size: var(--text-sm);
color: var(--muted);
display: flex;
align-items: center;
gap: 4px;
}
.mood-options {
display: flex;
justify-content: space-between;
}
.mood-opt {
display: flex;
flex-direction: column;
align-items: center;
gap: 4px;
background: none;
border: none;
cursor: pointer;
padding: var(--space-2);
border-radius: var(--radius-sm);
min-width: 44px;
min-height: 44px;
transition: all var(--motion-fast) var(--ease-bounce);
}
.mood-opt:hover { background: var(--surface-warm); }
.mood-opt.selected { background: var(--surface-warm); }
.mood-opt .face { font-size: 28px; }
.mood-opt .label { font-size: 11px; color: var(--muted); }
.mood-opt.selected .label { color: var(--accent); font-weight: 600; }
/* Today's journal entry card */
.today-card {
background: linear-gradient(135deg, var(--accent) 0%, var(--tertiary) 100%);
border-radius: var(--radius-lg);
padding: var(--space-6);
margin-bottom: var(--space-5);
position: relative;
overflow: hidden;
cursor: pointer;
transition: transform var(--motion-fast) var(--ease-bounce);
}
.today-card:hover { transform: translateY(-2px); }
.today-card:active { transform: scale(0.98); }
.today-card::before {
content: '';
position: absolute;
top: -30px;
right: -30px;
width: 120px;
height: 120px;
border-radius: 50%;
background: rgba(255,255,255,0.12);
}
.today-card::after {
content: '';
position: absolute;
bottom: -20px;
left: 40px;
width: 80px;
height: 80px;
border-radius: 50%;
background: rgba(255,255,255,0.08);
}
.today-card .label {
font-family: var(--font-handwritten);
font-size: var(--text-sm);
color: rgba(255,248,240,0.85);
font-weight: 600;
margin-bottom: var(--space-2);
}
.today-card .title {
font-family: var(--font-display);
font-size: var(--text-xl);
font-weight: 700;
color: var(--accent-on);
margin-bottom: var(--space-2);
}
.today-card .prompt {
font-size: var(--text-sm);
color: rgba(255,248,240,0.75);
}
.today-card .write-btn {
position: absolute;
bottom: var(--space-5);
right: var(--space-5);
width: 48px;
height: 48px;
border-radius: 50%;
background: white;
border: none;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
cursor: pointer;
transition: transform var(--motion-fast) var(--ease-bounce);
}
.today-card .write-btn:hover { transform: scale(1.1); }
.today-card .write-btn svg { width: 22px; height: 22px; color: var(--accent); }
/* Recent entries */
.recent-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: var(--space-4);
}
.recent-header h3 {
font-family: var(--font-display);
font-size: var(--text-lg);
font-weight: 700;
}
.recent-header a {
font-size: var(--text-sm);
color: var(--accent);
text-decoration: none;
font-weight: 500;
min-height: 44px;
display: inline-flex;
align-items: center;
}
.entry-card {
background: var(--surface);
border-radius: var(--radius-md);
padding: var(--space-4);
margin-bottom: var(--space-3);
box-shadow: var(--elev-soft);
border: 1px solid var(--border-soft);
display: flex;
gap: var(--space-4);
cursor: pointer;
transition: transform var(--motion-fast) var(--ease-standard);
}
.entry-card:hover { transform: translateY(-1px); }
.entry-card:active { transform: scale(0.98); }
.entry-preview {
width: 72px;
height: 72px;
border-radius: var(--radius-sm);
background: var(--surface-warm);
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
font-size: 28px;
overflow: hidden;
}
.entry-info {
flex: 1;
min-width: 0;
}
.entry-date {
font-size: var(--text-xs);
color: var(--muted);
margin-bottom: 4px;
}
.entry-title {
font-family: var(--font-display);
font-size: var(--text-base);
font-weight: 600;
color: var(--fg);
margin-bottom: 4px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.entry-excerpt {
font-size: var(--text-sm);
color: var(--muted);
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
.entry-mood {
font-size: 16px;
flex-shrink: 0;
margin-top: 2px;
}
/* Writing streak */
.streak-badge {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 6px 14px;
background: var(--tertiary-soft);
border-radius: var(--radius-pill);
font-size: var(--text-sm);
font-weight: 600;
color: #B8860B;
margin-bottom: var(--space-5);
}
.streak-badge svg { width: 16px; height: 16px; }
/* Quick stats row */
.quick-stats {
display: flex;
gap: var(--space-3);
margin-bottom: var(--space-5);
}
.stat-card {
flex: 1;
background: var(--surface);
border-radius: var(--radius-md);
padding: var(--space-4);
text-align: center;
box-shadow: var(--elev-soft);
border: 1px solid var(--border-soft);
}
.stat-card .num {
font-family: var(--font-display);
font-size: var(--text-2xl);
font-weight: 700;
color: var(--fg);
}
.stat-card .num.accent { color: var(--accent); }
.stat-card .num.green { color: var(--secondary); }
.stat-card .label {
font-size: var(--text-xs);
color: var(--muted);
margin-top: 4px;
}
/* Empty state */
.empty-state {
display: none; /* Shown via JS when no entries exist */
flex-direction: column;
align-items: center;
justify-content: center;
padding: var(--space-10) var(--space-5);
text-align: center;
}
.empty-state .empty-circle {
width: 80px;
height: 80px;
border-radius: 50%;
border: 2px dashed var(--border);
display: flex;
align-items: center;
justify-content: center;
margin-bottom: var(--space-4);
font-size: 32px;
opacity: 0.6;
}
.empty-state .empty-text {
font-size: var(--text-base);
color: var(--muted);
font-weight: 500;
margin-bottom: var(--space-2);
}
.empty-state .empty-hint {
font-size: var(--text-sm);
color: var(--meta);
}
</style>
</head>
<body>
<div class="content-area">
<!-- Greeting -->
<div class="greeting anim-fade">
<div class="greeting-left">
<div class="greeting-date">2026年5月31日 · 星期日</div>
<div class="greeting-text">下午好,<span>小暖</span></div>
</div>
<a href="search.html" class="greeting-search-btn" aria-label="搜索" title="搜索日记">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
</a>
</div>
<!-- Writing streak -->
<div class="streak-badge anim-fade" style="animation-delay: 0.1s">
<svg viewBox="0 0 16 16" fill="#B8860B" aria-hidden="true"><path d="M8 1l2 5h5l-4 3 1.5 5L8 11 3.5 14 5 9 1 6h5z"/></svg>
连续记录 12 天
</div>
<!-- Mood check - standardized 5 moods: happy, calm, sad, angry, thinking -->
<div class="mood-section anim-fade" style="animation-delay: 0.15s">
<div class="mood-header">
<span>今天心情如何?</span>
<div class="weather">
<svg width="16" height="16" viewBox="0 0 16 16" fill="var(--tertiary)" aria-hidden="true">
<circle cx="8" cy="8" r="5"/><path d="M8 1v2M8 13v2M1 8h2M13 8h2M3.05 3.05l1.41 1.41M11.54 11.54l1.41 1.41M3.05 12.95l1.41-1.41M11.54 4.46l1.41-1.41" stroke="var(--tertiary)" stroke-width="1.5" stroke-linecap="round"/>
</svg>
晴 26°
</div>
</div>
<div class="mood-options">
<button class="mood-opt selected" aria-label="开心"><span class="face">😊</span><span class="label">开心</span></button>
<button class="mood-opt" aria-label="平静"><span class="face">😐</span><span class="label">平静</span></button>
<button class="mood-opt" aria-label="难过"><span class="face">😢</span><span class="label">难过</span></button>
<button class="mood-opt" aria-label="生气"><span class="face">😡</span><span class="label">生气</span></button>
<button class="mood-opt" aria-label="思考"><span class="face">🤔</span><span class="label">思考</span></button>
</div>
</div>
<!-- Today's journal -->
<div class="today-card anim-slide" style="animation-delay: 0.2s">
<div class="label">今天的日记</div>
<div class="title">写点什么吧...</div>
<div class="prompt">记录一个温暖的瞬间,或者今天发生的小事</div>
<button class="write-btn" aria-label="开始写日记">
<svg viewBox="0 0 22 22" fill="none" aria-hidden="true">
<path d="M11 5v12M5 11h12" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"/>
</svg>
</button>
</div>
<!-- Quick stats -->
<div class="quick-stats anim-fade" style="animation-delay: 0.25s">
<div class="stat-card">
<div class="num accent">28</div>
<div class="label">本月日记</div>
</div>
<div class="stat-card">
<div class="num green">12</div>
<div class="label">连续天数</div>
</div>
<div class="stat-card">
<div class="num">156</div>
<div class="label">总日记数</div>
</div>
</div>
<!-- Recent entries -->
<div class="recent-header anim-fade" style="animation-delay: 0.3s">
<h3>最近记录</h3>
<a href="#" aria-label="查看全部日记">查看全部</a>
</div>
<div class="entry-card anim-fade" style="animation-delay: 0.35s">
<div class="entry-preview">🌸</div>
<div class="entry-info">
<div class="entry-date">5月30日 · 周六</div>
<div class="entry-title">图书馆的午后</div>
<div class="entry-excerpt">今天在图书馆自习,窗外的阳光洒进来,暖暖的。复习了高数第三章...</div>
</div>
<div class="entry-mood">😊</div>
</div>
<div class="entry-card anim-fade" style="animation-delay: 0.4s">
<div class="entry-preview" style="background: var(--secondary-soft)">🍃</div>
<div class="entry-info">
<div class="entry-date">5月29日 · 周五</div>
<div class="entry-title">和舍友的火锅局</div>
<div class="entry-excerpt">考完试和舍友们去吃了火锅庆祝,大家都好开心,聊了很多有趣的事...</div>
</div>
<div class="entry-mood">😊</div>
</div>
<div class="entry-card anim-fade" style="animation-delay: 0.45s">
<div class="entry-preview" style="background: var(--tertiary-soft)">📝</div>
<div class="entry-info">
<div class="entry-date">5月28日 · 周四</div>
<div class="entry-title">期末考试第一天</div>
<div class="entry-excerpt">终于考完了英语,感觉发挥还可以。明天继续加油!给自己打个气...</div>
</div>
<div class="entry-mood">😐</div>
</div>
<div class="entry-card anim-fade" style="animation-delay: 0.5s">
<div class="entry-preview" style="background: var(--rose-soft)">🌙</div>
<div class="entry-info">
<div class="entry-date">5月27日 · 周三</div>
<div class="entry-title">夜跑打卡</div>
<div class="entry-excerpt">晚上去操场跑了三圈,吹着晚风特别舒服。回来洗了个热水澡...</div>
</div>
<div class="entry-mood">😐</div>
</div>
<!-- Empty state (shown when no entries exist, hidden by default) -->
<div class="empty-state" id="emptyEntries">
<div class="empty-circle">📝</div>
<div class="empty-text">还没有日记</div>
<div class="empty-hint">点击上方按钮,开始记录你的第一篇日记吧</div>
</div>
<div style="height: var(--space-6)"></div>
</div>
<!-- Bottom Tab Bar -->
<nav class="tab-bar" role="tablist">
<button class="tab-item active" role="tab" aria-label="首页" aria-selected="true">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M3 9l9-7 9 7v11a2 2 0 01-2 2H5a2 2 0 01-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/></svg>
<span>首页</span>
</button>
<button class="tab-item" role="tab" aria-label="日历" aria-selected="false">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><rect x="3" y="4" width="18" height="18" rx="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg>
<span>日历</span>
</button>
<button class="tab-item" role="tab" aria-label="写日记" aria-selected="false" style="position:relative">
<div style="width:44px;height:44px;border-radius:50%;background:var(--accent);display:flex;align-items:center;justify-content:center;margin-top:-16px;box-shadow:0 4px 12px var(--shadow-accent)">
<svg viewBox="0 0 24 24" fill="none" stroke="var(--accent-on)" stroke-width="2.5" stroke-linecap="round" style="width:22px;height:22px" aria-hidden="true"><path d="M12 5v14M5 12h14"/></svg>
</div>
<span style="margin-top:2px">写日记</span>
</button>
<button class="tab-item" role="tab" aria-label="发现" aria-selected="false">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
<span>发现</span>
</button>
<button class="tab-item" role="tab" aria-label="我的" aria-selected="false">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2"/><circle cx="12" cy="7" r="4"/></svg>
<span>我的</span>
</button>
</nav>
<div class="dynamic-island" aria-hidden="true"></div>
<div class="home-indicator" style="position:absolute;bottom:8px;left:50%;transform:translateX(-50%);z-index:101" aria-hidden="true"></div>
<script src="../js/theme-switcher.js"></script>
</body>
</html>

View File

@@ -0,0 +1,644 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=390, height=844, initial-scale=1, viewport-fit=cover">
<title>暖记 — 登录/注册</title>
<link href="https://fonts.googleapis.com/css2?family=Caveat:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="../css/tokens.css">
<link rel="stylesheet" href="../css/components.css">
<style>
body {
width: 390px;
height: 844px;
overflow: hidden;
background: var(--bg);
position: relative;
display: flex;
flex-direction: column;
}
/* Focus styles */
button:focus-visible, a:focus-visible, input:focus-visible {
box-shadow: 0 0 0 3px var(--focus-ring);
outline: none;
}
/* Brand area */
.brand-area {
flex: 0 0 auto;
background: linear-gradient(180deg, var(--bg) 0%, var(--tertiary-soft) 100%);
padding: calc(var(--safe-top) + var(--space-6)) var(--space-6) var(--space-8);
text-align: center;
position: relative;
overflow: hidden;
}
/* CSS-drawn notebook logo */
.logo-wrap {
width: 80px;
height: 80px;
margin: 0 auto var(--space-4);
position: relative;
}
.logo-notebook {
width: 64px;
height: 72px;
border: 3px solid var(--accent);
border-radius: 6px 10px 10px 6px;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
background: color-mix(in oklab, var(--accent), transparent 94%);
}
.logo-spine {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 3px;
height: 72px;
background: var(--accent);
border-radius: 2px;
}
.logo-heart {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -45%);
width: 18px;
height: 18px;
}
.logo-heart::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 18px;
height: 18px;
background: var(--accent);
clip-path: path('M9 16C9 16 1 10.5 1 6C1 3.24 3.24 1 6 1C7.5 1 8.8 1.7 9 2.8C9.2 1.7 10.5 1 12 1C14.76 1 17 3.24 17 6C17 10.5 9 16 9 16Z');
transform: translate(-50%, -50%);
left: 50%;
top: 50%;
}
.brand-title {
font-family: var(--font-display);
font-size: 32px;
font-weight: 700;
color: var(--fg);
margin-bottom: var(--space-1);
}
.brand-tagline {
font-family: var(--font-handwritten);
font-size: 18px;
color: var(--accent);
font-weight: 500;
}
/* Floating decorations */
.deco {
position: absolute;
pointer-events: none;
opacity: 0.2;
}
.deco-dot1 {
width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
top: 60px; left: 40px;
}
.deco-dot2 {
width: 6px; height: 6px; border-radius: 50%; background: var(--secondary);
top: 90px; right: 50px;
}
.deco-dot3 {
width: 10px; height: 10px; border-radius: 50%; background: var(--tertiary);
bottom: 30px; left: 60px;
}
.deco-wave {
width: 30px; height: 12px;
top: 80px; right: 80px;
}
.deco-wave svg { width: 100%; height: 100%; }
.deco-flower {
width: 16px; height: 16px;
bottom: 20px; right: 70px;
}
.deco-flower::before {
content: '';
display: block;
width: 16px; height: 16px;
background: var(--rose);
clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
/* Form area */
.form-area {
flex: 1;
padding: var(--space-6) var(--space-6) var(--space-8);
display: flex;
flex-direction: column;
background: var(--bg);
border-radius: var(--radius-xl) var(--radius-xl) 0 0;
margin-top: -var(--space-4);
position: relative;
z-index: 5;
}
.form-title {
font-family: var(--font-display);
font-size: 20px;
font-weight: 700;
color: var(--fg);
text-align: center;
margin-bottom: var(--space-5);
}
/* Input group */
.input-group {
position: relative;
margin-bottom: var(--space-4);
}
.input-group .input-icon {
position: absolute;
left: 16px;
top: 50%;
transform: translateY(-50%);
width: 20px;
height: 20px;
color: var(--muted);
pointer-events: none;
display: flex;
align-items: center;
justify-content: center;
}
.input-group input {
width: 100%;
height: 50px;
padding: 0 16px 0 46px;
border: 1.5px solid var(--border);
border-radius: var(--radius-pill);
font-family: var(--font-body);
font-size: var(--text-base);
color: var(--fg);
background: var(--surface);
transition: border-color var(--motion-fast) var(--ease-standard);
}
.input-group input::placeholder {
color: var(--meta);
}
.input-group input:focus {
outline: none;
border-color: var(--accent);
box-shadow: 0 0 0 3px var(--shadow-input-focus);
}
/* Verification code input with button */
.input-group.has-action input {
padding-right: 110px;
}
.input-group .input-action {
position: absolute;
right: 6px;
top: 50%;
transform: translateY(-50%);
padding: 8px 14px;
background: none;
border: none;
font-family: var(--font-body);
font-size: var(--text-sm);
font-weight: 600;
color: var(--accent);
cursor: pointer;
min-height: 38px;
border-radius: var(--radius-pill);
transition: background var(--motion-fast);
}
.input-group .input-action:hover {
background: var(--surface-warm);
}
/* Password toggle */
.input-group.has-toggle input {
padding-right: 50px;
}
.input-group .toggle-password {
position: absolute;
right: 14px;
top: 50%;
transform: translateY(-50%);
width: 24px;
height: 24px;
background: none;
border: none;
color: var(--muted);
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
padding: 0;
min-height: 44px;
min-width: 44px;
border-radius: 50%;
}
.input-group .toggle-password:hover {
color: var(--fg);
}
.input-group .toggle-password svg {
width: 20px;
height: 20px;
}
/* Agreement checkbox */
.agreement {
display: flex;
align-items: flex-start;
gap: var(--space-2);
margin-bottom: var(--space-4);
font-size: var(--text-sm);
color: var(--muted);
line-height: 1.4;
}
.agreement input[type="checkbox"] {
width: 18px;
height: 18px;
accent-color: var(--accent);
margin-top: 2px;
flex-shrink: 0;
cursor: pointer;
}
.agreement a {
color: var(--accent);
text-decoration: none;
font-weight: 500;
}
.agreement a:focus-visible {
box-shadow: 0 0 0 3px var(--focus-ring);
outline: none;
border-radius: 2px;
}
/* Primary button */
.btn-login {
width: 100%;
min-height: 50px;
border: none;
border-radius: var(--radius-pill);
background: var(--accent);
color: var(--bg);
font-family: var(--font-display);
font-size: 18px;
font-weight: 700;
cursor: pointer;
transition: all var(--motion-fast) var(--ease-standard);
margin-bottom: var(--space-5);
}
.btn-login:hover {
background: var(--accent-hover);
transform: translateY(-1px);
box-shadow: 0 4px 16px var(--shadow-accent);
}
.btn-login:active {
background: var(--accent-active);
transform: scale(0.98);
}
/* Divider */
.divider {
display: flex;
align-items: center;
gap: var(--space-4);
margin-bottom: var(--space-5);
color: var(--meta);
font-size: var(--text-sm);
}
.divider::before,
.divider::after {
content: '';
flex: 1;
height: 1px;
background: var(--border);
}
/* Third-party login */
.social-row {
display: flex;
justify-content: center;
gap: var(--space-5);
margin-bottom: var(--space-6);
}
.social-btn {
width: 56px;
height: 56px;
border-radius: 50%;
border: 1.5px solid var(--border);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all var(--motion-fast) var(--ease-standard);
background: var(--surface);
}
.social-btn:hover {
transform: translateY(-2px);
box-shadow: var(--elev-soft);
}
.social-btn:active {
transform: scale(0.95);
}
.social-btn svg {
width: 28px;
height: 28px;
}
.social-btn.wechat {
background: #07C160;
border-color: #07C160;
}
.social-btn.wechat:hover {
background: #06AD56;
border-color: #06AD56;
}
.social-btn.apple {
background: #1D1D1F;
border-color: #1D1D1F;
}
.social-btn.apple:hover {
background: #333;
border-color: #333;
}
.social-btn.google {
background: var(--surface);
}
/* Bottom link */
.bottom-link {
text-align: center;
font-size: var(--text-sm);
color: var(--muted);
margin-top: auto;
}
.bottom-link a {
color: var(--accent);
text-decoration: none;
font-weight: 600;
cursor: pointer;
background: none;
border: none;
font-size: inherit;
font-family: inherit;
}
.bottom-link a:hover {
text-decoration: underline;
}
/* State toggling */
.register-fields {
display: none;
}
.is-register .register-fields {
display: block;
}
.is-register .login-only {
display: none;
}
/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
}
/* Animations */
@keyframes fadeIn {
from { opacity: 0; transform: translateY(8px); }
to { opacity: 1; transform: translateY(0); }
}
.anim-fade { animation: fadeIn 0.4s var(--ease-standard) both; }
</style>
</head>
<body>
<!-- Brand Area -->
<div class="brand-area">
<!-- Decorative elements -->
<div class="deco deco-dot1" aria-hidden="true"></div>
<div class="deco deco-dot2" aria-hidden="true"></div>
<div class="deco deco-dot3" aria-hidden="true"></div>
<div class="deco deco-wave" aria-hidden="true">
<svg viewBox="0 0 30 12" fill="none" stroke="var(--accent)" stroke-width="2" stroke-linecap="round">
<path d="M2 8 Q8 2, 15 8 Q22 14, 28 8"/>
</svg>
</div>
<div class="deco deco-flower" aria-hidden="true"></div>
<!-- Logo -->
<div class="logo-wrap anim-fade" aria-hidden="true">
<div class="logo-notebook"></div>
<div class="logo-spine"></div>
<div class="logo-heart"></div>
</div>
<div class="brand-title anim-fade" style="animation-delay:0.1s">暖记</div>
<div class="brand-tagline anim-fade" style="animation-delay:0.15s">用温暖记录每一天</div>
</div>
<!-- Form Area -->
<div class="form-area" id="formArea">
<h1 class="form-title anim-fade" style="animation-delay:0.2s" id="formTitle">欢迎回来</h1>
<form id="loginForm" autocomplete="on" novalidate>
<!-- Register: nickname -->
<div class="register-fields anim-fade">
<div class="input-group">
<span class="input-icon" aria-hidden="true">
<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round">
<circle cx="10" cy="7" r="4"/><path d="M3 18c0-3.3 3.1-6 7-6s7 2.7 7 6"/>
</svg>
</span>
<input type="text" id="nickname" name="nickname" placeholder="请输入昵称" autocomplete="nickname" aria-label="昵称">
</div>
</div>
<!-- Phone -->
<div class="input-group anim-fade" style="animation-delay:0.25s">
<span class="input-icon" aria-hidden="true">
<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round">
<rect x="5" y="2" width="10" height="16" rx="2"/><line x1="8" y1="15" x2="12" y2="15"/>
</svg>
</span>
<input type="tel" id="phone" name="phone" placeholder="请输入手机号" autocomplete="tel" pattern="[0-9]*" aria-label="手机号">
</div>
<!-- Register: password -->
<div class="register-fields anim-fade">
<div class="input-group has-toggle">
<span class="input-icon" aria-hidden="true">
<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round">
<rect x="3" y="9" width="14" height="9" rx="2"/><path d="M6 9V6a4 4 0 018 0v3"/>
</svg>
</span>
<input type="password" id="regPassword" name="password" placeholder="请输入密码" autocomplete="new-password" aria-label="密码">
<button type="button" class="toggle-password" aria-label="显示密码" onclick="togglePwd('regPassword', this)">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round">
<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/>
</svg>
</button>
</div>
</div>
<!-- Verification code -->
<div class="input-group has-action anim-fade" style="animation-delay:0.3s">
<span class="input-icon" aria-hidden="true">
<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round">
<rect x="2" y="4" width="16" height="12" rx="2"/><path d="M6 8v4M10 7v6M14 8v4"/>
</svg>
</span>
<input type="tel" id="code" name="code" placeholder="请输入验证码" autocomplete="one-time-code" pattern="[0-9]*" aria-label="验证码">
<button type="button" class="input-action" aria-label="获取验证码" id="getCodeBtn" onclick="sendCode()">获取验证码</button>
</div>
<!-- Register: agreement -->
<div class="register-fields anim-fade">
<label class="agreement">
<input type="checkbox" id="agreement" aria-label="同意用户协议">
<span>我已阅读并同意<a href="#" onclick="return false">《用户协议》</a><a href="#" onclick="return false">《隐私政策》</a></span>
</label>
</div>
<!-- Submit -->
<button type="submit" class="btn-login anim-fade" style="animation-delay:0.35s" id="submitBtn" aria-label="登录">登录</button>
</form>
<!-- Divider -->
<div class="divider anim-fade" style="animation-delay:0.4s">其他登录方式</div>
<!-- Third-party login -->
<div class="social-row anim-fade" style="animation-delay:0.45s">
<!-- WeChat -->
<button type="button" class="social-btn wechat" aria-label="微信登录">
<svg viewBox="0 0 28 28" fill="none">
<path d="M19.1 12.5c-.2-3.3-3.2-5.9-6.8-5.9-3.8 0-6.9 2.8-6.9 6.3 0 1.8.9 3.4 2.3 4.5l-.6 1.8 2.1-1.1c.7.2 1.5.3 2.3.3h.4c-.1-.4-.2-.8-.2-1.2.1-2.6 2.7-4.7 5.9-4.7h.2c.1-.1.2-.1.3 0z" fill="#FFF"/>
<path d="M11.6 11.5c-.5 0-1-.4-1-1s.4-1 1-1 1 .4 1 1-.5 1-1 1zM14.8 10.5c-.5 0-1 .4-1 1s.4 1 1 1 1-.4 1-1-.5-1-1-1z" fill="#07C160"/>
<path d="M25.5 16.8c0-2.9-2.9-5.3-6.3-5.3s-6.3 2.4-6.3 5.3 2.9 5.3 6.3 5.3c.7 0 1.4-.1 2-.3l1.7.9-.5-1.5c1.3-1 2.1-2.5 2.1-4.1 0 .1 0-.1 0-.3zm-8.6-1c-.4 0-.8-.3-.8-.8s.3-.8.8-.8.8.3.8.8-.4.8-.8.8zm4.6 0c-.4 0-.8-.3-.8-.8s.3-.8.8-.8.8.3.8.8-.4.8-.8.8z" fill="#FFF"/>
</svg>
</button>
<!-- Apple -->
<button type="button" class="social-btn apple" aria-label="Apple登录">
<svg viewBox="0 0 28 28" fill="#FFF">
<path d="M20.2 14.3c0-2 1.2-3.1 1.3-3.2-0.7-1-1.8-1.6-3-1.6-1.3 0-2 .8-2.7.8-.7 0-1.4-.8-2.5-.8-1.7 0-3.5 1.4-3.5 4.1 0 1.6.6 3.3 1.4 4.5.7 1 1.4 1.8 2.3 1.8.9 0 1.3-.7 2.5-.7 1.2 0 1.5.7 2.5.7.9 0 1.6-.8 2.2-1.7.4-.6.7-1.2.9-1.9-2-.8-2.4-3.8-.4-5zm-1.8-3.3c.5-.6.9-1.4.8-2.2-.8 0-1.8.5-2.3 1.2-.5.6-.9 1.4-.8 2.2.8 0 1.7-.5 2.3-1.2z"/>
</svg>
</button>
<!-- Google -->
<button type="button" class="social-btn google" aria-label="Google登录">
<svg viewBox="0 0 28 28">
<path d="M14 11.5v5.2h7.3c-.3 1.7-1.3 3.1-2.7 4.1l4.4 3.4c2.6-2.4 4-5.9 4-10.1 0-1-.1-1.9-.3-2.8H14z" fill="#4285F4"/>
<path d="M6.3 16.4c-.4-1-.6-2.2-.6-3.4s.2-2.3.6-3.4L1.9 6.2C.7 8.5 0 11.2 0 14s.7 5.5 1.9 7.8l4.4-3.4z" fill="#FBBC05"/>
<path d="M14 28c3.7 0 6.8-1.2 9.1-3.3l-4.4-3.4c-1.2.8-2.8 1.3-4.7 1.3-3.6 0-6.7-2.4-7.8-5.7l-4.4 3.4C4.2 24.7 8.7 28 14 28z" fill="#34A853"/>
<path d="M14 5.6c2 0 3.9.7 5.3 2l4-4C20.8 1.2 17.7 0 14 0 8.7 0 4.2 3.3 2.1 8.1l4.4 3.4c1.1-3.3 4.2-5.9 7.5-5.9z" fill="#EA4335"/>
</svg>
</button>
</div>
<!-- Bottom link -->
<div class="bottom-link anim-fade" style="animation-delay:0.5s">
<span class="login-only">还没有账号?</span>
<a href="#" id="toggleLink" role="button" aria-label="切换到注册">立即注册</a>
</div>
</div>
<!-- Home indicator -->
<div style="position:absolute;bottom:8px;left:50%;transform:translateX(-50%);width:134px;height:5px;background:var(--fg);opacity:0.2;border-radius:3px;z-index:101" aria-hidden="true"></div>
<script>
(function() {
var isRegister = false;
var formArea = document.getElementById('formArea');
var formTitle = document.getElementById('formTitle');
var submitBtn = document.getElementById('submitBtn');
var toggleLink = document.getElementById('toggleLink');
var phoneInput = document.getElementById('phone');
// Only allow digits in phone input
phoneInput.addEventListener('input', function() {
this.value = this.value.replace(/[^0-9]/g, '');
});
var codeInput = document.getElementById('code');
codeInput.addEventListener('input', function() {
this.value = this.value.replace(/[^0-9]/g, '');
});
// Toggle login/register
toggleLink.addEventListener('click', function(e) {
e.preventDefault();
isRegister = !isRegister;
if (isRegister) {
formArea.classList.add('is-register');
formTitle.textContent = '创建账号';
submitBtn.textContent = '注册';
submitBtn.setAttribute('aria-label', '注册');
toggleLink.textContent = '立即登录';
toggleLink.setAttribute('aria-label', '切换到登录');
toggleLink.previousElementSibling.textContent = '已有账号?';
} else {
formArea.classList.remove('is-register');
formTitle.textContent = '欢迎回来';
submitBtn.textContent = '登录';
submitBtn.setAttribute('aria-label', '登录');
toggleLink.textContent = '立即注册';
toggleLink.setAttribute('aria-label', '切换到注册');
toggleLink.previousElementSibling.textContent = '还没有账号?';
}
});
// Form submit
document.getElementById('loginForm').addEventListener('submit', function(e) {
e.preventDefault();
});
})();
function togglePwd(inputId, btn) {
var input = document.getElementById(inputId);
if (input.type === 'password') {
input.type = 'text';
btn.setAttribute('aria-label', '隐藏密码');
btn.innerHTML = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><path d="M17.94 17.94A10.07 10.07 0 0112 20c-7 0-11-8-11-8a18.45 18.45 0 015.06-5.94M9.9 4.24A9.12 9.12 0 0112 4c7 0 11 8 11 8a18.5 18.5 0 01-2.16 3.19m-6.72-1.07a3 3 0 11-4.24-4.24"/><line x1="1" y1="1" x2="23" y2="23"/></svg>';
} else {
input.type = 'password';
btn.setAttribute('aria-label', '显示密码');
btn.innerHTML = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/></svg>';
}
}
function sendCode() {
var btn = document.getElementById('getCodeBtn');
var seconds = 60;
btn.disabled = true;
btn.style.opacity = '0.6';
btn.textContent = seconds + 's';
var timer = setInterval(function() {
seconds--;
if (seconds <= 0) {
clearInterval(timer);
btn.disabled = false;
btn.style.opacity = '1';
btn.textContent = '获取验证码';
} else {
btn.textContent = seconds + 's';
}
}, 1000);
}
</script>
<script src="../js/theme-switcher.js"></script>
</body>
</html>

View File

@@ -0,0 +1,306 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=390, height=844, initial-scale=1, viewport-fit=cover">
<title>暖记 — 月度概览</title>
<link href="https://fonts.googleapis.com/css2?family=Caveat:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="../css/tokens.css">
<link rel="stylesheet" href="../css/components.css">
<style>
body {
width: 390px; height: 844px;
overflow: hidden; background: var(--bg);
position: relative;
}
/* Global focus styles */
button:focus-visible, a:focus-visible, [role="tab"]:focus-visible {
box-shadow: 0 0 0 3px var(--focus-ring);
outline: none;
}
.content-area {
position: absolute; top: 0; left: 0; right: 0;
bottom: calc(var(--tab-height) + var(--safe-bottom));
overflow-y: auto; padding: 0 var(--space-5);
padding-top: calc(var(--safe-top) + var(--space-2));
scrollbar-width: none;
}
.content-area::-webkit-scrollbar { display: none; }
.month-header {
display: flex; align-items: center; justify-content: space-between;
margin-bottom: var(--space-5);
}
.month-title {
font-family: var(--font-display);
font-size: var(--text-2xl); font-weight: 700;
}
.month-nav { display: flex; gap: var(--space-2); }
.month-nav button {
min-width: 44px; min-height: 44px; border-radius: 50%;
border: 1.5px solid var(--border); background: var(--surface);
display: flex; align-items: center; justify-content: center;
cursor: pointer; color: var(--fg); transition: all var(--motion-fast);
}
.month-nav button:hover { border-color: var(--accent); color: var(--accent); }
.month-nav button svg { width: 18px; height: 18px; }
/* Monthly calendar grid - color coded */
.month-grid {
background: var(--surface); border-radius: var(--radius-md);
padding: var(--space-4); margin-bottom: var(--space-5);
box-shadow: var(--elev-soft); border: 1px solid var(--border-soft);
}
.weekday-row {
display: grid; grid-template-columns: repeat(7, 1fr);
text-align: center; margin-bottom: var(--space-2);
}
.weekday-row span { font-size: 11px; color: var(--meta); font-weight: 500; }
.m-grid {
display: grid; grid-template-columns: repeat(7, 1fr);
gap: 3px;
}
.m-cell {
aspect-ratio: 1; border-radius: 6px;
display: flex; flex-direction: column;
align-items: center; justify-content: center;
font-size: 12px; color: var(--fg);
position: relative; cursor: pointer;
transition: all var(--motion-fast);
min-height: 44px;
}
.m-cell:hover { transform: scale(1.1); }
.m-cell.empty { cursor: default; }
.m-cell.empty:hover { transform: none; }
.m-cell .mood-e { font-size: 10px; margin-top: 1px; }
.m-cell.has-entry { background: rgba(255,255,255,0.5); }
.m-cell.mood-happy { background: var(--secondary-soft); }
.m-cell.mood-love { background: var(--rose-soft); }
.m-cell.mood-calm { background: var(--tertiary-soft); }
.m-cell.mood-sad { background: #D4DDE8; }
.m-cell.mood-tired { background: #E8E4E0; }
.m-cell.today {
outline: 2px solid var(--accent);
outline-offset: -2px;
font-weight: 700;
}
/* Month summary */
.month-summary {
background: var(--surface); border-radius: var(--radius-md);
padding: var(--space-5); margin-bottom: var(--space-5);
box-shadow: var(--elev-soft); border: 1px solid var(--border-soft);
}
.month-summary h3 {
font-family: var(--font-display); font-size: var(--text-lg);
font-weight: 700; margin-bottom: var(--space-4);
}
.summary-grid {
display: grid; grid-template-columns: 1fr 1fr;
gap: var(--space-3);
}
.s-card {
padding: var(--space-4); border-radius: var(--radius-sm);
text-align: center;
}
.s-card .s-icon { font-size: 24px; margin-bottom: var(--space-2); }
.s-card .s-val {
font-family: var(--font-display);
font-size: var(--text-xl); font-weight: 700;
}
.s-card .s-label {
font-size: var(--text-xs); color: var(--muted); margin-top: 2px;
}
/* Highlight entries */
.highlights {
margin-bottom: var(--space-5);
}
.highlights h3 {
font-family: var(--font-display); font-size: var(--text-lg);
font-weight: 700; margin-bottom: var(--space-4);
}
.highlight-card {
background: var(--surface); border-radius: var(--radius-md);
padding: var(--space-4); margin-bottom: var(--space-3);
box-shadow: var(--elev-soft); border: 1px solid var(--border-soft);
display: flex; gap: var(--space-3); align-items: center;
cursor: pointer; transition: transform var(--motion-fast);
min-height: 44px;
}
.highlight-card:hover { transform: translateY(-1px); }
.hl-emoji {
width: 48px; height: 48px; border-radius: 50%;
display: flex; align-items: center; justify-content: center;
font-size: 24px; flex-shrink: 0;
}
.hl-info { flex: 1; }
.hl-info .hl-date { font-size: var(--text-xs); color: var(--muted); }
.hl-info .hl-title {
font-family: var(--font-display); font-size: var(--text-base);
font-weight: 600; margin-top: 2px;
}
.hl-badge {
padding: 4px 10px; border-radius: var(--radius-pill);
font-size: 11px; font-weight: 600;
}
</style>
</head>
<body>
<div class="content-area">
<div class="month-header anim-fade">
<div class="month-title">2026年5月</div>
<div class="month-nav">
<button aria-label="上个月"><svg viewBox="0 0 18 18" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M11 14l-5-5 5-5"/></svg></button>
<button aria-label="下个月"><svg viewBox="0 0 18 18" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M7 4l5 5-5 5"/></svg></button>
</div>
</div>
<!-- Month grid - using standardized 5 moods -->
<div class="month-grid anim-fade" style="animation-delay: 0.1s">
<div class="weekday-row" aria-hidden="true">
<span></span><span></span><span></span><span></span><span></span><span></span><span></span>
</div>
<div class="m-grid">
<div class="m-cell empty"></div>
<div class="m-cell empty"></div>
<div class="m-cell empty"></div>
<div class="m-cell empty"></div>
<div class="m-cell empty"></div>
<div class="m-cell mood-happy">1<span class="mood-e">😊</span></div>
<div class="m-cell mood-happy">2<span class="mood-e">😊</span></div>
<div class="m-cell mood-calm">3<span class="mood-e">😐</span></div>
<div class="m-cell mood-sad">4<span class="mood-e">😢</span></div>
<div class="m-cell mood-happy">5<span class="mood-e">😊</span></div>
<div class="m-cell mood-happy">6<span class="mood-e">😊</span></div>
<div class="m-cell mood-tired">7<span class="mood-e">😐</span></div>
<div class="m-cell mood-happy">8<span class="mood-e">😊</span></div>
<div class="m-cell mood-love">9<span class="mood-e">😡</span></div>
<div class="m-cell mood-calm">10<span class="mood-e">😐</span></div>
<div class="m-cell mood-happy">11<span class="mood-e">😊</span></div>
<div class="m-cell mood-tired">12<span class="mood-e">😐</span></div>
<div class="m-cell mood-happy">13<span class="mood-e">😊</span></div>
<div class="m-cell mood-happy">14<span class="mood-e">😊</span></div>
<div class="m-cell mood-calm">15<span class="mood-e">😐</span></div>
<div class="m-cell mood-happy">16<span class="mood-e">😊</span></div>
<div class="m-cell mood-sad">17<span class="mood-e">😢</span></div>
<div class="m-cell mood-calm">18<span class="mood-e">😐</span></div>
<div class="m-cell mood-happy">19<span class="mood-e">😊</span></div>
<div class="m-cell mood-happy">20<span class="mood-e">😊</span></div>
<div class="m-cell mood-happy">21<span class="mood-e">😊</span></div>
<div class="m-cell mood-tired">22<span class="mood-e">😐</span></div>
<div class="m-cell mood-happy">23<span class="mood-e">😊</span></div>
<div class="m-cell mood-happy">24<span class="mood-e">😊</span></div>
<div class="m-cell mood-calm">25<span class="mood-e">😐</span></div>
<div class="m-cell mood-calm">26<span class="mood-e">😐</span></div>
<div class="m-cell mood-happy">27<span class="mood-e">😊</span></div>
<div class="m-cell mood-happy">28<span class="mood-e">😊</span></div>
<div class="m-cell mood-happy">29<span class="mood-e">😊</span></div>
<div class="m-cell mood-happy">30<span class="mood-e">😊</span></div>
<div class="m-cell mood-happy today">31<span class="mood-e">😊</span></div>
</div>
</div>
<!-- Summary -->
<div class="month-summary anim-fade" style="animation-delay: 0.15s">
<h3>本月总结</h3>
<div class="summary-grid">
<div class="s-card" style="background: var(--tertiary-soft)">
<div class="s-icon">📝</div>
<div class="s-val" style="color:#B8860B">28</div>
<div class="s-label">日记篇数</div>
</div>
<div class="s-card" style="background: var(--secondary-soft)">
<div class="s-icon">🔥</div>
<div class="s-val" style="color:#2D7D46">12</div>
<div class="s-label">最长连续</div>
</div>
<div class="s-card" style="background: var(--rose-soft)">
<div class="s-icon">😊</div>
<div class="s-val" style="color:#9B4D4D">72%</div>
<div class="s-label">好心情占比</div>
</div>
<div class="s-card" style="background: #D4DDE8">
<div class="s-icon">📸</div>
<div class="s-val" style="color:#4A6B8A">18</div>
<div class="s-label">照片数量</div>
</div>
</div>
</div>
<!-- Highlights -->
<div class="highlights anim-fade" style="animation-delay: 0.2s">
<h3>本月精选</h3>
<div class="highlight-card">
<div class="hl-emoji" style="background:var(--rose-soft)">😊</div>
<div class="hl-info">
<div class="hl-date">5月14日</div>
<div class="hl-title">和朋友聚餐的欢乐时光</div>
</div>
<div class="hl-badge" style="background:var(--rose-soft);color:#9B4D4D">最佳心情</div>
</div>
<div class="highlight-card">
<div class="hl-emoji" style="background:var(--tertiary-soft)"></div>
<div class="hl-info">
<div class="hl-date">5月21日</div>
<div class="hl-title">完成了第一个小目标</div>
</div>
<div class="hl-badge" style="background:var(--tertiary-soft);color:#B8860B">里程碑</div>
</div>
<div class="highlight-card">
<div class="hl-emoji" style="background:var(--secondary-soft)">📚</div>
<div class="hl-info">
<div class="hl-date">5月28日</div>
<div class="hl-title">期末考试结束</div>
</div>
<div class="hl-badge" style="background:var(--secondary-soft);color:#2D7D46">最详尽记录</div>
</div>
</div>
<div style="height: var(--space-8)"></div>
</div>
<!-- Tab bar -->
<nav class="tab-bar" role="tablist">
<button class="tab-item" role="tab" aria-label="首页" aria-selected="false">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M3 9l9-7 9 7v11a2 2 0 01-2 2H5a2 2 0 01-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/></svg>
<span>首页</span>
</button>
<button class="tab-item active" role="tab" aria-label="日历" aria-selected="true">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><rect x="3" y="4" width="18" height="18" rx="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg>
<span>日历</span>
</button>
<button class="tab-item" role="tab" aria-label="写日记" aria-selected="false" style="position:relative">
<div style="width:44px;height:44px;border-radius:50%;background:var(--accent);display:flex;align-items:center;justify-content:center;margin-top:-16px;box-shadow:0 4px 12px var(--shadow-accent)">
<svg viewBox="0 0 24 24" fill="none" stroke="var(--accent-on)" stroke-width="2.5" stroke-linecap="round" style="width:22px;height:22px" aria-hidden="true"><path d="M12 5v14M5 12h14"/></svg>
</div>
<span style="margin-top:2px">写日记</span>
</button>
<button class="tab-item" role="tab" aria-label="发现" aria-selected="false">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
<span>发现</span>
</button>
<button class="tab-item" role="tab" aria-label="我的" aria-selected="false">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2"/><circle cx="12" cy="7" r="4"/></svg>
<span>我的</span>
</button>
</nav>
<div class="dynamic-island" aria-hidden="true"></div>
<div class="home-indicator" style="position:absolute;bottom:8px;left:50%;transform:translateX(-50%);z-index:101" aria-hidden="true"></div>
<script src="../js/theme-switcher.js"></script>
</body>
</html>

View File

@@ -0,0 +1,433 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=390, height=844, initial-scale=1, viewport-fit=cover">
<title>暖记 — 心情追踪</title>
<link href="https://fonts.googleapis.com/css2?family=Caveat:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="../css/tokens.css">
<link rel="stylesheet" href="../css/components.css">
<style>
body {
width: 390px;
height: 844px;
overflow: hidden;
background: var(--bg);
position: relative;
}
/* Global focus styles */
button:focus-visible, a:focus-visible, [role="tab"]:focus-visible {
box-shadow: 0 0 0 3px var(--focus-ring);
outline: none;
}
.content-area {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: calc(var(--tab-height) + var(--safe-bottom));
overflow-y: auto;
padding: 0 var(--space-5);
padding-top: calc(var(--safe-top) + var(--space-2));
scrollbar-width: none;
}
.content-area::-webkit-scrollbar { display: none; }
.page-title {
font-family: var(--font-display);
font-size: var(--text-2xl);
font-weight: 700;
margin-bottom: var(--space-5);
}
/* Today mood card */
.today-mood-card {
background: linear-gradient(135deg, var(--accent), var(--tertiary));
border-radius: var(--radius-lg);
padding: var(--space-6);
margin-bottom: var(--space-5);
position: relative;
overflow: hidden;
}
.today-mood-card::before {
content: '';
position: absolute;
top: -20px;
right: -20px;
width: 100px;
height: 100px;
border-radius: 50%;
background: rgba(255,255,255,0.12);
}
.today-mood-card .label {
font-size: var(--text-sm);
color: rgba(255,248,240,0.85);
margin-bottom: var(--space-2);
}
.today-mood-card .big-mood {
font-size: 52px;
margin: var(--space-3) 0;
}
.today-mood-card .mood-text {
font-family: var(--font-display);
font-size: var(--text-xl);
font-weight: 700;
color: var(--accent-on);
margin-bottom: var(--space-1);
}
.today-mood-card .mood-sub {
font-size: var(--text-sm);
color: rgba(255,248,240,0.75);
}
/* Weather card */
.weather-card {
background: var(--surface);
border-radius: var(--radius-md);
padding: var(--space-5);
margin-bottom: var(--space-5);
box-shadow: var(--elev-soft);
border: 1px solid var(--border-soft);
}
.weather-card h4 {
font-family: var(--font-display);
font-size: var(--text-base);
font-weight: 600;
margin-bottom: var(--space-4);
}
.weather-row {
display: flex;
gap: var(--space-3);
}
.weather-opt {
flex: 1;
aspect-ratio: 1;
border-radius: var(--radius-md);
border: 2px solid var(--border);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 4px;
background: var(--surface);
cursor: pointer;
transition: all var(--motion-fast) var(--ease-bounce);
font-size: 28px;
min-width: 44px;
min-height: 44px;
}
.weather-opt span {
font-size: 11px;
color: var(--muted);
}
.weather-opt.selected {
border-color: var(--accent);
background: var(--surface-warm);
}
.weather-opt.selected span { color: var(--accent); font-weight: 600; }
.weather-opt:hover { transform: scale(1.05); }
/* Mood history chart */
.mood-chart-card {
background: var(--surface);
border-radius: var(--radius-md);
padding: var(--space-5);
margin-bottom: var(--space-5);
box-shadow: var(--elev-soft);
border: 1px solid var(--border-soft);
}
.mood-chart-card h4 {
font-family: var(--font-display);
font-size: var(--text-base);
font-weight: 600;
margin-bottom: var(--space-4);
}
.chart-period {
display: flex;
gap: var(--space-2);
margin-bottom: var(--space-5);
}
.period-btn {
padding: 6px 16px;
min-height: 44px;
border-radius: var(--radius-pill);
border: none;
font-size: var(--text-sm);
font-weight: 500;
background: var(--surface-warm);
color: var(--fg-2);
cursor: pointer;
transition: all var(--motion-fast);
}
.period-btn.active { background: var(--accent); color: var(--accent-on); }
/* Simple line chart visualization */
.mood-line-chart {
height: 120px;
display: flex;
align-items: flex-end;
gap: 3px;
margin-bottom: var(--space-4);
padding-bottom: 24px;
position: relative;
}
.mood-line-chart::after {
content: '';
position: absolute;
bottom: 20px;
left: 0;
right: 0;
height: 1px;
background: var(--border-soft);
}
.chart-bar {
flex: 1;
max-width: 14px;
border-radius: 7px 7px 0 0;
position: relative;
transition: height var(--motion-base) var(--ease-bounce);
cursor: pointer;
}
.chart-bar:hover { opacity: 0.8; }
.chart-bar .tooltip {
position: absolute;
bottom: calc(100% + 8px);
left: 50%;
transform: translateX(-50%);
background: var(--fg);
color: white;
font-size: 11px;
padding: 4px 8px;
border-radius: 6px;
white-space: nowrap;
opacity: 0;
pointer-events: none;
transition: opacity var(--motion-fast);
}
.chart-bar:hover .tooltip { opacity: 1; }
.chart-date {
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
font-size: 9px;
color: var(--meta);
white-space: nowrap;
}
/* Stats grid */
.stats-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: var(--space-3);
margin-bottom: var(--space-5);
}
.stat-item {
background: var(--surface);
border-radius: var(--radius-md);
padding: var(--space-4);
box-shadow: var(--elev-soft);
border: 1px solid var(--border-soft);
text-align: center;
}
.stat-item .icon { font-size: 28px; margin-bottom: var(--space-2); }
.stat-item .value {
font-family: var(--font-display);
font-size: var(--text-xl);
font-weight: 700;
color: var(--fg);
}
.stat-item .desc {
font-size: var(--text-xs);
color: var(--muted);
margin-top: 2px;
}
/* Mood insights */
.insight-card {
background: var(--surface);
border-radius: var(--radius-md);
padding: var(--space-5);
margin-bottom: var(--space-5);
box-shadow: var(--elev-soft);
border: 1px solid var(--border-soft);
}
.insight-card h4 {
font-family: var(--font-display);
font-size: var(--text-base);
font-weight: 600;
margin-bottom: var(--space-4);
}
.insight-item {
display: flex;
align-items: center;
gap: var(--space-3);
padding: var(--space-3) 0;
border-bottom: 1px solid var(--border-soft);
}
.insight-item:last-child { border-bottom: none; }
.insight-icon {
width: 36px;
height: 36px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 18px;
flex-shrink: 0;
}
.insight-text {
flex: 1;
}
.insight-text .title {
font-size: var(--text-sm);
font-weight: 600;
color: var(--fg);
margin-bottom: 2px;
}
.insight-text .detail {
font-size: var(--text-xs);
color: var(--muted);
}
.insight-badge {
padding: 4px 10px;
border-radius: var(--radius-pill);
font-size: 11px;
font-weight: 600;
}
</style>
</head>
<body>
<div class="content-area">
<div class="page-title anim-fade">心情与天气</div>
<!-- Today's mood - using standardized mood: happy -->
<div class="today-mood-card anim-slide" style="animation-delay: 0.1s">
<div class="label">今日心情 · 5月31日</div>
<div class="big-mood">😊</div>
<div class="mood-text">开心的一天</div>
<div class="mood-sub">在图书馆享受了安静的午后时光</div>
</div>
<!-- Weather -->
<div class="weather-card anim-fade" style="animation-delay: 0.15s">
<h4>今日天气</h4>
<div class="weather-row">
<button class="weather-opt selected" aria-label="晴天">☀️<span>晴天</span></button>
<button class="weather-opt" aria-label="多云"><span>多云</span></button>
<button class="weather-opt" aria-label="下雨">🌧<span>下雨</span></button>
<button class="weather-opt" aria-label="下雪">❄️<span>下雪</span></button>
<button class="weather-opt" aria-label="有风">🍃<span>有风</span></button>
</div>
</div>
<!-- Mood chart - using standardized 5 moods -->
<div class="mood-chart-card anim-fade" style="animation-delay: 0.2s">
<h4>心情趋势</h4>
<div class="chart-period">
<button class="period-btn active" aria-label="近7天">近7天</button>
<button class="period-btn" aria-label="近30天">近30天</button>
<button class="period-btn" aria-label="近3月">近3月</button>
</div>
<div class="mood-line-chart">
<div class="chart-bar" style="height:70%;background:var(--secondary)"><div class="tooltip">😊 开心</div><span class="chart-date">25日</span></div>
<div class="chart-bar" style="height:50%;background:var(--tertiary)"><div class="tooltip">😐 平静</div><span class="chart-date">26日</span></div>
<div class="chart-bar" style="height:85%;background:var(--secondary)"><div class="tooltip">😊 开心</div><span class="chart-date">27日</span></div>
<div class="chart-bar" style="height:75%;background:var(--secondary)"><div class="tooltip">😊 开心</div><span class="chart-date">28日</span></div>
<div class="chart-bar" style="height:90%;background:var(--secondary)"><div class="tooltip">😊 开心</div><span class="chart-date">29日</span></div>
<div class="chart-bar" style="height:65%;background:var(--secondary)"><div class="tooltip">😊 开心</div><span class="chart-date">30日</span></div>
<div class="chart-bar" style="height:88%;background:var(--secondary)"><div class="tooltip">😊 开心</div><span class="chart-date">31日</span></div>
</div>
</div>
<!-- Stats -->
<div class="stats-grid anim-fade" style="animation-delay: 0.25s">
<div class="stat-item">
<div class="icon">😊</div>
<div class="value">72%</div>
<div class="desc">本月好心情占比</div>
</div>
<div class="stat-item">
<div class="icon">🔥</div>
<div class="value">12天</div>
<div class="desc">最长连续记录</div>
</div>
<div class="stat-item">
<div class="icon">☀️</div>
<div class="value">18天</div>
<div class="desc">晴天记录次数</div>
</div>
<div class="stat-item">
<div class="icon">📝</div>
<div class="value">28篇</div>
<div class="desc">本月日记篇数</div>
</div>
</div>
<!-- Insights -->
<div class="insight-card anim-fade" style="animation-delay: 0.3s">
<h4>心情洞察</h4>
<div class="insight-item">
<div class="insight-icon" style="background: var(--secondary-soft)">🌟</div>
<div class="insight-text">
<div class="title">最佳心情日</div>
<div class="detail">5月14日 — 和朋友聚餐的日子</div>
</div>
<div class="insight-badge" style="background:var(--secondary-soft);color:#2D7D46">开心</div>
</div>
<div class="insight-item">
<div class="insight-icon" style="background: var(--tertiary-soft)">💡</div>
<div class="insight-text">
<div class="title">开心触发因素</div>
<div class="detail">你的好心情常与「朋友」「美食」「学习」相关</div>
</div>
</div>
<div class="insight-item">
<div class="insight-icon" style="background: var(--rose-soft)">📊</div>
<div class="insight-text">
<div class="title">心情较上月提升</div>
<div class="detail">好心情天数增加了 15%</div>
</div>
<div class="insight-badge" style="background:var(--secondary-soft);color:#2D7D46">+15%</div>
</div>
</div>
<div style="height: var(--space-8)"></div>
</div>
<!-- Tab bar -->
<nav class="tab-bar" role="tablist">
<button class="tab-item" role="tab" aria-label="首页" aria-selected="false">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M3 9l9-7 9 7v11a2 2 0 01-2 2H5a2 2 0 01-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/></svg>
<span>首页</span>
</button>
<button class="tab-item" role="tab" aria-label="日历" aria-selected="false">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><rect x="3" y="4" width="18" height="18" rx="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg>
<span>日历</span>
</button>
<button class="tab-item" role="tab" aria-label="写日记" aria-selected="false" style="position:relative">
<div style="width:44px;height:44px;border-radius:50%;background:var(--accent);display:flex;align-items:center;justify-content:center;margin-top:-16px;box-shadow:0 4px 12px var(--shadow-accent)">
<svg viewBox="0 0 24 24" fill="none" stroke="var(--accent-on)" stroke-width="2.5" stroke-linecap="round" style="width:22px;height:22px" aria-hidden="true"><path d="M12 5v14M5 12h14"/></svg>
</div>
<span style="margin-top:2px">写日记</span>
</button>
<button class="tab-item" role="tab" aria-label="发现" aria-selected="false">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
<span>发现</span>
</button>
<button class="tab-item active" role="tab" aria-label="我的" aria-selected="true">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2"/><circle cx="12" cy="7" r="4"/></svg>
<span>我的</span>
</button>
</nav>
<div class="dynamic-island" aria-hidden="true"></div>
<div class="home-indicator" style="position:absolute;bottom:8px;left:50%;transform:translateX(-50%);z-index:101" aria-hidden="true"></div>
<script src="../js/theme-switcher.js"></script>
</body>
</html>

View File

@@ -0,0 +1,310 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=390, height=844, initial-scale=1, viewport-fit=cover">
<title>暖记 — 引导页</title>
<link href="https://fonts.googleapis.com/css2?family=Caveat:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="../css/tokens.css">
<link rel="stylesheet" href="../css/components.css">
<style>
body {
width: 390px;
height: 844px;
overflow: hidden;
background: var(--bg);
position: relative;
}
/* Global focus styles */
button:focus-visible, a:focus-visible, [role="tab"]:focus-visible {
box-shadow: 0 0 0 3px var(--focus-ring);
outline: none;
}
.skip-btn {
position: absolute;
top: calc(var(--safe-top) + 8px);
right: var(--space-5);
background: none;
border: none;
font-size: var(--text-base);
color: var(--muted);
cursor: pointer;
z-index: 50;
padding: var(--space-2);
min-height: 44px;
min-width: 44px;
}
.slides-wrapper {
position: absolute;
top: 0;
left: 0;
width: 300%;
height: 100%;
display: flex;
transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.slide {
width: 390px;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
padding: calc(var(--safe-top) + 48px) var(--space-8) calc(var(--safe-bottom) + 120px);
position: relative;
}
.slide-illustration {
width: 260px;
height: 260px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: var(--space-10);
position: relative;
}
.slide-illustration svg {
position: relative;
z-index: 1;
}
.slide-illustration::after {
content: '';
position: absolute;
width: 110%;
height: 110%;
border-radius: 50%;
border: 2px dashed var(--border);
animation: spin 20s linear infinite;
}
@keyframes spin {
to { transform: rotate(360deg); }
}
.slide-title {
font-family: var(--font-display);
font-size: var(--text-2xl);
font-weight: 700;
color: var(--fg);
text-align: center;
margin-bottom: var(--space-3);
}
.slide-desc {
font-size: var(--text-base);
color: var(--muted);
text-align: center;
line-height: var(--leading-body);
max-width: 280px;
}
/* Bottom controls */
.onboarding-bottom {
position: absolute;
bottom: calc(var(--safe-bottom) + 24px);
left: 0;
right: 0;
display: flex;
flex-direction: column;
align-items: center;
gap: var(--space-6);
padding: 0 var(--space-8);
z-index: 50;
}
.dots {
display: flex;
gap: 8px;
}
.dot {
width: 8px;
height: 8px;
border-radius: 50%;
background: var(--border);
transition: all var(--motion-base) var(--ease-bounce);
}
.dot.active {
width: 28px;
border-radius: 4px;
background: var(--accent);
}
.next-btn {
width: 100%;
padding: 16px;
background: var(--accent);
color: var(--accent-on);
border: none;
border-radius: var(--radius-pill);
font-family: var(--font-display);
font-size: var(--text-lg);
font-weight: 600;
cursor: pointer;
min-height: 44px;
box-shadow: 0 4px 20px var(--shadow-accent);
transition: all var(--motion-fast) var(--ease-bounce);
}
.next-btn:hover { transform: translateY(-1px); }
.next-btn:active { transform: scale(0.98); }
/* Step-specific backgrounds */
.step-1 .slide-illustration { background: linear-gradient(135deg, var(--surface-warm), color-mix(in oklab, var(--accent), transparent 70%)); }
.step-2 .slide-illustration { background: linear-gradient(135deg, var(--secondary-soft), color-mix(in oklab, var(--secondary), transparent 85%)); }
.step-3 .slide-illustration { background: linear-gradient(135deg, var(--tertiary-soft), color-mix(in oklab, var(--tertiary), transparent 80%)); }
/* Floating deco for each slide */
.slide-deco {
position: absolute;
pointer-events: none;
opacity: 0.12;
}
.page-num {
font-family: var(--font-display);
font-size: 120px;
font-weight: 800;
opacity: 0.04;
position: absolute;
top: calc(var(--safe-top) + 20px);
left: var(--space-5);
line-height: 1;
}
</style>
</head>
<body>
<button class="skip-btn" aria-label="跳过引导" onclick="goToSlide(2)">跳过</button>
<div class="slides-wrapper" id="slidesWrapper">
<!-- Step 1: Record -->
<div class="slide step-1">
<div class="page-num" aria-hidden="true">01</div>
<div class="slide-illustration anim-scale" style="animation-delay: 0.2s">
<svg width="140" height="140" viewBox="0 0 140 140" fill="none" aria-hidden="true">
<!-- Notebook -->
<rect x="25" y="15" width="90" height="110" rx="8" fill="white" stroke="var(--accent)" stroke-width="2.5"/>
<rect x="35" y="15" width="6" height="110" fill="var(--accent)" opacity="0.2"/>
<path d="M50 40h42M50 55h35M50 70h42M50 85h28" stroke="var(--accent)" stroke-width="2" stroke-linecap="round" opacity="0.6"/>
<!-- Pen -->
<g transform="translate(95, 50) rotate(30)">
<rect x="0" y="0" width="8" height="50" rx="4" fill="var(--secondary)"/>
<polygon points="2,50 6,50 4,58" fill="#2D2420"/>
</g>
<!-- Heart sticker -->
<g transform="translate(80, 25)">
<path d="M8 4C8 1.8 6.2 0 4 0S0 1.8 0 4c0 4 8 8 8 8s8-4 8-8c0-2.2-1.8-4-4-4z" fill="var(--accent)" opacity="0.7" transform="scale(1.2)"/>
</g>
</svg>
</div>
<div class="slide-title anim-fade" style="animation-delay: 0.3s">用手账的方式<br>记录每一天</div>
<p class="slide-desc anim-fade" style="animation-delay: 0.4s">
文字、贴纸、涂鸦、照片 — 选择你喜欢的方式,把日常变成一本温暖的手账
</p>
</div>
<!-- Step 2: Decorate -->
<div class="slide step-2">
<div class="page-num" aria-hidden="true">02</div>
<div class="slide-illustration anim-scale" style="animation-delay: 0.2s">
<svg width="140" height="140" viewBox="0 0 140 140" fill="none" aria-hidden="true">
<!-- Sticker sheet -->
<rect x="20" y="20" width="100" height="100" rx="12" fill="white" stroke="var(--secondary)" stroke-width="2"/>
<!-- Stickers -->
<circle cx="50" cy="48" r="14" fill="var(--tertiary)" opacity="0.8"/>
<text x="50" y="53" text-anchor="middle" font-size="16" aria-hidden="true">&#9728;&#65039;</text>
<circle cx="85" cy="48" r="14" fill="var(--rose)" opacity="0.6"/>
<text x="85" y="53" text-anchor="middle" font-size="16" aria-hidden="true">&#127800;</text>
<circle cx="50" cy="85" r="14" fill="var(--secondary)" opacity="0.5"/>
<text x="50" y="90" text-anchor="middle" font-size="16" aria-hidden="true">&#127807;</text>
<circle cx="85" cy="85" r="14" fill="var(--accent)" opacity="0.5"/>
<text x="85" y="90" text-anchor="middle" font-size="16" aria-hidden="true">&#9999;&#65039;</text>
<!-- Sparkles -->
<path d="M30 25l2 4 4 2-4 2-2 4-2-4-4-2 4-2z" fill="var(--tertiary)"/>
<path d="M108 30l2 3 3 2-3 1.5-2 3-1.5-3-3-1.5 3-2z" fill="var(--secondary)"/>
</svg>
</div>
<div class="slide-title anim-fade" style="animation-delay: 0.3s">海量贴纸与模板<br>随心装饰</div>
<p class="slide-desc anim-fade" style="animation-delay: 0.4s">
数百款手绘贴纸、精美模板和装饰素材,让你的日记独一无二
</p>
</div>
<!-- Step 3: Growth -->
<div class="slide step-3">
<div class="page-num" aria-hidden="true">03</div>
<div class="slide-illustration anim-scale" style="animation-delay: 0.2s">
<svg width="140" height="140" viewBox="0 0 140 140" fill="none" aria-hidden="true">
<!-- Calendar grid -->
<rect x="20" y="25" width="100" height="95" rx="10" fill="white" stroke="var(--tertiary)" stroke-width="2"/>
<rect x="20" y="25" width="100" height="24" rx="10" fill="var(--tertiary)" opacity="0.2"/>
<text x="70" y="42" text-anchor="middle" font-size="11" fill="#2D2420" font-weight="600" aria-hidden="true">心情日历</text>
<!-- Grid dots (mood indicators) -->
<g transform="translate(30, 58)">
<circle cx="0" cy="0" r="5" fill="var(--secondary)"/><circle cx="16" cy="0" r="5" fill="var(--accent)"/>
<circle cx="32" cy="0" r="5" fill="var(--tertiary)"/><circle cx="48" cy="0" r="5" fill="var(--secondary)"/>
<circle cx="64" cy="0" r="5" fill="var(--secondary)"/><circle cx="80" cy="0" r="5" fill="var(--rose)"/>
<circle cx="0" cy="18" r="5" fill="var(--accent)"/><circle cx="16" cy="18" r="5" fill="var(--secondary)"/>
<circle cx="32" cy="18" r="5" fill="var(--secondary)"/><circle cx="48" cy="18" r="5" fill="var(--tertiary)"/>
<circle cx="64" cy="18" r="5" fill="var(--secondary)"/><circle cx="80" cy="18" r="5" fill="var(--accent)"/>
<circle cx="0" cy="36" r="5" fill="var(--secondary)"/><circle cx="16" cy="36" r="5" fill="var(--tertiary)"/>
<circle cx="32" cy="36" r="5" fill="var(--secondary)"/>
</g>
<!-- Growth arrow -->
<g transform="translate(100, 105)">
<path d="M0 0 L10 -20 L20 0" stroke="var(--secondary)" stroke-width="2" fill="none" stroke-linecap="round"/>
<circle cx="10" cy="-22" r="3" fill="var(--secondary)"/>
</g>
</svg>
</div>
<div class="slide-title anim-fade" style="animation-delay: 0.3s">回顾成长轨迹<br>看见自己的变化</div>
<p class="slide-desc anim-fade" style="animation-delay: 0.4s">
心情追踪、日历回顾、统计洞察 — 不仅仅是记录,更是了解自己的旅程
</p>
</div>
</div>
<!-- Bottom controls -->
<div class="onboarding-bottom">
<div class="dots" aria-hidden="true">
<div class="dot active" id="dot0"></div>
<div class="dot" id="dot1"></div>
<div class="dot" id="dot2"></div>
</div>
<button class="next-btn" id="nextBtn" aria-label="下一步" onclick="nextSlide()">下一步</button>
</div>
<div class="home-indicator" style="position:absolute;bottom:8px;left:50%;transform:translateX(-50%);z-index:50" aria-hidden="true"></div>
<script>
let currentSlide = 0;
const totalSlides = 3;
const wrapper = document.getElementById('slidesWrapper');
const dots = [document.getElementById('dot0'), document.getElementById('dot1'), document.getElementById('dot2')];
const nextBtn = document.getElementById('nextBtn');
function goToSlide(index) {
currentSlide = Math.min(index, totalSlides - 1);
wrapper.style.transform = `translateX(-${currentSlide * 390}px)`;
dots.forEach((d, i) => d.classList.toggle('active', i === currentSlide));
nextBtn.textContent = currentSlide === totalSlides - 1 ? '开始使用' : '下一步';
nextBtn.setAttribute('aria-label', currentSlide === totalSlides - 1 ? '开始使用暖记' : '下一步');
}
function nextSlide() {
if (currentSlide < totalSlides - 1) {
goToSlide(currentSlide + 1);
}
}
</script>
<script src="../js/theme-switcher.js"></script>
</body>
</html>

View File

@@ -0,0 +1,330 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=390, height=844, initial-scale=1, viewport-fit=cover">
<title>暖记 — 个人中心</title>
<link href="https://fonts.googleapis.com/css2?family=Caveat:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="../css/tokens.css">
<link rel="stylesheet" href="../css/components.css">
<style>
body {
width: 390px; height: 844px;
overflow: hidden; background: var(--bg);
position: relative;
}
/* Global focus styles */
button:focus-visible, a:focus-visible, [role="tab"]:focus-visible {
box-shadow: 0 0 0 3px var(--focus-ring);
outline: none;
}
.content-area {
position: absolute; top: 0; left: 0; right: 0;
bottom: calc(var(--tab-height) + var(--safe-bottom));
overflow-y: auto; padding: 0 var(--space-5);
padding-top: calc(var(--safe-top) + var(--space-2));
scrollbar-width: none;
}
.content-area::-webkit-scrollbar { display: none; }
/* Profile header */
.profile-header {
text-align: center; padding: var(--space-5) 0;
margin-bottom: var(--space-5);
}
.avatar {
width: 80px; height: 80px; border-radius: 50%;
background: linear-gradient(135deg, var(--accent), var(--tertiary));
margin: 0 auto var(--space-3);
display: flex; align-items: center; justify-content: center;
font-size: 36px;
box-shadow: 0 4px 16px var(--shadow-input-focus);
}
.username {
font-family: var(--font-display);
font-size: var(--text-xl); font-weight: 700;
margin-bottom: 4px;
}
.bio {
font-size: var(--text-sm); color: var(--muted);
}
/* Stats bar */
.stats-bar {
display: flex; background: var(--surface);
border-radius: var(--radius-md); padding: var(--space-4);
box-shadow: var(--elev-soft); border: 1px solid var(--border-soft);
margin-bottom: var(--space-5);
}
.stat-item {
flex: 1; text-align: center;
border-right: 1px solid var(--border-soft);
}
.stat-item:last-child { border-right: none; }
.stat-item .num {
font-family: var(--font-display);
font-size: var(--text-xl); font-weight: 700; color: var(--fg);
}
.stat-item .num.accent { color: var(--accent); }
.stat-item .num.green { color: var(--secondary); }
.stat-item .label {
font-size: var(--text-xs); color: var(--muted); margin-top: 2px;
}
/* Achievement badges */
.badge-section {
margin-bottom: var(--space-5);
}
.badge-section h3 {
font-family: var(--font-display);
font-size: var(--text-lg); font-weight: 700;
margin-bottom: var(--space-4);
}
.badge-row {
display: flex; gap: var(--space-3); overflow-x: auto;
padding-bottom: var(--space-2);
scrollbar-width: none;
}
.badge-row::-webkit-scrollbar { display: none; }
.badge-item {
flex-shrink: 0; width: 80px;
display: flex; flex-direction: column;
align-items: center; gap: 6px;
}
.badge-icon {
width: 56px; height: 56px; border-radius: 50%;
display: flex; align-items: center; justify-content: center;
font-size: 24px;
}
.badge-name {
font-size: 11px; color: var(--muted); text-align: center;
font-weight: 500;
}
.badge-item.earned .badge-name { color: var(--fg-2); }
/* Settings list */
.settings-section {
margin-bottom: var(--space-5);
}
.settings-section h3 {
font-family: var(--font-display);
font-size: var(--text-lg); font-weight: 700;
margin-bottom: var(--space-3);
}
.settings-card {
background: var(--surface);
border-radius: var(--radius-md);
box-shadow: var(--elev-soft);
border: 1px solid var(--border-soft);
overflow: hidden;
}
.setting-item {
display: flex; align-items: center;
padding: var(--space-4) var(--space-5);
border-bottom: 1px solid var(--border-soft);
cursor: pointer;
transition: background var(--motion-fast);
min-height: 44px;
}
.setting-item:last-child { border-bottom: none; }
.setting-item:hover { background: var(--surface-warm); }
.setting-item .icon {
width: 36px; height: 36px; border-radius: var(--radius-sm);
display: flex; align-items: center; justify-content: center;
margin-right: var(--space-3); font-size: 18px; flex-shrink: 0;
}
.setting-item .text {
flex: 1;
}
.setting-item .text .title {
font-size: var(--text-base); font-weight: 500; color: var(--fg);
}
.setting-item .text .sub {
font-size: var(--text-xs); color: var(--muted); margin-top: 1px;
}
.setting-item .arrow {
color: var(--meta);
min-width: 44px; min-height: 44px;
display: flex; align-items: center; justify-content: center;
}
.setting-item .arrow svg { width: 16px; height: 16px; }
/* Toggle */
.toggle {
width: 44px; height: 26px; border-radius: 13px;
background: var(--border); position: relative;
cursor: pointer; transition: background var(--motion-fast);
}
.toggle.on { background: var(--accent); }
.toggle::after {
content: ''; position: absolute;
top: 3px; left: 3px;
width: 20px; height: 20px; border-radius: 50%;
background: white; transition: transform var(--motion-fast);
box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.toggle.on::after { transform: translateX(18px); }
</style>
</head>
<body>
<div class="content-area">
<!-- Profile -->
<div class="profile-header anim-fade">
<div class="avatar" aria-hidden="true">🐹</div>
<div class="username">小暖</div>
<div class="bio">每一天都值得被温柔记录</div>
</div>
<!-- Stats -->
<div class="stats-bar anim-fade" style="animation-delay: 0.1s">
<div class="stat-item">
<div class="num accent">156</div>
<div class="label">总日记</div>
</div>
<div class="stat-item">
<div class="num green">12</div>
<div class="label">连续天数</div>
</div>
<div class="stat-item">
<div class="num">28</div>
<div class="label">本月日记</div>
</div>
<div class="stat-item">
<div class="num">342</div>
<div class="label">使用贴纸</div>
</div>
</div>
<!-- Achievements -->
<div class="badge-section anim-fade" style="animation-delay: 0.15s">
<h3>成就徽章</h3>
<div class="badge-row">
<div class="badge-item earned">
<div class="badge-icon" style="background:var(--tertiary-soft)" aria-hidden="true">🔥</div>
<div class="badge-name">7天连续</div>
</div>
<div class="badge-item earned">
<div class="badge-icon" style="background:var(--secondary-soft)" aria-hidden="true">📝</div>
<div class="badge-name">百篇日记</div>
</div>
<div class="badge-item earned">
<div class="badge-icon" style="background:var(--rose-soft)" aria-hidden="true">🌸</div>
<div class="badge-name">贴纸达人</div>
</div>
<div class="badge-item">
<div class="badge-icon" style="background:var(--border-soft);opacity:0.5" aria-hidden="true">🏆</div>
<div class="badge-name">年度记录</div>
</div>
<div class="badge-item">
<div class="badge-icon" style="background:var(--border-soft);opacity:0.5" aria-hidden="true"></div>
<div class="badge-name">30天连续</div>
</div>
</div>
</div>
<!-- Settings -->
<div class="settings-section anim-fade" style="animation-delay: 0.2s">
<h3>设置</h3>
<div class="settings-card">
<div class="setting-item">
<div class="icon" style="background:var(--tertiary-soft)" aria-hidden="true">🔔</div>
<div class="text">
<div class="title">日记提醒</div>
<div class="sub">每天 21:00 提醒写日记</div>
</div>
<div class="toggle on" role="switch" aria-label="日记提醒开关" aria-checked="true" tabindex="0"></div>
</div>
<div class="setting-item">
<div class="icon" style="background:var(--secondary-soft)" aria-hidden="true">🔒</div>
<div class="text">
<div class="title">隐私锁</div>
<div class="sub">Face ID 解锁查看日记</div>
</div>
<div class="arrow" aria-hidden="true"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M6 12l4-4-4-4"/></svg></div>
</div>
<div class="setting-item">
<div class="icon" style="background:var(--secondary-soft)" aria-hidden="true">☁️</div>
<div class="text">
<div class="title">云端同步</div>
<div class="sub">已同步 · 上次 2分钟前</div>
</div>
<div class="arrow" aria-hidden="true"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M6 12l4-4-4-4"/></svg></div>
</div>
<div class="setting-item">
<div class="icon" style="background:var(--rose-soft)" aria-hidden="true">🎨</div>
<div class="text">
<div class="title">主题外观</div>
<div class="sub">暖色系 · 默认字体</div>
</div>
<div class="arrow" aria-hidden="true"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M6 12l4-4-4-4"/></svg></div>
</div>
</div>
</div>
<!-- More settings -->
<div class="settings-section anim-fade" style="animation-delay: 0.25s">
<div class="settings-card">
<div class="setting-item">
<div class="icon" style="background:var(--surface-warm)" aria-hidden="true">📦</div>
<div class="text">
<div class="title">导出数据</div>
</div>
<div class="arrow" aria-hidden="true"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M6 12l4-4-4-4"/></svg></div>
</div>
<div class="setting-item">
<div class="icon" style="background:var(--surface-warm)" aria-hidden="true">💬</div>
<div of="text">
<div class="title">意见反馈</div>
</div>
<div class="arrow" aria-hidden="true"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M6 12l4-4-4-4"/></svg></div>
</div>
<div class="setting-item">
<div class="icon" style="background:var(--surface-warm)" aria-hidden="true"></div>
<div class="text">
<div class="title">关于暖记</div>
<div class="sub">版本 1.0.0</div>
</div>
<div class="arrow" aria-hidden="true"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M6 12l4-4-4-4"/></svg></div>
</div>
</div>
</div>
<div style="height: var(--space-8)"></div>
</div>
<!-- Tab bar -->
<nav class="tab-bar" role="tablist">
<button class="tab-item" role="tab" aria-label="首页" aria-selected="false">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M3 9l9-7 9 7v11a2 2 0 01-2 2H5a2 2 0 01-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/></svg>
<span>首页</span>
</button>
<button class="tab-item" role="tab" aria-label="日历" aria-selected="false">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><rect x="3" y="4" width="18" height="18" rx="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg>
<span>日历</span>
</button>
<button class="tab-item" role="tab" aria-label="写日记" aria-selected="false" style="position:relative">
<div style="width:44px;height:44px;border-radius:50%;background:var(--accent);display:flex;align-items:center;justify-content:center;margin-top:-16px;box-shadow:0 4px 12px var(--shadow-accent)">
<svg viewBox="0 0 24 24" fill="none" stroke="var(--accent-on)" stroke-width="2.5" stroke-linecap="round" style="width:22px;height:22px" aria-hidden="true"><path d="M12 5v14M5 12h14"/></svg>
</div>
<span style="margin-top:2px">写日记</span>
</button>
<button class="tab-item" role="tab" aria-label="发现" aria-selected="false">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
<span>发现</span>
</button>
<button class="tab-item active" role="tab" aria-label="我的" aria-selected="true">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2"/><circle cx="12" cy="7" r="4"/></svg>
<span>我的</span>
</button>
</nav>
<div class="dynamic-island" aria-hidden="true"></div>
<div class="home-indicator" style="position:absolute;bottom:8px;left:50%;transform:translateX(-50%);z-index:101" aria-hidden="true"></div>
<script src="../js/theme-switcher.js"></script>
</body>
</html>

View File

@@ -0,0 +1,507 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=390, height=844, initial-scale=1, viewport-fit=cover">
<title>暖记 — 搜索</title>
<link href="https://fonts.googleapis.com/css2?family=Caveat:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="../css/tokens.css">
<link rel="stylesheet" href="../css/components.css">
<style>
body {
width: 390px;
height: 844px;
overflow: hidden;
background: var(--bg);
position: relative;
}
/* Focus styles */
button:focus-visible, a:focus-visible, input:focus-visible {
box-shadow: 0 0 0 3px var(--focus-ring);
outline: none;
}
/* Search header */
.search-header {
position: absolute;
top: 0;
left: 0;
right: 0;
height: calc(var(--safe-top) + 52px);
padding-top: var(--safe-top);
display: flex;
align-items: center;
gap: var(--space-3);
padding-left: var(--space-4);
padding-right: var(--space-4);
background: var(--surface);
border-bottom: 1px solid var(--border-soft);
z-index: 100;
}
.search-back-btn {
min-width: 44px;
min-height: 44px;
border-radius: var(--radius-pill);
border: none;
background: none;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
color: var(--fg);
transition: background var(--motion-fast);
flex-shrink: 0;
}
.search-back-btn:hover { background: var(--surface-warm); }
.search-back-btn svg { width: 22px; height: 22px; }
.search-input-wrap {
flex: 1;
position: relative;
display: flex;
align-items: center;
}
.search-input-wrap svg {
position: absolute;
left: var(--space-4);
width: 18px;
height: 18px;
color: var(--muted);
pointer-events: none;
}
.search-input {
width: 100%;
height: 44px;
border: none;
border-radius: var(--radius-pill);
background: var(--surface-warm);
padding: 0 var(--space-4) 0 44px;
font-size: var(--text-base);
color: var(--fg);
outline: none;
font-family: var(--font-body);
}
.search-input::placeholder { color: var(--meta); }
.search-cancel-btn {
border: none;
background: none;
color: var(--accent);
font-size: var(--text-base);
font-weight: 600;
cursor: pointer;
min-width: 44px;
min-height: 44px;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
transition: opacity var(--motion-fast);
}
.search-cancel-btn:hover { opacity: 0.7; }
/* Content area */
.search-content {
position: absolute;
top: calc(var(--safe-top) + 52px);
left: 0;
right: 0;
bottom: 0;
overflow-y: auto;
padding: var(--space-5);
scrollbar-width: none;
}
.search-content::-webkit-scrollbar { display: none; }
/* Section */
.search-section {
margin-bottom: var(--space-6);
}
.search-section-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: var(--space-3);
}
.search-section-title {
font-family: var(--font-display);
font-size: var(--text-base);
font-weight: 700;
color: var(--fg);
}
.search-section-action {
font-size: var(--text-sm);
color: var(--accent);
background: none;
border: none;
cursor: pointer;
font-weight: 500;
min-height: 44px;
display: inline-flex;
align-items: center;
}
/* History / hot tags */
.search-tags {
display: flex;
flex-wrap: wrap;
gap: var(--space-2);
}
.search-tag {
padding: 6px 16px;
border-radius: var(--radius-pill);
background: var(--surface-warm);
color: var(--fg-2);
font-size: var(--text-sm);
font-weight: 500;
border: 1px solid transparent;
cursor: pointer;
min-height: 44px;
display: inline-flex;
align-items: center;
transition: all var(--motion-fast);
}
.search-tag:hover { border-color: var(--accent); color: var(--accent); }
/* Result tabs */
.result-tabs {
display: flex;
gap: var(--space-1);
margin-bottom: var(--space-4);
border-bottom: 1px solid var(--border-soft);
padding-bottom: 2px;
}
.result-tab {
padding: var(--space-3) var(--space-4);
background: none;
border: none;
font-size: var(--text-sm);
font-weight: 600;
color: var(--muted);
cursor: pointer;
min-height: 44px;
position: relative;
transition: color var(--motion-fast);
}
.result-tab.active { color: var(--accent); }
.result-tab.active::after {
content: '';
position: absolute;
bottom: -3px;
left: var(--space-4);
right: var(--space-4);
height: 3px;
border-radius: 2px;
background: var(--accent);
}
/* Result card */
.result-card {
background: var(--surface);
border-radius: var(--radius-md);
padding: var(--space-4);
margin-bottom: var(--space-3);
box-shadow: var(--elev-soft);
border: 1px solid var(--border-soft);
cursor: pointer;
transition: transform var(--motion-fast) var(--ease-standard);
}
.result-card:hover { transform: translateY(-1px); }
.result-card:active { transform: scale(0.98); }
.result-card-top {
display: flex;
justify-content: space-between;
align-items: flex-start;
margin-bottom: 4px;
}
.result-card-title {
font-family: var(--font-display);
font-size: var(--text-base);
font-weight: 600;
color: var(--fg);
}
.result-card-title mark {
background: var(--tertiary-soft);
color: var(--accent);
border-radius: 2px;
padding: 0 2px;
}
.result-card-date {
font-size: var(--text-xs);
color: var(--muted);
white-space: nowrap;
margin-left: var(--space-3);
}
.result-card-excerpt {
font-size: var(--text-sm);
color: var(--muted);
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
line-height: 1.5;
}
.result-card-excerpt mark {
background: var(--tertiary-soft);
color: var(--accent);
border-radius: 2px;
padding: 0 2px;
}
.result-card-tags {
display: flex;
gap: var(--space-1);
margin-top: var(--space-2);
}
.result-card-tag {
font-size: var(--text-xs);
color: var(--accent);
background: var(--surface-warm);
padding: 2px 8px;
border-radius: var(--radius-pill);
}
/* Template result grid */
.result-template-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: var(--space-3);
}
.result-template-card {
background: var(--surface);
border-radius: var(--radius-md);
padding: var(--space-4);
box-shadow: var(--elev-soft);
border: 1px solid var(--border-soft);
text-align: center;
cursor: pointer;
transition: all var(--motion-fast);
}
.result-template-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.result-template-icon { font-size: 32px; margin-bottom: var(--space-2); }
.result-template-name {
font-family: var(--font-display);
font-size: var(--text-sm);
font-weight: 600;
color: var(--fg);
margin-bottom: 4px;
}
.result-template-desc {
font-size: var(--text-xs);
color: var(--muted);
}
.dynamic-island {
position: absolute;
top: 12px;
left: 50%;
transform: translateX(-50%);
width: 126px;
height: 36px;
background: #000;
border-radius: 20px;
z-index: 200;
}
.home-indicator {
position: absolute;
bottom: 8px;
left: 50%;
transform: translateX(-50%);
width: 134px;
height: 5px;
background: var(--fg);
opacity: 0.2;
border-radius: 3px;
z-index: 101;
}
</style>
</head>
<body>
<!-- Search header -->
<div class="search-header">
<button class="search-back-btn" aria-label="返回">
<svg viewBox="0 0 22 22" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M15 18l-6-6 6-6"/></svg>
</button>
<div class="search-input-wrap">
<svg viewBox="0 0 22 22" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><line x1="16" y1="16" x2="20" y2="20"/></svg>
<input class="search-input" type="text" id="searchInput" placeholder="搜索日记、模板、标签..." autocomplete="off" aria-label="搜索" autofocus>
</div>
<button class="search-cancel-btn" aria-label="取消搜索">取消</button>
</div>
<!-- Search content -->
<div class="search-content">
<!-- Before-search state -->
<div id="searchBefore">
<!-- Search history -->
<div class="search-section">
<div class="search-section-header">
<span class="search-section-title">最近搜索</span>
<button class="search-section-action" aria-label="清除搜索历史">清除</button>
</div>
<div class="search-tags">
<button class="search-tag" aria-label="搜索 期末考试">期末考试</button>
<button class="search-tag" aria-label="搜索 读书笔记">读书笔记</button>
<button class="search-tag" aria-label="搜索 旅行计划">旅行计划</button>
<button class="search-tag" aria-label="搜索 心情">心情</button>
</div>
</div>
<!-- Hot searches -->
<div class="search-section">
<div class="search-section-header">
<span class="search-section-title">热门搜索</span>
</div>
<div class="search-tags">
<button class="search-tag" aria-label="搜索 期末">#期末</button>
<button class="search-tag" aria-label="搜索 读书">#读书</button>
<button class="search-tag" aria-label="搜索 心情">#心情</button>
<button class="search-tag" aria-label="搜索 旅行">#旅行</button>
<button class="search-tag" aria-label="搜索 美食">#美食</button>
<button class="search-tag" aria-label="搜索 学习">#学习</button>
<button class="search-tag" aria-label="搜索 运动">#运动</button>
<button class="search-tag" aria-label="搜索 灵感">#灵感</button>
</div>
</div>
</div>
<!-- After-search state (results) -->
<div id="searchResults" style="display:none">
<!-- Result tabs -->
<div class="result-tabs" role="tablist">
<button class="result-tab active" role="tab" aria-label="全部结果" aria-selected="true">全部</button>
<button class="result-tab" role="tab" aria-label="日记结果" aria-selected="false">日记</button>
<button class="result-tab" role="tab" aria-label="模板结果" aria-selected="false">模板</button>
<button class="result-tab" role="tab" aria-label="标签结果" aria-selected="false">标签</button>
</div>
<!-- Diary results -->
<div id="resultDiary">
<div class="result-card" aria-label="打开日记 期末考试周复习计划">
<div class="result-card-top">
<span class="result-card-title">期末<mark>考试</mark>周复习计划</span>
<span class="result-card-date">2025年12月15日</span>
</div>
<div class="result-card-excerpt">今天开始了为期两周的期末<mark>考试</mark>复习,列了详细的计划表,每一科都安排了时间...</div>
<div class="result-card-tags">
<span class="result-card-tag">#学习</span>
<span class="result-card-tag">#期末</span>
</div>
</div>
<div class="result-card" aria-label="打开日记 考研倒计时30天">
<div class="result-card-top">
<span class="result-card-title">考研倒计时30天</span>
<span class="result-card-date">2025年11月25日</span>
</div>
<div class="result-card-excerpt">距离考研还有30天今天复习了英语阅读和政治感觉<mark>考试</mark>越来越近了...</div>
<div class="result-card-tags">
<span class="result-card-tag">#学习</span>
<span class="result-card-tag">#考研</span>
</div>
</div>
<div class="result-card" aria-label="打开日记 考试后的放松手账">
<div class="result-card-top">
<span class="result-card-title"><mark>考试</mark>后的放松手账</span>
<span class="result-card-date">2025年6月20日</span>
</div>
<div class="result-card-excerpt">终于考完试了!用手账记录了<mark>考试</mark>结束那一刻的心情,画了一幅小小的庆祝插画...</div>
<div class="result-card-tags">
<span class="result-card-tag">#心情</span>
<span class="result-card-tag">#手账</span>
</div>
</div>
</div>
<!-- Template results -->
<div id="resultTemplates" style="display:none">
<div class="result-template-grid">
<div class="result-template-card" aria-label="使用模板 考试复习计划">
<div class="result-template-icon">📝</div>
<div class="result-template-name"><mark>考试</mark>复习计划</div>
<div class="result-template-desc">适合期末<mark>考试</mark>周使用</div>
</div>
<div class="result-template-card" aria-label="使用模板 学习打卡">
<div class="result-template-icon">📚</div>
<div class="result-template-name">学习打卡</div>
<div class="result-template-desc">每日学习记录模板</div>
</div>
<div class="result-template-card" aria-label="使用模板 成绩分析">
<div class="result-template-icon">📊</div>
<div class="result-template-name">成绩分析</div>
<div class="result-template-desc"><mark>考试</mark>成绩复盘模板</div>
</div>
<div class="result-template-card" aria-label="使用模板 目标追踪">
<div class="result-template-icon">🎯</div>
<div class="result-template-name">目标追踪</div>
<div class="result-template-desc">学期目标追踪模板</div>
</div>
</div>
</div>
<!-- Tag results -->
<div id="resultTags" style="display:none">
<div class="search-tags" style="gap: var(--space-3);">
<button class="search-tag" style="padding: 10px 20px; font-size: var(--text-base);" aria-label="搜索标签 考试">#考试 (3篇)</button>
<button class="search-tag" style="padding: 10px 20px; font-size: var(--text-base);" aria-label="搜索标签 考研">#考研 (2篇)</button>
<button class="search-tag" style="padding: 10px 20px; font-size: var(--text-base);" aria-label="搜索标签 考试周">#考试周 (1篇)</button>
<button class="search-tag" style="padding: 10px 20px; font-size: var(--text-base);" aria-label="搜索标签 复习">#复习 (5篇)</button>
</div>
</div>
</div>
<div style="height: var(--space-6)"></div>
</div>
<div class="dynamic-island" aria-hidden="true"></div>
<div class="home-indicator" aria-hidden="true"></div>
<script>
var input = document.getElementById('searchInput');
var beforeEl = document.getElementById('searchBefore');
var resultsEl = document.getElementById('searchResults');
var resultTabs = document.querySelectorAll('.result-tab');
var panels = ['resultDiary', 'resultTemplates', 'resultTags'];
// Simulate search on input
input.addEventListener('input', function() {
if (this.value.trim().length > 0) {
beforeEl.style.display = 'none';
resultsEl.style.display = '';
} else {
beforeEl.style.display = '';
resultsEl.style.display = 'none';
}
});
// Tag click triggers search
document.querySelectorAll('.search-tag').forEach(function(tag) {
tag.addEventListener('click', function() {
input.value = this.textContent.trim();
input.dispatchEvent(new Event('input'));
});
});
// Result tabs
resultTabs.forEach(function(tab, idx) {
tab.addEventListener('click', function() {
resultTabs.forEach(function(t) { t.classList.remove('active'); t.setAttribute('aria-selected', 'false'); });
tab.classList.add('active');
tab.setAttribute('aria-selected', 'true');
panels.forEach(function(p, i) {
document.getElementById(p).style.display = i === idx ? '' : 'none';
});
});
});
// Focus input on load
input.focus();
</script>
<script src="../js/theme-switcher.js"></script>
</body>
</html>

View File

@@ -0,0 +1,208 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=390, height=844, initial-scale=1, viewport-fit=cover">
<title>暖记 — 启动页</title>
<link href="https://fonts.googleapis.com/css2?family=Caveat:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="../css/tokens.css">
<link rel="stylesheet" href="../css/components.css">
<style>
body {
width: 390px;
height: 844px;
overflow: hidden;
background: linear-gradient(165deg, var(--bg) 0%, var(--tertiary-soft) 40%, color-mix(in oklab, var(--accent), transparent 50%) 100%);
position: relative;
}
/* Global focus styles */
button:focus-visible, a:focus-visible, [role="tab"]:focus-visible {
box-shadow: 0 0 0 3px var(--focus-ring);
outline: none;
}
/* Floating decorative elements */
.deco {
position: absolute;
pointer-events: none;
}
.deco-star {
width: 28px; height: 28px;
opacity: 0.25;
animation: float 4s ease-in-out infinite;
}
.deco-circle {
border-radius: 50%;
opacity: 0.12;
animation: float 5s ease-in-out infinite reverse;
}
.deco-leaf {
opacity: 0.15;
animation: float 6s ease-in-out infinite;
}
@keyframes float {
0%, 100% { transform: translateY(0) rotate(0deg); }
50% { transform: translateY(-10px) rotate(5deg); }
}
.splash-content {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
text-align: center;
z-index: 10;
animation: scaleIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.app-icon {
width: 120px;
height: 120px;
margin: 0 auto 28px;
border-radius: 32px;
background: linear-gradient(135deg, var(--accent) 0%, var(--tertiary) 100%);
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 8px 32px var(--shadow-accent);
position: relative;
overflow: hidden;
}
.app-icon::after {
content: '';
position: absolute;
top: -30%;
right: -30%;
width: 60%;
height: 60%;
background: rgba(255,255,255,0.2);
border-radius: 50%;
}
.app-icon svg {
width: 56px;
height: 56px;
position: relative;
z-index: 1;
}
.app-name {
font-family: var(--font-display);
font-size: 42px;
font-weight: 700;
color: var(--fg);
letter-spacing: 2px;
margin-bottom: 12px;
}
.app-tagline {
font-family: var(--font-body);
font-size: var(--text-md);
color: var(--muted);
font-weight: 400;
letter-spacing: 1px;
}
.splash-bottom {
position: absolute;
bottom: calc(var(--safe-bottom) + 40px);
left: 0;
right: 0;
text-align: center;
animation: fadeIn 1s 0.5s both;
}
.splash-bottom .hint {
font-size: var(--text-sm);
color: var(--meta);
margin-top: 16px;
}
.splash-handwritten-tagline {
font-family: var(--font-handwritten);
font-size: 22px;
color: var(--accent);
margin-bottom: 20px;
letter-spacing: 1px;
animation: fadeIn 1s 0.3s both;
}
.enter-btn {
display: inline-flex;
align-items: center;
gap: 8px;
padding: 16px 48px;
background: var(--accent);
color: var(--accent-on);
border: none;
border-radius: var(--radius-pill);
font-family: var(--font-display);
font-size: var(--text-lg);
font-weight: 600;
cursor: pointer;
min-height: 44px;
box-shadow: 0 4px 20px var(--shadow-accent);
transition: all var(--motion-fast) var(--ease-bounce);
}
.enter-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 24px var(--focus-ring); }
.enter-btn:active { transform: scale(0.97); }
/* Decorative hand-drawn elements */
.wavy-line {
position: absolute;
bottom: 180px;
left: 50%;
transform: translateX(-50%);
opacity: 0.08;
}
</style>
</head>
<body>
<!-- Decorative floating elements -->
<svg class="deco deco-star" style="top:120px;left:60px" viewBox="0 0 24 24" fill="var(--accent)" aria-hidden="true">
<path d="M12 2l2.4 7.4H22l-6.2 4.5 2.4 7.4L12 16.8l-6.2 4.5 2.4-7.4L2 9.4h7.6z"/>
</svg>
<svg class="deco deco-star" style="top:200px;right:50px;animation-delay:-1.5s" viewBox="0 0 24 24" fill="var(--secondary)" aria-hidden="true">
<path d="M12 2l2.4 7.4H22l-6.2 4.5 2.4 7.4L12 16.8l-6.2 4.5 2.4-7.4L2 9.4h7.6z"/>
</svg>
<div class="deco deco-circle" style="width:80px;height:80px;background:var(--tertiary);top:160px;right:80px;animation-delay:-2s" aria-hidden="true"></div>
<div class="deco deco-circle" style="width:50px;height:50px;background:var(--rose);bottom:300px;left:40px;animation-delay:-3s" aria-hidden="true"></div>
<svg class="deco deco-star" style="bottom:350px;right:70px;animation-delay:-2.5s" viewBox="0 0 24 24" fill="var(--tertiary)" aria-hidden="true">
<path d="M12 2l2.4 7.4H22l-6.2 4.5 2.4 7.4L12 16.8l-6.2 4.5 2.4-7.4L2 9.4h7.6z"/>
</svg>
<div class="splash-content">
<div class="app-icon">
<!-- Journal/notebook icon -->
<svg viewBox="0 0 56 56" fill="none" aria-hidden="true">
<rect x="10" y="6" width="36" height="44" rx="4" fill="white" fill-opacity="0.9"/>
<rect x="14" y="6" width="4" height="44" fill="white" fill-opacity="0.3"/>
<path d="M20 18h18M20 24h14M20 30h18M20 36h10" stroke="var(--accent)" stroke-width="2" stroke-linecap="round"/>
<circle cx="42" cy="14" r="8" fill="var(--tertiary)" fill-opacity="0.6"/>
<path d="M39 14l2 2 4-4" stroke="var(--accent)" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</div>
<div class="app-name">暖记</div>
<div class="app-tagline">用温暖的方式,记录每一天</div>
</div>
<div class="splash-bottom">
<div class="splash-handwritten-tagline" aria-hidden="true">每一页,都是你的故事</div>
<button class="enter-btn" aria-label="开始使用暖记">
开始记录
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" aria-hidden="true">
<path d="M4 10h12M11 5l5 5-5 5" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</button>
<div class="hint">每一天都值得被温柔记录</div>
</div>
<div class="home-indicator" style="position:absolute;bottom:8px;left:50%;transform:translateX(-50%)" aria-hidden="true"></div>
<script src="../js/theme-switcher.js"></script>
</body>
</html>

View File

@@ -0,0 +1,431 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=390, height=844, initial-scale=1, viewport-fit=cover">
<title>暖记 — 贴纸素材库</title>
<link href="https://fonts.googleapis.com/css2?family=Caveat:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="../css/tokens.css">
<link rel="stylesheet" href="../css/components.css">
<style>
body {
width: 390px;
height: 844px;
overflow: hidden;
background: var(--bg);
position: relative;
}
/* Global focus styles */
button:focus-visible, a:focus-visible, [role="tab"]:focus-visible {
box-shadow: 0 0 0 3px var(--focus-ring);
outline: none;
}
.content-area {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
overflow-y: auto;
padding: 0 var(--space-5);
padding-top: calc(var(--safe-top) + var(--space-2));
padding-bottom: var(--safe-bottom);
scrollbar-width: none;
}
.content-area::-webkit-scrollbar { display: none; }
.top-bar {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: var(--space-4);
}
.top-bar h2 {
font-family: var(--font-display);
font-size: var(--text-2xl);
font-weight: 700;
}
.back-btn {
min-width: 44px;
min-height: 44px;
border-radius: 50%;
border: none;
background: var(--surface);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
color: var(--fg);
box-shadow: var(--elev-soft);
}
.back-btn svg { width: 20px; height: 20px; }
/* Search */
.search-box {
display: flex;
align-items: center;
gap: var(--space-3);
background: var(--surface);
border-radius: var(--radius-pill);
padding: var(--space-3) var(--space-5);
margin-bottom: var(--space-5);
box-shadow: var(--elev-soft);
border: 1px solid var(--border-soft);
}
.search-box svg { width: 20px; height: 20px; color: var(--muted); flex-shrink: 0; }
.search-box input {
flex: 1;
border: none;
outline: none;
font-size: var(--text-base);
background: transparent;
color: var(--fg);
font-family: var(--font-body);
}
.search-box input::placeholder { color: var(--meta); }
/* Category tabs */
.cat-tabs {
display: flex;
gap: var(--space-2);
margin-bottom: var(--space-5);
overflow-x: auto;
scrollbar-width: none;
padding-bottom: 4px;
}
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
padding: 8px 18px;
min-height: 44px;
border-radius: var(--radius-pill);
border: 1.5px solid var(--border);
background: var(--surface);
font-size: var(--text-sm);
font-weight: 500;
color: var(--fg-2);
cursor: pointer;
white-space: nowrap;
transition: all var(--motion-fast);
}
.cat-tab.active {
background: var(--accent);
color: var(--accent-on);
border-color: var(--accent);
}
.cat-tab:hover:not(.active) { border-color: var(--accent); color: var(--accent); }
/* Featured pack */
.featured-pack {
background: linear-gradient(135deg, var(--secondary-soft), var(--secondary-soft));
border-radius: var(--radius-lg);
padding: var(--space-5);
margin-bottom: var(--space-5);
display: flex;
gap: var(--space-4);
align-items: center;
cursor: pointer;
transition: transform var(--motion-fast);
}
.featured-pack:hover { transform: translateY(-2px); }
.featured-icon {
width: 72px;
height: 72px;
border-radius: var(--radius-md);
background: white;
display: flex;
align-items: center;
justify-content: center;
font-size: 36px;
box-shadow: var(--elev-soft);
flex-shrink: 0;
}
.featured-info h4 {
font-family: var(--font-display);
font-size: var(--text-lg);
font-weight: 700;
margin-bottom: 4px;
}
.featured-info p {
font-size: var(--text-sm);
color: var(--muted);
margin-bottom: var(--space-2);
}
.featured-info .tag {
display: inline-block;
padding: 3px 10px;
background: var(--secondary);
color: var(--accent-on);
border-radius: var(--radius-pill);
font-size: 11px;
font-weight: 600;
}
/* Sticker pack grid */
.pack-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: var(--space-3);
margin-bottom: var(--space-5);
}
.pack-card {
background: var(--surface);
border-radius: var(--radius-md);
overflow: hidden;
box-shadow: var(--elev-soft);
border: 1px solid var(--border-soft);
cursor: pointer;
transition: all var(--motion-fast);
}
.pack-card:hover { transform: translateY(-2px); box-shadow: var(--elev-medium); }
.pack-preview {
height: 100px;
display: flex;
align-items: center;
justify-content: center;
font-size: 36px;
gap: 8px;
}
.pack-info {
padding: var(--space-3) var(--space-4);
}
.pack-info h5 {
font-family: var(--font-display);
font-size: var(--text-sm);
font-weight: 600;
margin-bottom: 2px;
}
.pack-info .count {
font-size: var(--text-xs);
color: var(--muted);
}
.pack-info .price {
font-size: var(--text-xs);
font-weight: 600;
color: var(--accent);
margin-top: 4px;
}
.pack-info .free {
color: var(--secondary);
}
/* Individual stickers grid */
.section-head {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: var(--space-4);
}
.section-head h3 {
font-family: var(--font-display);
font-size: var(--text-lg);
font-weight: 700;
}
.section-head a {
font-size: var(--text-sm);
color: var(--accent);
text-decoration: none;
font-weight: 500;
min-height: 44px;
display: inline-flex;
align-items: center;
}
.sticker-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: var(--space-3);
margin-bottom: var(--space-5);
}
.sticker-cell {
aspect-ratio: 1;
background: var(--surface);
border-radius: var(--radius-md);
display: flex;
align-items: center;
justify-content: center;
font-size: 32px;
cursor: pointer;
transition: all var(--motion-fast) var(--ease-bounce);
box-shadow: var(--elev-soft);
border: 1px solid var(--border-soft);
position: relative;
min-height: 44px;
}
.sticker-cell:hover { transform: scale(1.08); border-color: var(--accent); }
.sticker-cell:active { transform: scale(0.95); }
.sticker-cell .fav {
position: absolute;
top: 4px;
right: 4px;
width: 18px;
height: 18px;
border-radius: 50%;
background: var(--surface);
display: flex;
align-items: center;
justify-content: center;
opacity: 0;
transition: opacity var(--motion-fast);
min-width: 44px;
min-height: 44px;
padding: 13px;
box-sizing: content-box;
top: -8px;
right: -8px;
}
.sticker-cell:hover .fav { opacity: 1; }
.sticker-cell .fav svg { width: 10px; height: 10px; color: var(--rose); }
.sticker-cell .fav.active svg { fill: var(--rose); }
/* Empty state for empty favorites */
.empty-state {
display: none; /* Shown via JS when favorites are empty */
flex-direction: column;
align-items: center;
justify-content: center;
padding: var(--space-10) var(--space-5);
text-align: center;
}
.empty-state .empty-circle {
width: 80px;
height: 80px;
border-radius: 50%;
border: 2px dashed var(--border);
display: flex;
align-items: center;
justify-content: center;
margin-bottom: var(--space-4);
font-size: 32px;
opacity: 0.6;
}
.empty-state .empty-text {
font-size: var(--text-base);
color: var(--muted);
font-weight: 500;
margin-bottom: var(--space-2);
}
.empty-state .empty-hint {
font-size: var(--text-sm);
color: var(--meta);
}
</style>
</head>
<body>
<div class="content-area">
<!-- Top bar -->
<div class="top-bar anim-fade">
<button class="back-btn" aria-label="返回">
<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M13 17l-6-6 6-6"/></svg>
</button>
<h2>贴纸素材</h2>
<div style="width:44px"></div>
</div>
<!-- Search -->
<div class="search-box anim-fade" style="animation-delay: 0.05s">
<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><circle cx="9" cy="9" r="6"/><path d="M14 14l4 4"/></svg>
<input type="text" placeholder="搜索贴纸、素材包..." aria-label="搜索贴纸">
</div>
<!-- Categories -->
<div class="cat-tabs anim-fade" style="animation-delay: 0.1s">
<button class="cat-tab active" aria-label="推荐分类">推荐</button>
<button class="cat-tab" aria-label="可爱分类">可爱</button>
<button class="cat-tab" aria-label="植物分类">植物</button>
<button class="cat-tab" aria-label="手绘分类">手绘</button>
<button class="cat-tab" aria-label="校园分类">校园</button>
<button class="cat-tab" aria-label="节日分类">节日</button>
<button class="cat-tab" aria-label="文字分类">文字</button>
<button class="cat-tab" aria-label="和纸胶带分类">和纸胶带</button>
</div>
<!-- Featured pack -->
<div class="featured-pack anim-slide" style="animation-delay: 0.15s">
<div class="featured-icon">🌸</div>
<div class="featured-info">
<h4>春日花园系列</h4>
<p>32款手绘花卉贴纸让你的日记春意盎然</p>
<span class="tag">限时免费</span>
</div>
</div>
<!-- Pack grid -->
<div class="section-head anim-fade" style="animation-delay: 0.2s">
<h3>热门素材包</h3>
<a href="#" aria-label="查看全部素材包">查看全部</a>
</div>
<div class="pack-grid anim-fade" style="animation-delay: 0.25s">
<div class="pack-card">
<div class="pack-preview" style="background: var(--tertiary-soft)">☕📚</div>
<div class="pack-info">
<h5>学习日常</h5>
<div class="count">24款贴纸</div>
<div class="price free">免费</div>
</div>
</div>
<div class="pack-card">
<div class="pack-preview" style="background: var(--secondary-soft)">🌿🍃</div>
<div class="pack-info">
<h5>清新植物</h5>
<div class="count">36款贴纸</div>
<div class="price">¥6</div>
</div>
</div>
<div class="pack-card">
<div class="pack-preview" style="background: var(--rose-soft)">🎀💕</div>
<div class="pack-info">
<h5>甜蜜少女</h5>
<div class="count">28款贴纸</div>
<div class="price">¥3</div>
</div>
</div>
<div class="pack-card">
<div class="pack-preview" style="background: var(--secondary-soft)">🦋✨</div>
<div class="pack-info">
<h5>梦幻星空</h5>
<div class="count">20款贴纸</div>
<div class="price free">免费</div>
</div>
</div>
</div>
<!-- Individual stickers -->
<div class="section-head anim-fade" style="animation-delay: 0.3s">
<h3>精选贴纸</h3>
<a href="#" aria-label="查看收藏夹">收藏夹</a>
</div>
<div class="sticker-grid anim-fade" style="animation-delay: 0.35s">
<div class="sticker-cell" aria-label="樱花贴纸">🌸<div class="fav"><svg viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M6 10s-4-2.5-4-5a2 2 0 014 0 2 2 0 014 0c0 2.5-4 5-4 5z"/></svg></div></div>
<div class="sticker-cell" aria-label="星星贴纸"><div class="fav"><svg viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M6 10s-4-2.5-4-5a2 2 0 014 0 2 2 0 014 0c0 2.5-4 5-4 5z"/></svg></div></div>
<div class="sticker-cell" aria-label="树叶贴纸">🌿<div class="fav active"><svg viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M6 10s-4-2.5-4-5a2 2 0 014 0 2 2 0 014 0c0 2.5-4 5-4 5z"/></svg></div></div>
<div class="sticker-cell" aria-label="太阳贴纸">☀️<div class="fav"><svg viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M6 10s-4-2.5-4-5a2 2 0 014 0 2 2 0 014 0c0 2.5-4 5-4 5z"/></svg></div></div>
<div class="sticker-cell" aria-label="蛋糕贴纸">🍰<div class="fav"><svg viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M6 10s-4-2.5-4-5a2 2 0 014 0 2 2 0 014 0c0 2.5-4 5-4 5z"/></svg></div></div>
<div class="sticker-cell" aria-label="音乐贴纸">🎵<div class="fav"><svg viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M6 10s-4-2.5-4-5a2 2 0 014 0 2 2 0 014 0c0 2.5-4 5-4 5z"/></svg></div></div>
<div class="sticker-cell" aria-label="书本贴纸">📚<div class="fav"><svg viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M6 10s-4-2.5-4-5a2 2 0 014 0 2 2 0 014 0c0 2.5-4 5-4 5z"/></svg></div></div>
<div class="sticker-cell" aria-label="月亮贴纸">🌙<div class="fav active"><svg viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M6 10s-4-2.5-4-5a2 2 0 014 0 2 2 0 014 0c0 2.5-4 5-4 5z"/></svg></div></div>
<div class="sticker-cell" aria-label="蝴蝶结贴纸">🎀<div class="fav"><svg viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M6 10s-4-2.5-4-5a2 2 0 014 0 2 2 0 014 0c0 2.5-4 5-4 5z"/></svg></div></div>
<div class="sticker-cell" aria-label="枫叶贴纸">🍂<div class="fav"><svg viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M6 10s-4-2.5-4-5a2 2 0 014 0 2 2 0 014 0c0 2.5-4 5-4 5z"/></svg></div></div>
<div class="sticker-cell" aria-label="咖啡贴纸"><div class="fav"><svg viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M6 10s-4-2.5-4-5a2 2 0 014 0 2 2 0 014 0c0 2.5-4 5-4 5z"/></svg></div></div>
<div class="sticker-cell" aria-label="蝴蝶贴纸">🦋<div class="fav"><svg viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M6 10s-4-2.5-4-5a2 2 0 014 0 2 2 0 014 0c0 2.5-4 5-4 5z"/></svg></div></div>
</div>
<!-- Empty state for empty favorites (hidden by default) -->
<div class="empty-state" id="emptyFavorites">
<div class="empty-circle">💜</div>
<div class="empty-text">收藏夹是空的</div>
<div class="empty-hint">长按贴纸可添加到收藏夹</div>
</div>
<div style="height: var(--space-8)"></div>
</div>
<div class="dynamic-island" aria-hidden="true"></div>
<div class="home-indicator" style="position:absolute;bottom:8px;left:50%;transform:translateX(-50%);z-index:101" aria-hidden="true"></div>
<script src="../js/theme-switcher.js"></script>
</body>
</html>

View File

@@ -0,0 +1,485 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=1024, height=768, initial-scale=1">
<title>暖记 — 平板端日历</title>
<link rel="stylesheet" href="../css/tokens.css">
<link rel="stylesheet" href="../css/components.css">
<link rel="stylesheet" href="shared.css">
<style>
body {
width: 1024px;
height: 768px;
overflow: hidden;
background: var(--bg);
font-family: var(--font-body);
}
.calendar-layout {
display: flex;
height: 768px;
}
.sidebar { position: relative; flex-shrink: 0; }
.calendar-main {
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
}
/* Top bar */
.cal-topbar {
height: 56px;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 var(--space-6);
background: var(--surface);
border-bottom: 1px solid var(--border-soft);
flex-shrink: 0;
}
.cal-topbar-left {
display: flex;
align-items: center;
gap: var(--space-4);
}
.cal-topbar-title {
font-family: var(--font-display);
font-size: var(--text-xl);
font-weight: 700;
color: var(--fg);
}
.cal-nav {
display: flex;
gap: var(--space-2);
}
.cal-nav button {
width: 34px;
height: 34px;
border-radius: 50%;
border: 1.5px solid var(--border);
background: var(--surface);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
color: var(--fg);
transition: all var(--motion-fast);
}
.cal-nav button:hover { border-color: var(--accent); color: var(--accent); }
.cal-nav button svg { width: 16px; height: 16px; }
.view-toggle {
display: flex;
background: var(--surface-warm);
border-radius: var(--radius-pill);
padding: 3px;
border: 1px solid var(--border-soft);
}
.view-toggle button {
padding: 7px 18px;
border: none;
border-radius: var(--radius-pill);
background: transparent;
font-size: var(--text-sm);
font-weight: 500;
color: var(--muted);
cursor: pointer;
transition: all var(--motion-fast);
}
.view-toggle button.active {
background: var(--accent);
color: var(--accent-on);
box-shadow: var(--elev-soft);
}
/* Two-column: calendar left + timeline right */
.cal-body {
flex: 1;
display: flex;
overflow: hidden;
}
.cal-left {
flex: 1;
padding: var(--space-6);
overflow-y: auto;
scrollbar-width: thin;
scrollbar-color: var(--border) transparent;
}
.cal-left::-webkit-scrollbar { width: 4px; }
.cal-left::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.cal-right {
width: 340px;
background: var(--surface);
border-left: 1px solid var(--border-soft);
padding: var(--space-6);
overflow-y: auto;
scrollbar-width: thin;
flex-shrink: 0;
}
.cal-right::-webkit-scrollbar { width: 4px; }
.cal-right::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
/* Mood summary card */
.mood-summary {
background: var(--bg);
border-radius: var(--radius-md);
padding: var(--space-5);
margin-bottom: var(--space-5);
border: 1px solid var(--border-soft);
}
.mood-summary h4 {
font-family: var(--font-display);
font-size: var(--text-base);
font-weight: 600;
margin-bottom: var(--space-4);
}
.mood-bar-chart {
display: flex;
align-items: flex-end;
gap: var(--space-4);
height: 80px;
margin-bottom: var(--space-3);
}
.mood-bar {
flex: 1;
border-radius: 6px 6px 0 0;
display: flex;
align-items: flex-end;
justify-content: center;
padding-bottom: 4px;
font-size: 16px;
}
.mood-labels {
display: flex;
gap: var(--space-3);
}
.mood-labels span {
flex: 1;
text-align: center;
font-size: 11px;
color: var(--muted);
}
/* Calendar grid */
.weekday-row {
display: grid;
grid-template-columns: repeat(7, 1fr);
text-align: center;
margin-bottom: var(--space-2);
}
.weekday-row span {
font-size: var(--text-xs);
color: var(--meta);
font-weight: 500;
}
.calendar-grid {
display: grid;
grid-template-columns: repeat(7, 1fr);
gap: 4px;
}
.cal-day {
aspect-ratio: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
border-radius: var(--radius-sm);
cursor: pointer;
position: relative;
transition: all var(--motion-fast);
background: transparent;
border: none;
font-size: var(--text-sm);
color: var(--fg);
gap: 2px;
}
.cal-day:hover { background: var(--surface-warm); }
.cal-day.empty { cursor: default; }
.cal-day.empty:hover { background: transparent; }
.cal-day.today {
background: var(--accent);
color: var(--accent-on);
font-weight: 700;
}
.cal-day.selected {
background: var(--surface-warm);
border: 2px solid var(--accent);
}
.cal-day.today.selected { background: var(--accent); border: 2px solid var(--accent); }
.mood-dot {
width: 6px;
height: 6px;
border-radius: 50%;
position: absolute;
bottom: 4px;
}
.mood-dot.happy { background: var(--secondary); }
.mood-dot.love { background: var(--accent); }
.mood-dot.calm { background: var(--tertiary); }
.mood-dot.sad { background: #5B7DB1; }
.mood-dot.tired { background: #8B7E74; }
.entry-indicator {
position: absolute;
top: 3px;
right: 5px;
width: 5px;
height: 5px;
border-radius: 50%;
background: var(--accent);
}
.cal-day.today .entry-indicator { background: var(--accent-on); }
/* Timeline on right panel */
.timeline-title {
font-family: var(--font-display);
font-size: var(--text-lg);
font-weight: 700;
color: var(--fg);
margin-bottom: var(--space-2);
}
.timeline-date {
font-size: var(--text-sm);
color: var(--muted);
margin-bottom: var(--space-5);
}
.timeline-item {
display: flex;
gap: var(--space-3);
margin-bottom: var(--space-4);
position: relative;
}
.timeline-line {
width: 2px;
background: var(--border);
position: absolute;
left: 17px;
top: 38px;
bottom: -12px;
}
.timeline-item:last-child .timeline-line { display: none; }
.timeline-dot {
width: 36px;
height: 36px;
border-radius: 50%;
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
font-size: 16px;
background: var(--bg);
border: 2px solid var(--border-soft);
position: relative;
z-index: 1;
}
.timeline-content {
flex: 1;
background: var(--bg);
border-radius: var(--radius-md);
padding: var(--space-4);
border: 1px solid var(--border-soft);
cursor: pointer;
transition: transform var(--motion-fast);
}
.timeline-content:hover { transform: translateY(-1px); }
.tl-time {
font-size: var(--text-xs);
color: var(--muted);
margin-bottom: 4px;
}
.tl-title {
font-family: var(--font-display);
font-size: var(--text-base);
font-weight: 600;
color: var(--fg);
margin-bottom: 4px;
}
.tl-excerpt {
font-size: var(--text-sm);
color: var(--muted);
line-height: 1.5;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
</style>
</head>
<body>
<div class="calendar-layout">
<!-- Sidebar -->
<nav class="sidebar" role="navigation" aria-label="主导航">
<div class="sidebar-brand">
<div class="sidebar-logo">📖</div>
<div>
<div class="sidebar-brand-text">暖记</div>
<div class="sidebar-brand-sub">Warm Notes</div>
</div>
</div>
<div class="sidebar-nav">
<button class="sidebar-nav-item" role="button" aria-label="首页">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M3 9l9-7 9 7v11a2 2 0 01-2 2H5a2 2 0 01-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/></svg>
首页
</button>
<button class="sidebar-nav-item active" role="button" aria-label="日历">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><rect x="3" y="4" width="18" height="18" rx="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg>
日历
</button>
<button class="sidebar-nav-item" role="button" aria-label="心情追踪">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M20.84 4.61a5.5 5.5 0 00-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 00-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 000-7.78z"/></svg>
心情追踪
</button>
<button class="sidebar-nav-item" role="button" aria-label="贴纸库">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><rect x="3" y="3" width="18" height="18" rx="3"/><circle cx="9" cy="10" r="1.5" fill="currentColor"/><circle cx="15" cy="10" r="1.5" fill="currentColor"/><path d="M9 15c.8.8 2.2 1.2 3 1.2s2.2-.4 3-1.2"/></svg>
贴纸库
</button>
<button class="sidebar-nav-item" role="button" aria-label="模板">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><rect x="3" y="3" width="7" height="7" rx="1"/><rect x="14" y="3" width="7" height="7" rx="1"/><rect x="3" y="14" width="7" height="7" rx="1"/><rect x="14" y="14" width="7" height="7" rx="1"/></svg>
模板
</button>
</div>
<button class="sidebar-write-btn" aria-label="写日记">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"><path d="M12 5v14M5 12h14"/></svg>
写日记
</button>
<div class="sidebar-footer">
<div class="sidebar-avatar">🐱</div>
<div>
<div class="sidebar-user-name">小暖</div>
<div class="sidebar-user-streak">连续记录 12 天</div>
</div>
</div>
</nav>
<main class="calendar-main" role="main">
<!-- Top bar -->
<div class="cal-topbar">
<div class="cal-topbar-left">
<div class="cal-topbar-title">日历</div>
<div class="cal-nav">
<button aria-label="上一月"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M10 14l-5-5 5-5"/></svg></button>
<button aria-label="下一月"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M6 2l5 5-5 5"/></svg></button>
</div>
<span style="font-size:var(--text-base);color:var(--fg-2);font-weight:500">2026年5月</span>
</div>
<div class="view-toggle">
<button class="active">月视图</button>
<button>周视图</button>
<button>时间轴</button>
</div>
</div>
<!-- Calendar + Timeline -->
<div class="cal-body">
<div class="cal-left">
<!-- Mood summary -->
<div class="mood-summary">
<h4>本月心情概览</h4>
<div class="mood-bar-chart">
<div class="mood-bar" style="height:65%;background:var(--secondary)">😊</div>
<div class="mood-bar" style="height:45%;background:var(--accent)">🥰</div>
<div class="mood-bar" style="height:30%;background:var(--tertiary)">😌</div>
<div class="mood-bar" style="height:15%;background:#5B7DB1">😔</div>
<div class="mood-bar" style="height:20%;background:#8B7E74">😴</div>
</div>
<div class="mood-labels">
<span>开心 12天</span>
<span>幸福 8天</span>
<span>平静 5天</span>
<span>低落 2天</span>
<span>疲惫 3天</span>
</div>
</div>
<!-- Calendar grid -->
<div class="weekday-row">
<span></span><span></span><span></span><span></span><span></span><span></span><span></span>
</div>
<div class="calendar-grid">
<div class="cal-day empty"></div><div class="cal-day empty"></div><div class="cal-day empty"></div><div class="cal-day empty"></div><div class="cal-day empty"></div>
<div class="cal-day" data-day="1"><span>1</span><div class="mood-dot happy"></div></div>
<div class="cal-day" data-day="2"><span>2</span><div class="mood-dot happy"></div><div class="entry-indicator"></div></div>
<div class="cal-day" data-day="3"><span>3</span><div class="mood-dot calm"></div></div>
<div class="cal-day" data-day="4"><span>4</span><div class="mood-dot love"></div><div class="entry-indicator"></div></div>
<div class="cal-day" data-day="5"><span>5</span><div class="mood-dot happy"></div><div class="entry-indicator"></div></div>
<div class="cal-day" data-day="6"><span>6</span><div class="mood-dot happy"></div></div>
<div class="cal-day" data-day="7"><span>7</span><div class="mood-dot tired"></div><div class="entry-indicator"></div></div>
<div class="cal-day" data-day="8"><span>8</span><div class="mood-dot happy"></div></div>
<div class="cal-day" data-day="9"><span>9</span><div class="mood-dot love"></div><div class="entry-indicator"></div></div>
<div class="cal-day" data-day="10"><span>10</span><div class="mood-dot calm"></div></div>
<div class="cal-day" data-day="11"><span>11</span><div class="mood-dot happy"></div><div class="entry-indicator"></div></div>
<div class="cal-day" data-day="12"><span>12</span><div class="mood-dot tired"></div></div>
<div class="cal-day" data-day="13"><span>13</span><div class="mood-dot happy"></div><div class="entry-indicator"></div></div>
<div class="cal-day" data-day="14"><span>14</span><div class="mood-dot love"></div><div class="entry-indicator"></div></div>
<div class="cal-day" data-day="15"><span>15</span><div class="mood-dot calm"></div></div>
<div class="cal-day" data-day="16"><span>16</span><div class="mood-dot happy"></div><div class="entry-indicator"></div></div>
<div class="cal-day" data-day="17"><span>17</span><div class="mood-dot sad"></div><div class="entry-indicator"></div></div>
<div class="cal-day" data-day="18"><span>18</span><div class="mood-dot calm"></div></div>
<div class="cal-day" data-day="19"><span>19</span><div class="mood-dot happy"></div><div class="entry-indicator"></div></div>
<div class="cal-day" data-day="20"><span>20</span><div class="mood-dot happy"></div><div class="entry-indicator"></div></div>
<div class="cal-day" data-day="21"><span>21</span><div class="mood-dot love"></div><div class="entry-indicator"></div></div>
<div class="cal-day" data-day="22"><span>22</span><div class="mood-dot tired"></div></div>
<div class="cal-day" data-day="23"><span>23</span><div class="mood-dot happy"></div><div class="entry-indicator"></div></div>
<div class="cal-day" data-day="24"><span>24</span><div class="mood-dot happy"></div><div class="entry-indicator"></div></div>
<div class="cal-day" data-day="25"><span>25</span><div class="mood-dot calm"></div></div>
<div class="cal-day" data-day="26"><span>26</span><div class="mood-dot love"></div><div class="entry-indicator"></div></div>
<div class="cal-day" data-day="27"><span>27</span><div class="mood-dot happy"></div><div class="entry-indicator"></div></div>
<div class="cal-day" data-day="28"><span>28</span><div class="mood-dot happy"></div><div class="entry-indicator"></div></div>
<div class="cal-day" data-day="29"><span>29</span><div class="mood-dot love"></div><div class="entry-indicator"></div></div>
<div class="cal-day" data-day="30"><span>30</span><div class="mood-dot happy"></div><div class="entry-indicator"></div></div>
<div class="cal-day today selected" data-day="31"><span>31</span><div class="mood-dot love" style="background:var(--accent-on)"></div></div>
</div>
</div>
<!-- Right timeline panel -->
<aside class="cal-right" role="complementary" aria-label="日期详情">
<div class="timeline-title">5月31日 · 今天</div>
<div class="timeline-date">3条记录</div>
<div class="timeline-item">
<div class="timeline-line"></div>
<div class="timeline-dot">🥰</div>
<div class="timeline-content">
<div class="tl-time">14:30 · 心情: 幸福</div>
<div class="tl-title">图书馆的午后时光</div>
<div class="tl-excerpt">今天下午去图书馆自习,阳光从窗外洒进来,暖暖的...</div>
</div>
</div>
<div class="timeline-item">
<div class="timeline-line"></div>
<div class="timeline-dot">😊</div>
<div class="timeline-content">
<div class="tl-time">09:15 · 心情: 开心</div>
<div class="tl-title">周末早起的奖励</div>
<div class="tl-excerpt">难得周末早起,去食堂吃了喜欢的豆浆油条...</div>
</div>
</div>
<div class="timeline-item">
<div class="timeline-line"></div>
<div class="timeline-dot">😌</div>
<div class="timeline-content">
<div class="tl-time">07:00 · 心情: 平静</div>
<div class="tl-title">晨跑记录</div>
<div class="tl-excerpt">早起跑了两圈操场,空气很清新...</div>
</div>
</div>
</div>
</aside>
</div>
</main>
</div>
<script src="../../js/theme-switcher.js"></script>
</body>
</html>

View File

@@ -0,0 +1,638 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=1024, height=768, initial-scale=1">
<title>暖记 — 平板端发现</title>
<link rel="stylesheet" href="../css/tokens.css">
<link rel="stylesheet" href="../css/components.css">
<link rel="stylesheet" href="shared.css">
<style>
body {
width: 1024px;
height: 768px;
overflow: hidden;
background: var(--bg);
font-family: var(--font-body);
}
.main-content { height: 768px; }
.content-inner {
padding: var(--space-6) var(--space-8);
max-width: none;
}
/* Page header */
.page-header {
margin-bottom: var(--space-5);
}
.page-header h1 {
font-family: var(--font-display);
font-size: var(--text-3xl);
font-weight: 700;
color: var(--fg);
}
.page-header-sub {
font-size: var(--text-base);
color: var(--muted);
margin-top: var(--space-1);
}
/* Search bar */
.search-bar {
display: flex;
align-items: center;
gap: var(--space-3);
background: var(--surface);
border-radius: var(--radius-pill);
padding: var(--space-3) var(--space-5);
margin-bottom: var(--space-6);
border: 1px solid var(--border-soft);
box-shadow: var(--elev-soft);
transition: border-color var(--motion-fast) var(--ease-standard);
}
.search-bar:focus-within {
border-color: var(--accent);
}
.search-bar svg {
width: 20px;
height: 20px;
color: var(--muted);
flex-shrink: 0;
}
.search-bar input {
flex: 1;
border: none;
background: none;
font-family: var(--font-body);
font-size: var(--text-md);
color: var(--fg);
outline: none;
}
.search-bar input::placeholder {
color: var(--meta);
}
/* Two-column layout */
.discover-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: var(--space-6);
}
.left-col,
.right-col {
display: flex;
flex-direction: column;
gap: var(--space-5);
}
/* Section heading */
.section-heading {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: var(--space-4);
}
.section-heading h3 {
font-family: var(--font-display);
font-size: var(--text-lg);
font-weight: 700;
}
.section-heading .more {
font-size: var(--text-sm);
color: var(--accent);
cursor: pointer;
background: none;
border: none;
font-weight: 500;
min-height: var(--touch-min);
display: inline-flex;
align-items: center;
}
.section-heading .more:focus-visible {
box-shadow: var(--focus-ring);
outline: none;
border-radius: 4px;
}
/* Topics */
.topics-scroll {
display: flex;
flex-wrap: wrap;
gap: var(--space-2);
}
.topic-chip {
display: inline-flex;
align-items: center;
gap: var(--space-1);
padding: var(--space-2) var(--space-4);
border-radius: var(--radius-pill);
font-size: var(--text-sm);
font-weight: 500;
white-space: nowrap;
cursor: pointer;
border: 1px solid var(--border);
background: var(--surface);
color: var(--fg-2);
transition: all var(--motion-fast) var(--ease-standard);
min-height: var(--touch-min);
box-shadow: var(--elev-soft);
}
.topic-chip:hover {
border-color: var(--accent);
color: var(--accent);
}
.topic-chip:focus-visible {
box-shadow: var(--focus-ring);
outline: none;
}
.topic-chip.active {
background: var(--accent);
color: var(--accent-on);
border-color: var(--accent);
}
.topic-chip .emoji {
font-size: 16px;
}
/* Expert diary cards */
.experts-list {
display: flex;
flex-direction: column;
gap: var(--space-3);
}
.expert-card {
background: var(--surface);
border-radius: var(--radius-md);
padding: var(--space-4);
box-shadow: var(--elev-soft);
border: 1px solid var(--border-soft);
display: flex;
gap: var(--space-3);
cursor: pointer;
transition: transform var(--motion-fast) var(--ease-standard);
}
.expert-card:hover { transform: translateY(-1px); }
.expert-card:active { transform: scale(0.98); }
.expert-avatar {
width: 44px;
height: 44px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 20px;
flex-shrink: 0;
}
.expert-info {
flex: 1;
min-width: 0;
}
.expert-name {
font-size: var(--text-xs);
color: var(--muted);
margin-bottom: 2px;
}
.expert-title {
font-family: var(--font-display);
font-size: var(--text-base);
font-weight: 600;
color: var(--fg);
margin-bottom: 4px;
}
.expert-preview {
font-size: var(--text-sm);
color: var(--muted);
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
line-height: 1.5;
}
.expert-likes {
display: flex;
align-items: center;
gap: 4px;
font-size: var(--text-xs);
color: var(--muted);
flex-shrink: 0;
margin-top: 2px;
}
.expert-likes svg {
width: 14px;
height: 14px;
color: var(--rose);
}
/* Inspiration card */
.inspiration-card {
background: linear-gradient(135deg, var(--accent) 0%, var(--tertiary) 100%);
border-radius: var(--radius-lg);
padding: var(--space-6);
position: relative;
overflow: hidden;
cursor: pointer;
transition: transform var(--motion-fast) var(--ease-bounce);
}
.inspiration-card:hover { transform: translateY(-2px); }
.inspiration-card::before {
content: '';
position: absolute;
top: -30px;
right: -30px;
width: 140px;
height: 140px;
border-radius: 50%;
background: rgba(255,255,255,0.12);
}
.inspiration-card::after {
content: '';
position: absolute;
bottom: -20px;
left: 40px;
width: 90px;
height: 90px;
border-radius: 50%;
background: rgba(255,255,255,0.08);
}
.inspiration-label {
font-size: var(--text-xs);
color: rgba(255,255,255,0.7);
font-weight: 500;
margin-bottom: var(--space-2);
text-transform: uppercase;
letter-spacing: 0.5px;
}
.inspiration-body {
display: flex;
gap: var(--space-4);
align-items: center;
}
.inspiration-thumb {
width: 88px;
height: 88px;
border-radius: var(--radius-md);
background: rgba(255,255,255,0.2);
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
font-size: 40px;
backdrop-filter: blur(4px);
}
.inspiration-info {
flex: 1;
min-width: 0;
position: relative;
z-index: 1;
}
.inspiration-title {
font-family: var(--font-display);
font-size: var(--text-xl);
font-weight: 700;
color: white;
margin-bottom: var(--space-1);
}
.inspiration-author {
font-size: var(--text-sm);
color: rgba(255,255,255,0.75);
}
/* Templates grid */
.templates-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: var(--space-3);
}
.template-card {
background: var(--surface);
border-radius: var(--radius-md);
overflow: hidden;
box-shadow: var(--elev-soft);
border: 1px solid var(--border-soft);
cursor: pointer;
transition: transform var(--motion-fast) var(--ease-standard);
}
.template-card:hover { transform: translateY(-2px); }
.template-card:active { transform: scale(0.97); }
.template-thumb {
height: 90px;
display: flex;
align-items: center;
justify-content: center;
font-size: 32px;
}
.template-info {
padding: var(--space-3);
}
.template-name {
font-family: var(--font-display);
font-size: var(--text-sm);
font-weight: 600;
color: var(--fg);
margin-bottom: var(--space-1);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.template-users {
font-size: var(--text-xs);
color: var(--muted);
display: flex;
align-items: center;
gap: 4px;
}
.template-users svg {
width: 12px;
height: 12px;
}
/* Empty state */
.empty-state {
display: none;
flex-direction: column;
align-items: center;
justify-content: center;
padding: var(--space-10) var(--space-5);
text-align: center;
}
.empty-state.visible {
display: flex;
}
.empty-state .icon {
font-size: 48px;
margin-bottom: var(--space-4);
opacity: 0.6;
}
.empty-state .text {
font-family: var(--font-display);
font-size: var(--text-md);
font-weight: 600;
color: var(--fg-2);
margin-bottom: var(--space-2);
}
.empty-state .subtext {
font-size: var(--text-sm);
color: var(--muted);
}
/* Animations */
@keyframes fadeIn {
from { opacity: 0; transform: translateY(12px); }
to { opacity: 1; transform: translateY(0); }
}
.anim-fade { animation: fadeIn 0.5s var(--ease-standard) both; }
@media (prefers-reduced-motion: reduce) {
.inspiration-card,
.template-card,
.expert-card,
.topic-chip {
transition: none;
}
.anim-fade { animation: none; }
}
</style>
</head>
<body>
<!-- Sidebar -->
<nav class="sidebar" aria-label="侧边导航">
<div class="sidebar-brand">
<div class="sidebar-logo">📖</div>
<div>
<div class="sidebar-brand-text">暖记</div>
<div class="sidebar-brand-sub">Warm Notes</div>
</div>
</div>
<div class="sidebar-nav">
<button class="sidebar-nav-item" aria-label="首页">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M3 9l9-7 9 7v11a2 2 0 01-2 2H5a2 2 0 01-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/></svg>
首页
</button>
<button class="sidebar-nav-item" aria-label="日历">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><rect x="3" y="4" width="18" height="18" rx="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg>
日历
</button>
<button class="sidebar-nav-item" aria-label="心情追踪">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M20.84 4.61a5.5 5.5 0 00-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 00-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 000-7.78z"/></svg>
心情追踪
</button>
<button class="sidebar-nav-item" aria-label="贴纸库">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><rect x="3" y="3" width="18" height="18" rx="3"/><circle cx="9" cy="10" r="1.5" fill="currentColor"/><circle cx="15" cy="10" r="1.5" fill="currentColor"/><path d="M9 15c.8.8 2.2 1.2 3 1.2s2.2-.4 3-1.2"/></svg>
贴纸库
</button>
<button class="sidebar-nav-item" aria-label="模板">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><rect x="3" y="3" width="7" height="7" rx="1"/><rect x="14" y="3" width="7" height="7" rx="1"/><rect x="3" y="14" width="7" height="7" rx="1"/><rect x="14" y="14" width="7" height="7" rx="1"/></svg>
模板
</button>
<button class="sidebar-nav-item active" aria-label="发现">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
发现
</button>
</div>
<button class="sidebar-write-btn" aria-label="写日记">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"><path d="M12 5v14M5 12h14"/></svg>
写日记
</button>
<div class="sidebar-footer">
<div class="sidebar-avatar">🐱</div>
<div>
<div class="sidebar-user-name">小暖</div>
<div class="sidebar-user-streak">连续记录 12 天</div>
</div>
</div>
</nav>
<!-- Main Content -->
<div class="main-content">
<div class="content-inner">
<!-- Page header -->
<div class="page-header anim-fade" data-od-id="discover-header">
<h1>发现</h1>
<div class="page-header-sub">探索灵感、模板和有趣的日记</div>
</div>
<!-- Search bar -->
<div class="search-bar anim-fade" style="animation-delay:0.05s" data-od-id="discover-search">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true">
<circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/>
</svg>
<input type="text" placeholder="搜索日记、模板、话题..." aria-label="搜索日记、模板、话题">
</div>
<!-- Empty state -->
<div class="empty-state" data-od-id="discover-empty" role="status">
<span class="icon" aria-hidden="true">🔍</span>
<div class="text">没有找到相关内容</div>
<div class="subtext">换个关键词试试吧</div>
</div>
<!-- Two-column grid -->
<div class="discover-grid anim-fade" style="animation-delay:0.1s">
<!-- Left column: topics + experts -->
<div class="left-col">
<!-- Hot topics -->
<section data-od-id="discover-topics" aria-label="热门话题">
<div class="section-heading">
<h3>热门话题</h3>
<button class="more" aria-label="查看更多话题">更多</button>
</div>
<div class="topics-scroll" role="list">
<button class="topic-chip active" role="listitem" aria-label="话题:期末备考">
<span class="emoji" aria-hidden="true">📚</span>#期末备考
</button>
<button class="topic-chip" role="listitem" aria-label="话题:读书笔记">
<span class="emoji" aria-hidden="true">📖</span>#读书笔记
</button>
<button class="topic-chip" role="listitem" aria-label="话题:旅行手账">
<span class="emoji" aria-hidden="true">✈️</span>#旅行手账
</button>
<button class="topic-chip" role="listitem" aria-label="话题:美食记录">
<span class="emoji" aria-hidden="true">🍜</span>#美食记录
</button>
<button class="topic-chip" role="listitem" aria-label="话题:校园生活">
<span class="emoji" aria-hidden="true">🎓</span>#校园生活
</button>
<button class="topic-chip" role="listitem" aria-label="话题:自我成长">
<span class="emoji" aria-hidden="true">🌱</span>#自我成长
</button>
</div>
</section>
<!-- Expert diaries -->
<section data-od-id="discover-experts" aria-label="达人日记">
<div class="section-heading">
<h3>达人日记</h3>
<button class="more" aria-label="查看更多达人日记">更多</button>
</div>
<div class="experts-list">
<div class="expert-card" role="article" aria-label="达人日记我的大学生活第100天">
<div class="expert-avatar" style="background: var(--tertiary-soft)" aria-hidden="true">🌸</div>
<div class="expert-info">
<div class="expert-name">小暖</div>
<div class="expert-title">我的大学生活第100天</div>
<div class="expert-preview">不知不觉大学生活已经过了100天了从最初的迷茫到现在的适应记录下这段珍贵的时光...</div>
</div>
<div class="expert-likes">
<svg viewBox="0 0 16 16" fill="currentColor"><path d="M8 14s-5.5-3.5-5.5-7.5C2.5 3.5 4 2 5.75 2 6.86 2 7.86 2.56 8 3.5 8.14 2.56 9.14 2 10.25 2 12 2 13.5 3.5 13.5 6.5 13.5 10.5 8 14 8 14z"/></svg>
328
</div>
</div>
<div class="expert-card" role="article" aria-label="达人日记考研倒计时30天手账">
<div class="expert-avatar" style="background: var(--secondary-soft)" aria-hidden="true">✏️</div>
<div class="expert-info">
<div class="expert-name">手账少女</div>
<div class="expert-title">考研倒计时30天手账</div>
<div class="expert-preview">最后冲刺阶段,用手账记录每一天的复习进度和心情变化,给自己加油打气...</div>
</div>
<div class="expert-likes">
<svg viewBox="0 0 16 16" fill="currentColor"><path d="M8 14s-5.5-3.5-5.5-7.5C2.5 3.5 4 2 5.75 2 6.86 2 7.86 2.56 8 3.5 8.14 2.56 9.14 2 10.25 2 12 2 13.5 3.5 13.5 6.5 13.5 10.5 8 14 8 14z"/></svg>
512
</div>
</div>
<div class="expert-card" role="article" aria-label="达人日记:秋日校园手账记录">
<div class="expert-avatar" style="background: var(--rose-soft)" aria-hidden="true">🍂</div>
<div class="expert-info">
<div class="expert-name">阿月</div>
<div class="expert-title">秋日校园手账记录</div>
<div class="expert-preview">银杏叶黄了,校园美得像画一样。收集了几片落叶夹在手账里,记录这个温柔的秋天...</div>
</div>
<div class="expert-likes">
<svg viewBox="0 0 16 16" fill="currentColor"><path d="M8 14s-5.5-3.5-5.5-7.5C2.5 3.5 4 2 5.75 2 6.86 2 7.86 2.56 8 3.5 8.14 2.56 9.14 2 10.25 2 12 2 13.5 3.5 13.5 6.5 13.5 10.5 8 14 8 14z"/></svg>
276
</div>
</div>
</div>
</section>
</div>
<!-- Right column: templates + inspiration -->
<div class="right-col">
<!-- Featured templates -->
<section data-od-id="discover-templates" aria-label="精选模板">
<div class="section-heading">
<h3>精选模板</h3>
<button class="more" aria-label="查看更多模板">更多</button>
</div>
<div class="templates-grid">
<div class="template-card" role="article" aria-label="模板:考试周复习计划">
<div class="template-thumb" style="background: var(--tertiary-soft)" aria-hidden="true">📝</div>
<div class="template-info">
<div class="template-name">考试周复习计划</div>
<div class="template-users">
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><path d="M10 3a3 3 0 11-6 0 3 3 0 016 0zM2 14v-1a4 4 0 014-4h4a4 4 0 014 4v1"/></svg>
2.3k 人使用
</div>
</div>
</div>
<div class="template-card" role="article" aria-label="模板:读书笔记手账">
<div class="template-thumb" style="background: var(--secondary-soft)" aria-hidden="true">📖</div>
<div class="template-info">
<div class="template-name">读书笔记手账</div>
<div class="template-users">
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><path d="M10 3a3 3 0 11-6 0 3 3 0 016 0zM2 14v-1a4 4 0 014-4h4a4 4 0 014 4v1"/></svg>
1.8k 人使用
</div>
</div>
</div>
<div class="template-card" role="article" aria-label="模板:月度心情打卡">
<div class="template-thumb" style="background: var(--rose-soft)" aria-hidden="true">💫</div>
<div class="template-info">
<div class="template-name">月度心情打卡</div>
<div class="template-users">
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><path d="M10 3a3 3 0 11-6 0 3 3 0 016 0zM2 14v-1a4 4 0 014-4h4a4 4 0 014 4v1"/></svg>
3.1k 人使用
</div>
</div>
</div>
<div class="template-card" role="article" aria-label="模板:旅行日记模板">
<div class="template-thumb" style="background: var(--surface-warm)" aria-hidden="true">🗺️</div>
<div class="template-info">
<div class="template-name">旅行日记模板</div>
<div class="template-users">
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><path d="M10 3a3 3 0 11-6 0 3 3 0 016 0zM2 14v-1a4 4 0 014-4h4a4 4 0 014 4v1"/></svg>
1.5k 人使用
</div>
</div>
</div>
</div>
</section>
<!-- Daily inspiration -->
<section data-od-id="discover-inspiration" aria-label="每日灵感">
<div class="section-heading">
<h3>每日灵感</h3>
<button class="more" aria-label="查看更多灵感">更多</button>
</div>
<div class="inspiration-card" role="article" aria-label="今日灵感推荐:旅行手账排版技巧">
<div class="inspiration-label">今日推荐</div>
<div class="inspiration-body">
<div class="inspiration-thumb" aria-hidden="true">🗺️</div>
<div class="inspiration-info">
<div class="inspiration-title">旅行手账排版技巧</div>
<div class="inspiration-author">by 手账达人小林</div>
</div>
</div>
</div>
</section>
</div>
</div>
</div>
</div>
<script src="../../js/theme-switcher.js"></script>
</body>
</html>

View File

@@ -0,0 +1,892 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=1024, height=768, initial-scale=1">
<title>暖记 — 平板端编辑器</title>
<link rel="stylesheet" href="../css/tokens.css">
<link rel="stylesheet" href="../css/components.css">
<link rel="stylesheet" href="../css/editor-common.css">
<link rel="stylesheet" href="shared.css">
<style>
body {
width: 1024px;
height: 768px;
overflow: hidden;
background: var(--bg);
font-family: var(--font-body);
}
/* Editor layout: sidebar + canvas + side panel */
.editor-layout {
display: flex;
height: 768px;
}
.sidebar { position: relative; flex-shrink: 0; }
.editor-main {
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
}
/* Top bar */
.editor-topbar {
height: 56px;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 var(--space-6);
background: var(--surface);
border-bottom: 1px solid var(--border-soft);
flex-shrink: 0;
}
.topbar-left, .topbar-right {
display: flex;
align-items: center;
gap: var(--space-3);
}
.topbar-btn {
width: 38px;
height: 38px;
border-radius: var(--radius-pill);
border: none;
background: none;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
color: var(--fg);
transition: background var(--motion-fast);
}
.topbar-btn:hover { background: var(--surface-warm); }
.topbar-btn svg { width: 20px; height: 20px; }
.topbar-center {
font-family: var(--font-display);
font-size: var(--text-base);
font-weight: 600;
color: var(--fg-2);
}
.save-btn {
padding: 10px 24px;
background: var(--accent);
color: var(--accent-on);
border: none;
border-radius: var(--radius-pill);
font-family: var(--font-display);
font-size: var(--text-sm);
font-weight: 600;
cursor: pointer;
transition: all var(--motion-fast);
}
.save-btn:hover { background: var(--accent-hover); }
/* Undo/Redo */
.topbar-undo-redo {
display: flex;
align-items: center;
gap: 2px;
}
.undo-btn, .redo-btn {
width: 34px;
height: 34px;
border-radius: var(--radius-pill);
border: none;
background: none;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
color: var(--muted);
transition: all var(--motion-fast);
}
.undo-btn:hover:not(:disabled), .redo-btn:hover:not(:disabled) { background: var(--surface-warm); color: var(--fg); }
.undo-btn:disabled, .redo-btn:disabled { opacity: 0.35; cursor: default; }
.undo-btn svg, .redo-btn svg { width: 18px; height: 18px; }
/* Auto-save */
.autosave-status {
display: flex;
align-items: center;
gap: 5px;
font-size: 11px;
color: var(--success);
font-weight: 500;
}
.autosave-dot {
width: 6px;
height: 6px;
border-radius: 50%;
background: var(--success);
}
/* Canvas + Panel split */
.editor-body {
flex: 1;
display: flex;
overflow: hidden;
}
/* Canvas area */
.canvas-wrapper {
flex: 1;
padding: var(--space-6);
overflow-y: auto;
scrollbar-width: thin;
scrollbar-color: var(--border) transparent;
}
.canvas-wrapper::-webkit-scrollbar { width: 4px; }
.canvas-wrapper::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.canvas-paper {
max-width: 640px;
margin: 0 auto;
background: var(--surface);
border-radius: var(--radius-md);
box-shadow: var(--elev-medium);
border: 1px solid var(--border-soft);
padding: var(--space-8);
min-height: 600px;
position: relative;
}
.canvas-grid {
position: absolute;
inset: 0;
background-image: radial-gradient(circle, var(--border) 1px, transparent 1px);
background-size: 28px 28px;
opacity: 0.4;
pointer-events: none;
border-radius: var(--radius-md);
}
.washi-tape {
position: absolute;
top: 16px;
right: 40px;
width: 110px;
height: 22px;
background: repeating-linear-gradient(45deg, var(--tertiary), var(--tertiary) 4px, var(--surface-warm) 4px, var(--surface-warm) 8px);
transform: rotate(-8deg);
border-radius: 2px;
opacity: 0.8;
}
.placed-sticker {
position: absolute;
font-size: 36px;
cursor: move;
filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}
.journal-content { position: relative; z-index: 1; }
.journal-title {
font-family: var(--font-display);
font-size: var(--text-2xl);
font-weight: 700;
color: var(--fg);
margin-bottom: var(--space-4);
border: none;
outline: none;
width: 100%;
background: transparent;
}
.format-bar {
display: flex;
align-items: center;
gap: var(--space-2);
padding: var(--space-2) 0;
margin-bottom: var(--space-4);
border-bottom: 1px solid var(--border-soft);
}
.format-btn {
width: 34px;
height: 34px;
border-radius: 6px;
border: none;
background: none;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
color: var(--muted);
font-size: var(--text-sm);
font-weight: 600;
transition: all var(--motion-fast);
}
.format-btn:hover { background: var(--surface-warm); color: var(--fg); }
.format-btn.active { background: var(--accent); color: var(--accent-on); }
.format-divider { width: 1px; height: 22px; background: var(--border); }
.color-dot {
width: 26px;
height: 26px;
border-radius: 50%;
border: 2px solid transparent;
cursor: pointer;
transition: all var(--motion-fast);
}
.color-dot:hover { transform: scale(1.15); }
.color-dot.active { border-color: var(--fg); }
.journal-body {
font-size: var(--text-base);
line-height: 1.9;
color: var(--fg-2);
border: none;
outline: none;
width: 100%;
background: transparent;
resize: none;
min-height: 240px;
}
.placed-photo {
width: 100%;
height: 160px;
border-radius: var(--radius-sm);
background: linear-gradient(135deg, var(--secondary-soft), var(--secondary-soft));
margin: var(--space-5) 0;
display: flex;
align-items: center;
justify-content: center;
}
/* Right panel */
.tool-panel-side {
width: 320px;
background: var(--surface);
border-left: 1px solid var(--border-soft);
overflow-y: auto;
scrollbar-width: thin;
flex-shrink: 0;
}
.tool-panel-side::-webkit-scrollbar { width: 4px; }
.tool-panel-side::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.panel-header {
padding: var(--space-5);
border-bottom: 1px solid var(--border-soft);
display: flex;
align-items: center;
gap: var(--space-3);
}
.panel-tab {
padding: 8px 16px;
border-radius: var(--radius-pill);
font-size: var(--text-sm);
font-weight: 500;
background: var(--surface-warm);
color: var(--fg-2);
border: none;
cursor: pointer;
white-space: nowrap;
transition: all var(--motion-fast);
}
.panel-tab.active { background: var(--accent); color: var(--accent-on); }
.panel-content {
padding: var(--space-5);
}
.sticker-grid {
display: grid;
grid-template-columns: repeat(5, 1fr);
gap: var(--space-3);
}
.sticker-item {
aspect-ratio: 1;
border-radius: var(--radius-sm);
background: var(--surface-warm);
display: flex;
align-items: center;
justify-content: center;
font-size: 28px;
cursor: pointer;
transition: all var(--motion-fast) var(--ease-bounce);
border: 1px solid transparent;
}
.sticker-item:hover { transform: scale(1.1); border-color: var(--accent); }
.date-strip {
display: flex;
align-items: center;
justify-content: space-between;
padding: var(--space-3) var(--space-6);
background: var(--surface);
border-bottom: 1px solid var(--border-soft);
flex-shrink: 0;
}
.date-info {
display: flex;
align-items: center;
gap: var(--space-2);
font-size: var(--text-sm);
color: var(--muted);
}
.date-info strong { color: var(--fg); font-weight: 600; }
.mood-quick { display: flex; gap: 6px; }
.mood-mini {
width: 30px;
height: 30px;
border-radius: 50%;
border: 1.5px solid var(--border);
display: flex;
align-items: center;
justify-content: center;
font-size: 15px;
background: var(--surface);
cursor: pointer;
transition: all var(--motion-fast);
}
.mood-mini.selected { border-color: var(--accent); background: var(--surface-warm); }
/* Brush tool panel */
.brush-section-title {
font-size: var(--text-xs);
font-weight: 600;
color: var(--muted);
text-transform: uppercase;
letter-spacing: 0.5px;
margin-bottom: var(--space-3);
}
.brush-tools-list {
display: flex;
flex-direction: column;
gap: var(--space-2);
margin-bottom: var(--space-5);
}
.brush-tool-item {
display: flex;
align-items: center;
gap: var(--space-3);
padding: var(--space-2) var(--space-3);
border-radius: var(--radius-sm);
border: 2px solid transparent;
background: none;
cursor: pointer;
color: var(--muted);
transition: all var(--motion-fast);
width: 100%;
}
.brush-tool-item:hover { background: var(--surface-warm); color: var(--fg); }
.brush-tool-item.active { border-color: var(--accent); color: var(--accent); background: var(--surface-warm); }
.brush-tool-item svg { width: 22px; height: 22px; flex-shrink: 0; }
.brush-tool-item span { font-size: var(--text-sm); font-weight: 500; }
.brush-size-preview {
display: flex;
align-items: center;
justify-content: center;
height: 32px;
background: var(--surface-warm);
border-radius: var(--radius-sm);
margin-bottom: var(--space-2);
}
.brush-size-line {
width: 80%;
border-radius: 4px;
background: var(--fg);
transition: height var(--motion-fast);
}
.brush-size-row {
display: flex;
align-items: center;
gap: var(--space-3);
margin-bottom: var(--space-5);
}
.brush-size-value {
font-size: var(--text-sm);
font-weight: 600;
color: var(--fg);
min-width: 36px;
text-align: right;
}
.brush-slider {
flex: 1;
-webkit-appearance: none;
appearance: none;
height: 4px;
border-radius: 2px;
background: var(--border);
outline: none;
}
.brush-slider::-webkit-slider-thumb {
-webkit-appearance: none;
width: 18px;
height: 18px;
border-radius: 50%;
background: var(--accent);
cursor: pointer;
box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.brush-colors-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: var(--space-3);
margin-bottom: var(--space-5);
}
.brush-color-dot {
width: 100%;
aspect-ratio: 1;
border-radius: 50%;
border: 3px solid transparent;
cursor: pointer;
transition: all var(--motion-fast);
}
.brush-color-dot:hover { transform: scale(1.1); }
.brush-color-dot.active { border-color: var(--fg); box-shadow: 0 0 0 2px var(--surface); }
.brush-opacity-row {
display: flex;
align-items: center;
gap: var(--space-3);
transition: opacity var(--motion-fast);
}
.brush-opacity-row.disabled { opacity: 0.35; pointer-events: none; }
.brush-opacity-label {
font-size: var(--text-xs);
color: var(--muted);
font-weight: 500;
min-width: 40px;
}
.brush-opacity-value {
font-size: var(--text-sm);
font-weight: 600;
color: var(--fg);
min-width: 36px;
text-align: right;
}
/* Tags panel */
.tags-section {
margin-bottom: var(--space-5);
}
.tags-section-title {
font-size: var(--text-xs);
font-weight: 600;
color: var(--muted);
text-transform: uppercase;
letter-spacing: 0.5px;
margin-bottom: var(--space-3);
}
.tag-selected-area {
display: flex;
flex-wrap: wrap;
gap: var(--space-2);
min-height: 36px;
}
.tag-pill {
display: inline-flex;
align-items: center;
gap: 4px;
padding: 4px 12px;
border-radius: 9999px;
background: var(--surface-warm);
color: var(--accent);
font-size: 13px;
font-weight: 500;
}
.tag-pill .remove {
width: 16px;
height: 16px;
border-radius: 50%;
background: var(--accent);
color: var(--surface);
display: flex;
align-items: center;
justify-content: center;
font-size: 10px;
cursor: pointer;
border: none;
line-height: 1;
transition: background var(--motion-fast);
}
.tag-pill .remove:hover { background: var(--accent-hover); }
.tag-input-row {
display: flex;
}
.tag-input {
flex: 1;
height: 44px;
border: 1.5px solid var(--border);
border-radius: var(--radius-pill);
padding: 0 var(--space-4);
font-size: var(--text-sm);
color: var(--fg);
background: var(--bg);
outline: none;
transition: border-color var(--motion-fast);
font-family: var(--font-body);
}
.tag-input::placeholder { color: var(--meta); }
.tag-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--shadow-input-focus); }
.tag-suggest-grid {
display: flex;
flex-wrap: wrap;
gap: var(--space-2);
}
.tag-suggest-item {
display: inline-flex;
align-items: center;
padding: 6px 14px;
border-radius: 9999px;
background: var(--surface-warm);
color: var(--fg-2);
font-size: var(--text-sm);
font-weight: 500;
border: 1px solid transparent;
cursor: pointer;
white-space: nowrap;
min-height: 44px;
transition: all var(--motion-fast);
}
.tag-suggest-item:hover { border-color: var(--accent); color: var(--accent); }
</style>
</head>
<body>
<div class="editor-layout">
<!-- Sidebar -->
<nav class="sidebar" role="navigation" aria-label="主导航">
<div class="sidebar-brand">
<div class="sidebar-logo">📖</div>
<div>
<div class="sidebar-brand-text">暖记</div>
<div class="sidebar-brand-sub">Warm Notes</div>
</div>
</div>
<div class="sidebar-nav">
<button class="sidebar-nav-item">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M3 9l9-7 9 7v11a2 2 0 01-2 2H5a2 2 0 01-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/></svg>
首页
</button>
<button class="sidebar-nav-item">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><rect x="3" y="4" width="18" height="18" rx="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg>
日历
</button>
<button class="sidebar-nav-item">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M20.84 4.61a5.5 5.5 0 00-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 00-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 000-7.78z"/></svg>
心情追踪
</button>
</div>
<div class="sidebar-footer">
<div class="sidebar-avatar">🐱</div>
<div>
<div class="sidebar-user-name">小暖</div>
<div class="sidebar-user-streak">连续记录 12 天</div>
</div>
</div>
</nav>
<div class="editor-main">
<!-- Top bar -->
<div class="editor-topbar">
<div class="topbar-left">
<button class="topbar-btn" aria-label="返回">
<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M15 18l-6-6 6-6"/></svg>
</button>
</div>
<div class="topbar-center">5月31日 · 周日</div>
<div class="topbar-right">
<div class="topbar-undo-redo">
<button class="undo-btn" disabled aria-label="撤销">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 10h10a5 5 0 015 5v2"/><polyline points="3 10 7 6"/><polyline points="3 10 7 14"/></svg>
</button>
<button class="redo-btn" disabled aria-label="重做">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 10H11a5 5 0 00-5 5v2"/><polyline points="21 10 17 6"/><polyline points="21 10 17 14"/></svg>
</button>
</div>
<div class="autosave-status" aria-live="polite">
<span class="autosave-dot"></span>
<span>已保存</span>
</div>
<button class="topbar-btn" aria-label="上传">
<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M4 12v6h14v-6"/><polyline points="14 6 10 2 6 6"/><line x1="10" y1="2" x2="10" y2="13"/></svg>
</button>
<button class="save-btn">保存</button>
</div>
</div>
<!-- Date strip -->
<div class="date-strip">
<div class="date-info">
<strong>14:32</strong>
<span>· 晴 26°</span>
</div>
<div class="mood-quick">
<div class="mood-mini">😊</div>
<div class="mood-mini selected">🥰</div>
<div class="mood-mini">😌</div>
</div>
</div>
<!-- Canvas + Side Panel -->
<div class="editor-body">
<div class="canvas-wrapper">
<div class="canvas-paper">
<div class="canvas-grid"></div>
<div class="washi-tape"></div>
<div class="placed-sticker" style="top:10px;left:10px">🌸</div>
<div class="placed-sticker" style="top:180px;right:16px"></div>
<div class="journal-content">
<input class="journal-title" type="text" value="图书馆的午后时光" placeholder="给日记起个标题...">
<div class="format-bar">
<button class="format-btn active" style="font-weight:800">B</button>
<button class="format-btn" style="font-style:italic">I</button>
<button class="format-btn" style="text-decoration:underline">U</button>
<div class="format-divider"></div>
<div class="color-dot active" style="background:#2D2420"></div>
<div class="color-dot" style="background:var(--accent)"></div>
<div class="color-dot" style="background:var(--secondary)"></div>
<div class="color-dot" style="background:#5B7DB1"></div>
<div class="format-divider"></div>
<button class="format-btn">
<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor"><rect x="1" y="3" width="14" height="2" rx="1"/><rect x="1" y="7" width="10" height="2" rx="1"/><rect x="1" y="11" width="6" height="2" rx="1"/></svg>
</button>
</div>
<textarea class="journal-body" rows="10">今天下午去图书馆自习,找了一个靠窗的位置。阳光从窗外洒进来,落在摊开的高数课本上,暖暖的。
不知不觉就学了三个小时,中间喝了一杯抹茶拿铁☕。虽然期末压力大,但看到窗外的樱花还在开,觉得一切都会好的。
晚上回宿舍路上,买了喜欢的草莓蛋糕犒劳自己 🍰</textarea>
<div class="placed-photo">
<div style="text-align:center;color:var(--secondary)">
<svg width="36" height="36" viewBox="0 0 32 32" fill="none" stroke="currentColor" stroke-width="1.5" style="margin-bottom:4px"><rect x="4" y="6" width="24" height="20" rx="3"/><circle cx="12" cy="14" r="3"/><path d="M4 22l6-6 4 4 6-8 8 10"/></svg>
<div style="font-size:13px">图书馆窗边的阳光 ☀</div>
</div>
</div>
</div>
</div>
</div>
<!-- Right side panel -->
<div class="tool-panel-side">
<div class="panel-header">
<button class="panel-tab active" onclick="switchPanel('stickers', this)">贴纸</button>
<button class="panel-tab" onclick="switchPanel('brush', this)">画笔工具</button>
<button class="panel-tab" onclick="switchPanel('templates', this)">模板</button>
<button class="panel-tab" onclick="switchPanel('tags', this)">标签</button>
<button class="panel-tab" onclick="switchPanel('background', this)">背景</button>
</div>
<!-- Sticker panel -->
<div class="panel-content" id="panelStickers">
<div style="display:flex;gap:var(--space-2);margin-bottom:var(--space-4);flex-wrap:wrap">
<button class="panel-tab" style="font-size:12px;padding:5px 12px">热门</button>
<button class="panel-tab active" style="font-size:12px;padding:5px 12px">可爱</button>
<button class="panel-tab" style="font-size:12px;padding:5px 12px">植物</button>
<button class="panel-tab" style="font-size:12px;padding:5px 12px">天气</button>
<button class="panel-tab" style="font-size:12px;padding:5px 12px">校园</button>
</div>
<div class="sticker-grid">
<div class="sticker-item">🌸</div>
<div class="sticker-item"></div>
<div class="sticker-item">🌿</div>
<div class="sticker-item">☀️</div>
<div class="sticker-item">🌙</div>
<div class="sticker-item">🍰</div>
<div class="sticker-item">📚</div>
<div class="sticker-item">🎵</div>
<div class="sticker-item">💡</div>
<div class="sticker-item">🎀</div>
<div class="sticker-item">🍂</div>
<div class="sticker-item"></div>
<div class="sticker-item">🌈</div>
<div class="sticker-item">✏️</div>
<div class="sticker-item">🦋</div>
<div class="sticker-item">🐱</div>
<div class="sticker-item">🌸</div>
<div class="sticker-item">🎈</div>
<div class="sticker-item">🌻</div>
<div class="sticker-item">🎨</div>
</div>
</div>
<!-- Brush tool panel -->
<div class="panel-content" id="panelBrush" style="display:none">
<div class="brush-section-title">工具</div>
<div class="brush-tools-list">
<button class="brush-tool-item active" data-tool="pen" onclick="selectBrushTool(this, 'pen')">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M17 3l4 4L7 21H3v-4L17 3z"/></svg>
<span>钢笔</span>
</button>
<button class="brush-tool-item" data-tool="pencil" onclick="selectBrushTool(this, 'pencil')">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 20l1.5-5.5L18 2l4 4L9.5 18.5 4 20z"/><path d="M15 5l4 4"/></svg>
<span>铅笔</span>
</button>
<button class="brush-tool-item" data-tool="marker" onclick="selectBrushTool(this, 'marker')">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="6" y="3" width="14" height="8" rx="2" transform="rotate(45 13 7)"/><path d="M4 20l3-7"/></svg>
<span>马克笔</span>
</button>
<button class="brush-tool-item" data-tool="eraser" onclick="selectBrushTool(this, 'eraser')">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 20H9L3.5 14.5a2 2 0 010-2.83l9.17-9.17a2 2 0 012.83 0L20 7"/><path d="M6 12l6 6"/></svg>
<span>橡皮擦</span>
</button>
</div>
<div class="brush-section-title">粗细</div>
<div class="brush-size-preview">
<div class="brush-size-line" id="brushSizeLine" style="height:2px"></div>
</div>
<div class="brush-size-row">
<input type="range" class="brush-slider" id="brushSizeSlider" min="1" max="20" value="2">
<span class="brush-size-value" id="brushSizeValue">2px</span>
</div>
<div class="brush-section-title">颜色</div>
<div class="brush-colors-grid">
<div class="brush-color-dot active" style="background:#2D2420" data-color="#2D2420" onclick="selectBrushColor(this)"></div>
<div class="brush-color-dot" style="background:var(--accent)" data-color="#E07A5F" onclick="selectBrushColor(this)"></div>
<div class="brush-color-dot" style="background:var(--secondary)" data-color="#81B29A" onclick="selectBrushColor(this)"></div>
<div class="brush-color-dot" style="background:var(--tertiary)" data-color="#F2CC8F" onclick="selectBrushColor(this)"></div>
<div class="brush-color-dot" style="background:var(--rose)" data-color="#D4A5A5" onclick="selectBrushColor(this)"></div>
<div class="brush-color-dot" style="background:#5B8FB9" data-color="#5B8FB9" onclick="selectBrushColor(this)"></div>
<div class="brush-color-dot" style="background:#9B72AA" data-color="#9B72AA" onclick="selectBrushColor(this)"></div>
<div class="brush-color-dot" style="background:#C93D3D" data-color="#C93D3D" onclick="selectBrushColor(this)"></div>
</div>
<div class="brush-section-title">透明度</div>
<div class="brush-opacity-row disabled" id="brushOpacityRow">
<span class="brush-opacity-label">透明度</span>
<input type="range" class="brush-slider" id="brushOpacitySlider" min="0" max="100" value="50">
<span class="brush-opacity-value" id="brushOpacityValue">50%</span>
</div>
</div>
<!-- Templates panel -->
<div class="panel-content" id="panelTemplates" style="display:none">
<p style="color:var(--muted);font-size:var(--text-sm)">模板内容</p>
</div>
<!-- Tags panel -->
<div class="panel-content" id="panelTags" style="display:none">
<div class="tags-section">
<div class="tags-section-title">已选标签</div>
<div class="tag-selected-area" id="tagSelectedArea">
<span class="tag-pill">#图书馆<span class="remove" aria-label="删除标签 图书馆" role="button" onclick="this.parentElement.remove()">&times;</span></span>
<span class="tag-pill">#学习<span class="remove" aria-label="删除标签 学习" role="button" onclick="this.parentElement.remove()">&times;</span></span>
</div>
</div>
<div class="tags-section">
<div class="tags-section-title">添加标签</div>
<div class="tag-input-row">
<input class="tag-input" type="text" id="tagInput" placeholder="输入标签后回车添加..." autocomplete="off" aria-label="输入新标签" onkeydown="handleTagInput(event)">
</div>
</div>
<div class="tags-section">
<div class="tags-section-title">推荐标签</div>
<div class="tag-suggest-grid">
<button class="tag-suggest-item" aria-label="添加标签 日常" onclick="addSuggestedTag(this)">#日常</button>
<button class="tag-suggest-item" aria-label="添加标签 学习" onclick="addSuggestedTag(this)">#学习</button>
<button class="tag-suggest-item" aria-label="添加标签 读书" onclick="addSuggestedTag(this)">#读书</button>
<button class="tag-suggest-item" aria-label="添加标签 运动" onclick="addSuggestedTag(this)">#运动</button>
<button class="tag-suggest-item" aria-label="添加标签 旅行" onclick="addSuggestedTag(this)">#旅行</button>
<button class="tag-suggest-item" aria-label="添加标签 美食" onclick="addSuggestedTag(this)">#美食</button>
<button class="tag-suggest-item" aria-label="添加标签 心情" onclick="addSuggestedTag(this)">#心情</button>
<button class="tag-suggest-item" aria-label="添加标签 灵感" onclick="addSuggestedTag(this)">#灵感</button>
</div>
</div>
</div>
<!-- Background panel -->
<div class="panel-content" id="panelBackground" style="display:none">
<p style="color:var(--muted);font-size:var(--text-sm)">背景内容</p>
</div>
</div>
</div>
</div>
</div>
<script>
function switchPanel(name, tabEl) {
var tabs = tabEl.parentElement.querySelectorAll('.panel-tab');
for (var i = 0; i < tabs.length; i++) tabs[i].classList.remove('active');
tabEl.classList.add('active');
var panels = ['panelStickers', 'panelBrush', 'panelTemplates', 'panelTags', 'panelBackground'];
var names = ['stickers', 'brush', 'templates', 'tags', 'background'];
for (var i = 0; i < panels.length; i++) {
var el = document.getElementById(panels[i]);
if (el) el.style.display = names[i] === name ? '' : 'none';
}
}
function selectBrushTool(btn, tool) {
var items = document.querySelectorAll('.brush-tool-item');
for (var i = 0; i < items.length; i++) items[i].classList.remove('active');
btn.classList.add('active');
var defaults = { pen: 2, pencil: 3, marker: 8, eraser: 10 };
var slider = document.getElementById('brushSizeSlider');
slider.value = defaults[tool] || 2;
updateSizePreview(slider.value);
var opacityRow = document.getElementById('brushOpacityRow');
if (tool === 'marker') {
opacityRow.classList.remove('disabled');
} else {
opacityRow.classList.add('disabled');
}
}
function selectBrushColor(dot) {
var dots = document.querySelectorAll('.brush-color-dot');
for (var i = 0; i < dots.length; i++) dots[i].classList.remove('active');
dot.classList.add('active');
}
function updateSizePreview(val) {
document.getElementById('brushSizeValue').textContent = val + 'px';
var line = document.getElementById('brushSizeLine');
if (line) line.style.height = Math.max(1, val) + 'px';
}
document.getElementById('brushSizeSlider').addEventListener('input', function() {
updateSizePreview(this.value);
});
document.getElementById('brushOpacitySlider').addEventListener('input', function() {
document.getElementById('brushOpacityValue').textContent = this.value + '%';
});
/* Tags functionality */
function handleTagInput(e) {
if (e.key === 'Enter') {
var input = e.target;
var text = input.value.trim();
if (text) {
if (!text.startsWith('#')) text = '#' + text;
var area = document.getElementById('tagSelectedArea');
var pill = document.createElement('span');
pill.className = 'tag-pill';
pill.innerHTML = text + '<span class="remove" aria-label="删除标签 ' + text.slice(1) + '" role="button" onclick="this.parentElement.remove()">&times;</span>';
area.appendChild(pill);
input.value = '';
}
}
}
function addSuggestedTag(btn) {
var text = btn.textContent.trim();
var area = document.getElementById('tagSelectedArea');
var pill = document.createElement('span');
pill.className = 'tag-pill';
pill.innerHTML = text + '<span class="remove" aria-label="删除标签 ' + text.slice(1) + '" role="button" onclick="this.parentElement.remove()">&times;</span>';
area.appendChild(pill);
btn.style.display = 'none';
}
</script>
<script src="../../js/theme-switcher.js"></script>
</body>
</html>

View File

@@ -0,0 +1,456 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=1024, height=768, initial-scale=1">
<title>暖记 — 平板端首页</title>
<link rel="stylesheet" href="../css/tokens.css">
<link rel="stylesheet" href="../css/components.css">
<link rel="stylesheet" href="shared.css">
<style>
body {
width: 1024px;
height: 768px;
overflow: hidden;
background: var(--bg);
font-family: var(--font-body);
}
.main-content { height: 768px; }
.content-inner {
padding: var(--space-8) var(--space-8);
max-width: none;
}
/* Greeting */
.greeting { margin-bottom: var(--space-5); }
.greeting-date {
font-size: var(--text-sm);
color: var(--muted);
font-weight: 500;
margin-bottom: var(--space-1);
}
.greeting-text {
font-family: var(--font-display);
font-size: var(--text-3xl);
font-weight: 700;
color: var(--fg);
}
.greeting-text span { color: var(--accent); }
.streak-badge {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 6px 14px;
background: var(--tertiary-soft);
border-radius: var(--radius-pill);
font-size: var(--text-sm);
font-weight: 600;
color: #B8860B;
margin-bottom: var(--space-5);
}
/* Mood + Today card row */
.top-row {
display: grid;
grid-template-columns: 1fr 1fr;
gap: var(--space-5);
margin-bottom: var(--space-6);
}
.mood-section {
background: var(--surface);
border-radius: var(--radius-md);
padding: var(--space-5);
box-shadow: var(--elev-soft);
border: 1px solid var(--border-soft);
}
.mood-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: var(--space-4);
}
.mood-header span {
font-size: var(--text-base);
font-weight: 600;
color: var(--fg-2);
}
.mood-header .weather {
font-size: var(--text-sm);
color: var(--muted);
display: flex;
align-items: center;
gap: 4px;
}
.mood-options {
display: flex;
justify-content: space-between;
}
.mood-opt {
display: flex;
flex-direction: column;
align-items: center;
gap: 4px;
background: none;
border: none;
cursor: pointer;
padding: var(--space-2) var(--space-3);
border-radius: var(--radius-sm);
transition: all var(--motion-fast) var(--ease-bounce);
}
.mood-opt:hover { background: var(--surface-warm); }
.mood-opt.selected { background: var(--surface-warm); }
.mood-opt .face { font-size: 32px; }
.mood-opt .label { font-size: var(--text-xs); color: var(--muted); }
.mood-opt.selected .label { color: var(--accent); font-weight: 600; }
/* Today card */
.today-card {
background: linear-gradient(135deg, var(--accent) 0%, var(--tertiary) 100%);
border-radius: var(--radius-lg);
padding: var(--space-6);
position: relative;
overflow: hidden;
cursor: pointer;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.today-card:hover { transform: translateY(-2px); transition: transform var(--motion-fast) var(--ease-bounce); }
.today-card::before {
content: '';
position: absolute;
top: -30px;
right: -30px;
width: 140px;
height: 140px;
border-radius: 50%;
background: rgba(255,255,255,0.12);
}
.today-card::after {
content: '';
position: absolute;
bottom: -20px;
left: 40px;
width: 90px;
height: 90px;
border-radius: 50%;
background: rgba(255,255,255,0.08);
}
.today-card .label {
font-size: var(--text-sm);
color: var(--accent-on);
font-weight: 500;
margin-bottom: var(--space-2);
opacity: 0.85;
}
.today-card .title {
font-family: var(--font-display);
font-size: var(--text-xl);
font-weight: 700;
color: var(--accent-on);
margin-bottom: var(--space-2);
}
.today-card .prompt {
font-size: var(--text-sm);
color: var(--accent-on);
opacity: 0.7;
}
.today-card .write-btn {
position: absolute;
bottom: var(--space-5);
right: var(--space-5);
width: 52px;
height: 52px;
border-radius: 50%;
background: white;
border: none;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
cursor: pointer;
transition: transform var(--motion-fast) var(--ease-bounce);
}
.today-card .write-btn:hover { transform: scale(1.1); }
.today-card .write-btn svg { width: 24px; height: 24px; color: var(--accent); }
/* Quick stats */
.quick-stats {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: var(--space-4);
margin-bottom: var(--space-6);
}
.stat-card {
background: var(--surface);
border-radius: var(--radius-md);
padding: var(--space-4) var(--space-5);
box-shadow: var(--elev-soft);
border: 1px solid var(--border-soft);
}
.stat-card .num {
font-family: var(--font-display);
font-size: var(--text-2xl);
font-weight: 700;
}
.stat-card .num.accent { color: var(--accent); }
.stat-card .num.green { color: var(--secondary); }
.stat-card .label {
font-size: var(--text-sm);
color: var(--muted);
margin-top: 4px;
}
/* Entries */
.recent-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: var(--space-4);
}
.recent-header h3 {
font-family: var(--font-display);
font-size: var(--text-lg);
font-weight: 700;
}
.recent-header a {
font-size: var(--text-sm);
color: var(--accent);
text-decoration: none;
font-weight: 500;
}
.entries-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: var(--space-4);
}
.entry-card {
background: var(--surface);
border-radius: var(--radius-md);
padding: var(--space-4);
box-shadow: var(--elev-soft);
border: 1px solid var(--border-soft);
cursor: pointer;
transition: transform var(--motion-fast) var(--ease-standard);
}
.entry-card:hover { transform: translateY(-2px); }
.entry-top {
display: flex;
justify-content: space-between;
align-items: flex-start;
margin-bottom: var(--space-3);
}
.entry-date {
font-size: var(--text-xs);
color: var(--muted);
}
.entry-mood { font-size: 20px; }
.entry-title {
font-family: var(--font-display);
font-size: var(--text-md);
font-weight: 600;
color: var(--fg);
margin-bottom: var(--space-2);
}
.entry-excerpt {
font-size: var(--text-sm);
color: var(--muted);
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
line-height: 1.5;
}
.entry-preview-thumb {
width: 100%;
height: 80px;
border-radius: var(--radius-sm);
margin-top: var(--space-3);
background: var(--surface-warm);
display: flex;
align-items: center;
justify-content: center;
font-size: 28px;
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(12px); }
to { opacity: 1; transform: translateY(0); }
}
.anim-fade { animation: fadeIn 0.5s var(--ease-standard) both; }
</style>
</head>
<body>
<!-- Sidebar -->
<nav class="sidebar" role="navigation" aria-label="主导航">
<div class="sidebar-brand">
<div class="sidebar-logo">📖</div>
<div>
<div class="sidebar-brand-text">暖记</div>
<div class="sidebar-brand-sub">Warm Notes</div>
</div>
</div>
<div class="sidebar-nav">
<button class="sidebar-nav-item active" role="button" aria-label="首页">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M3 9l9-7 9 7v11a2 2 0 01-2 2H5a2 2 0 01-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/></svg>
首页
</button>
<button class="sidebar-nav-item" role="button" aria-label="日历">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><rect x="3" y="4" width="18" height="18" rx="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg>
日历
</button>
<button class="sidebar-nav-item" role="button" aria-label="心情追踪">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M20.84 4.61a5.5 5.5 0 00-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 00-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 000-7.78z"/></svg>
心情追踪
</button>
<button class="sidebar-nav-item" role="button" aria-label="贴纸库">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><rect x="3" y="3" width="18" height="18" rx="3"/><circle cx="9" cy="10" r="1.5" fill="currentColor"/><circle cx="15" cy="10" r="1.5" fill="currentColor"/><path d="M9 15c.8.8 2.2 1.2 3 1.2s2.2-.4 3-1.2"/></svg>
贴纸库
</button>
<button class="sidebar-nav-item" role="button" aria-label="模板">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><rect x="3" y="3" width="7" height="7" rx="1"/><rect x="14" y="3" width="7" height="7" rx="1"/><rect x="3" y="14" width="7" height="7" rx="1"/><rect x="14" y="14" width="7" height="7" rx="1"/></svg>
模板
</button>
<button class="sidebar-nav-item" role="button" aria-label="发现">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
发现
</button>
</div>
<button class="sidebar-write-btn" aria-label="写日记">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"><path d="M12 5v14M5 12h14"/></svg>
写日记
</button>
<div class="sidebar-footer">
<div class="sidebar-avatar">🐱</div>
<div>
<div class="sidebar-user-name">小暖</div>
<div class="sidebar-user-streak">连续记录 12 天</div>
</div>
</div>
</nav>
<!-- Main Content -->
<main class="main-content" role="main">
<div class="content-inner">
<!-- Greeting -->
<div class="greeting anim-fade">
<div class="greeting-date">2026年5月31日 · 星期日</div>
<div class="greeting-text">下午好,<span>小暖</span></div>
</div>
<div class="streak-badge anim-fade" style="animation-delay:0.05s">
<svg width="16" height="16" viewBox="0 0 16 16" fill="#B8860B"><path d="M8 1l2 5h5l-4 3 1.5 5L8 11 3.5 14 5 9 1 6h5z"/></svg>
连续记录 12 天
</div>
<!-- Mood + Today card row -->
<div class="top-row anim-fade" style="animation-delay:0.1s">
<div class="mood-section">
<div class="mood-header">
<span>今天心情如何?</span>
<div class="weather">
<svg width="16" height="16" viewBox="0 0 16 16" fill="var(--tertiary)">
<circle cx="8" cy="8" r="5"/>
</svg>
晴 26°
</div>
</div>
<div class="mood-options">
<button class="mood-opt" aria-label="开心"><span class="face">😊</span><span class="label">开心</span></button>
<button class="mood-opt" aria-label="平静"><span class="face">😌</span><span class="label">平静</span></button>
<button class="mood-opt selected" aria-label="幸福"><span class="face">🥰</span><span class="label">幸福</span></button>
<button class="mood-opt" aria-label="疲惫"><span class="face">😴</span><span class="label">疲惫</span></button>
<button class="mood-opt" aria-label="低落"><span class="face">😔</span><span class="label">低落</span></button>
</div>
</div>
<div class="today-card">
<div>
<div class="label">今天的日记</div>
<div class="title">写点什么吧...</div>
<div class="prompt">记录一个温暖的瞬间,或者今天发生的小事</div>
</div>
<button class="write-btn" aria-label="开始写日记">
<svg viewBox="0 0 24 24" fill="none"><path d="M11 5v12M5 11h12" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"/></svg>
</button>
</div>
</div>
<!-- Quick stats -->
<div class="quick-stats anim-fade" style="animation-delay:0.15s">
<div class="stat-card">
<div class="num accent">28</div>
<div class="label">本月日记</div>
</div>
<div class="stat-card">
<div class="num green">12</div>
<div class="label">连续天数</div>
</div>
<div class="stat-card">
<div class="num">156</div>
<div class="label">总日记数</div>
</div>
</div>
<!-- Recent entries -->
<div class="recent-header anim-fade" style="animation-delay:0.2s">
<h3>最近记录</h3>
<a href="#">查看全部</a>
</div>
<div class="entries-grid anim-fade" style="animation-delay:0.25s">
<div class="entry-card">
<div class="entry-top">
<div class="entry-date">5月30日 · 周六</div>
<div class="entry-mood">😊</div>
</div>
<div class="entry-title">图书馆的午后</div>
<div class="entry-excerpt">今天在图书馆自习,窗外的阳光洒进来,暖暖的。复习了高数第三章...</div>
<div class="entry-preview-thumb" style="background:var(--surface-warm)">🌸</div>
</div>
<div class="entry-card">
<div class="entry-top">
<div class="entry-date">5月29日 · 周五</div>
<div class="entry-mood">🥰</div>
</div>
<div class="entry-title">和舍友的火锅局</div>
<div class="entry-excerpt">考完试和舍友们去吃了火锅庆祝,大家都好开心,聊了很多有趣的事...</div>
<div class="entry-preview-thumb" style="background:var(--secondary-soft)">🍃</div>
</div>
<div class="entry-card">
<div class="entry-top">
<div class="entry-date">5月28日 · 周四</div>
<div class="entry-mood">😌</div>
</div>
<div class="entry-title">期末考试第一天</div>
<div class="entry-excerpt">终于考完了英语,感觉发挥还可以。明天继续加油!给自己打个气...</div>
<div class="entry-preview-thumb" style="background:var(--tertiary-soft)">📝</div>
</div>
<div class="entry-card">
<div class="entry-top">
<div class="entry-date">5月27日 · 周三</div>
<div class="entry-mood">😌</div>
</div>
<div class="entry-title">夜跑打卡</div>
<div class="entry-excerpt">晚上去操场跑了三圈,吹着晚风特别舒服。回来洗了个热水澡...</div>
<div class="entry-preview-thumb" style="background:var(--rose-soft)">🌙</div>
</div>
</div>
</div>
</main>
<script src="../../js/theme-switcher.js"></script>
</body>
</html>

View File

@@ -0,0 +1,622 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=1024, height=768, initial-scale=1">
<title>暖记 — 平板端登录/注册</title>
<link rel="stylesheet" href="../css/tokens.css">
<link rel="stylesheet" href="../css/components.css">
<style>
body {
width: 1024px;
height: 768px;
overflow: hidden;
background: var(--bg);
font-family: var(--font-body);
display: flex;
align-items: center;
justify-content: center;
}
/* Focus styles */
button:focus-visible, a:focus-visible, input:focus-visible {
box-shadow: 0 0 0 3px var(--focus-ring);
outline: none;
}
/* Centered card */
.login-card {
display: flex;
width: 540px;
min-height: 480px;
background: var(--surface);
border-radius: var(--radius-md);
box-shadow: var(--elev-medium);
overflow: hidden;
position: relative;
}
/* Left brand panel */
.brand-panel {
width: 240px;
flex-shrink: 0;
background: linear-gradient(180deg, var(--bg) 0%, var(--tertiary-soft) 100%);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: var(--space-8);
position: relative;
overflow: hidden;
}
/* CSS-drawn notebook logo */
.logo-wrap {
width: 72px;
height: 72px;
position: relative;
margin-bottom: var(--space-5);
}
.logo-notebook {
width: 56px;
height: 64px;
border: 3px solid var(--accent);
border-radius: 6px 10px 10px 6px;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
background: rgba(224, 122, 95, 0.06);
}
.logo-spine {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 3px;
height: 64px;
background: var(--accent);
border-radius: 2px;
}
.logo-heart {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -45%);
width: 16px;
height: 16px;
}
.logo-heart::before {
content: '';
position: absolute;
left: 50%;
top: 50%;
width: 16px;
height: 16px;
background: var(--accent);
clip-path: path('M8 14C8 14 1 9.5 1 5.5C1 3 3 1 5.5 1C6.8 1 7.8 1.6 8 2.5C8.2 1.6 9.2 1 10.5 1C13 1 15 3 15 5.5C15 9.5 8 14 8 14Z');
transform: translate(-50%, -50%);
}
.brand-title {
font-family: var(--font-display);
font-size: var(--text-2xl);
font-weight: 700;
color: var(--fg);
margin-bottom: var(--space-2);
}
.brand-tagline {
font-family: var(--font-handwritten);
font-size: var(--text-md);
color: var(--accent);
font-weight: 500;
text-align: center;
}
/* Decorative elements */
.deco {
position: absolute;
pointer-events: none;
opacity: 0.15;
}
.deco-dot1 {
width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
top: 40px; left: 30px;
}
.deco-dot2 {
width: 6px; height: 6px; border-radius: 50%; background: var(--secondary);
top: 70px; right: 30px;
}
.deco-dot3 {
width: 10px; height: 10px; border-radius: 50%; background: var(--tertiary);
bottom: 60px; left: 40px;
}
.deco-wave {
bottom: 40px; right: 30px;
}
.deco-wave svg { width: 30px; height: 12px; }
.deco-flower {
top: 120px; left: 20px;
width: 14px; height: 14px;
}
.deco-flower::before {
content: '';
display: block;
width: 14px; height: 14px;
background: var(--rose);
clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
/* Right form panel */
.form-panel {
flex: 1;
display: flex;
flex-direction: column;
padding: var(--space-10) var(--space-8);
}
.form-title {
font-family: var(--font-display);
font-size: var(--text-xl);
font-weight: 700;
color: var(--fg);
text-align: center;
margin-bottom: var(--space-6);
}
/* Input group */
.input-group {
position: relative;
margin-bottom: var(--space-4);
}
.input-group .input-icon {
position: absolute;
left: 16px;
top: 50%;
transform: translateY(-50%);
width: 20px;
height: 20px;
color: var(--muted);
pointer-events: none;
display: flex;
align-items: center;
justify-content: center;
}
.input-group input {
width: 100%;
height: 48px;
padding: 0 16px 0 46px;
border: 1.5px solid var(--border);
border-radius: var(--radius-pill);
font-family: var(--font-body);
font-size: var(--text-sm);
color: var(--fg);
background: var(--surface);
transition: border-color var(--motion-fast) var(--ease-standard);
}
.input-group input::placeholder {
color: var(--meta);
}
.input-group input:focus {
outline: none;
border-color: var(--accent);
box-shadow: 0 0 0 3px var(--shadow-input-focus);
}
/* Verification code */
.input-group.has-action input {
padding-right: 110px;
}
.input-group .input-action {
position: absolute;
right: 6px;
top: 50%;
transform: translateY(-50%);
padding: 6px 12px;
background: none;
border: none;
font-family: var(--font-body);
font-size: var(--text-xs);
font-weight: 600;
color: var(--accent);
cursor: pointer;
min-height: 36px;
border-radius: var(--radius-pill);
transition: background var(--motion-fast);
}
.input-group .input-action:hover {
background: var(--surface-warm);
}
/* Password toggle */
.input-group.has-toggle input {
padding-right: 50px;
}
.input-group .toggle-password {
position: absolute;
right: 14px;
top: 50%;
transform: translateY(-50%);
width: 24px;
height: 24px;
background: none;
border: none;
color: var(--muted);
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
padding: 0;
min-height: 44px;
min-width: 44px;
border-radius: 50%;
}
.input-group .toggle-password:hover { color: var(--fg); }
.input-group .toggle-password svg { width: 20px; height: 20px; }
/* Agreement */
.agreement {
display: flex;
align-items: flex-start;
gap: var(--space-2);
margin-bottom: var(--space-4);
font-size: var(--text-xs);
color: var(--muted);
line-height: 1.4;
}
.agreement input[type="checkbox"] {
width: 16px; height: 16px;
accent-color: var(--accent);
margin-top: 1px;
flex-shrink: 0;
cursor: pointer;
}
.agreement a {
color: var(--accent);
text-decoration: none;
font-weight: 500;
}
.agreement a:focus-visible {
box-shadow: 0 0 0 3px var(--focus-ring);
outline: none;
border-radius: 2px;
}
/* Submit button */
.btn-login {
width: 100%;
min-height: 48px;
border: none;
border-radius: var(--radius-pill);
background: var(--accent);
color: var(--bg);
font-family: var(--font-display);
font-size: var(--text-md);
font-weight: 700;
cursor: pointer;
transition: all var(--motion-fast) var(--ease-standard);
margin-bottom: var(--space-4);
}
.btn-login:hover {
background: var(--accent-hover);
transform: translateY(-1px);
box-shadow: 0 4px 16px var(--shadow-accent-hover);
}
.btn-login:active {
background: var(--accent-active);
transform: scale(0.98);
}
/* Divider */
.divider {
display: flex;
align-items: center;
gap: var(--space-3);
margin-bottom: var(--space-4);
color: var(--meta);
font-size: var(--text-xs);
}
.divider::before,
.divider::after {
content: '';
flex: 1;
height: 1px;
background: var(--border);
}
/* Social buttons */
.social-row {
display: flex;
justify-content: center;
gap: var(--space-4);
margin-bottom: var(--space-4);
}
.social-btn {
width: 48px;
height: 48px;
border-radius: 50%;
border: 1.5px solid var(--border);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all var(--motion-fast) var(--ease-standard);
background: var(--surface);
}
.social-btn:hover {
transform: translateY(-2px);
box-shadow: var(--elev-soft);
}
.social-btn:active { transform: scale(0.95); }
.social-btn svg { width: 24px; height: 24px; }
.social-btn.wechat { background: #07C160; border-color: #07C160; }
.social-btn.wechat:hover { background: #06AD56; border-color: #06AD56; }
.social-btn.apple { background: #1D1D1F; border-color: #1D1D1F; }
.social-btn.apple:hover { background: #333; border-color: #333; }
.social-btn.google { background: var(--surface); }
/* Bottom link */
.bottom-link {
text-align: center;
font-size: var(--text-xs);
color: var(--muted);
margin-top: auto;
}
.bottom-link a {
color: var(--accent);
text-decoration: none;
font-weight: 600;
cursor: pointer;
background: none;
border: none;
font-size: inherit;
font-family: inherit;
}
.bottom-link a:hover { text-decoration: underline; }
/* Version */
.version {
position: absolute;
bottom: var(--space-4);
left: 50%;
transform: translateX(-50%);
font-size: var(--text-xs);
color: var(--meta);
}
/* State toggling */
.register-fields { display: none; }
.is-register .register-fields { display: block; }
.is-register .login-only { display: none; }
/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
}
/* Animations */
@keyframes fadeIn {
from { opacity: 0; transform: translateY(8px); }
to { opacity: 1; transform: translateY(0); }
}
.anim-fade { animation: fadeIn 0.4s var(--ease-standard) both; }
</style>
</head>
<body>
<!-- Centered login card -->
<div class="login-card anim-fade">
<!-- Left: Brand panel -->
<div class="brand-panel">
<div class="deco deco-dot1" aria-hidden="true"></div>
<div class="deco deco-dot2" aria-hidden="true"></div>
<div class="deco deco-dot3" aria-hidden="true"></div>
<div class="deco deco-flower" aria-hidden="true"></div>
<div class="deco deco-wave" aria-hidden="true">
<svg viewBox="0 0 30 12" fill="none" stroke="var(--accent)" stroke-width="2" stroke-linecap="round">
<path d="M2 8 Q8 2, 15 8 Q22 14, 28 8"/>
</svg>
</div>
<div class="logo-wrap" aria-hidden="true">
<div class="logo-notebook"></div>
<div class="logo-spine"></div>
<div class="logo-heart"></div>
</div>
<div class="brand-title">暖记</div>
<div class="brand-tagline">用温暖记录每一天</div>
</div>
<!-- Right: Form panel -->
<div class="form-panel" id="formArea">
<h1 class="form-title" id="formTitle">欢迎回来</h1>
<form id="loginForm" autocomplete="on" novalidate>
<!-- Register: nickname -->
<div class="register-fields">
<div class="input-group">
<span class="input-icon" aria-hidden="true">
<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round">
<circle cx="10" cy="7" r="4"/><path d="M3 18c0-3.3 3.1-6 7-6s7 2.7 7 6"/>
</svg>
</span>
<input type="text" id="nickname" name="nickname" placeholder="请输入昵称" autocomplete="nickname" aria-label="昵称">
</div>
</div>
<!-- Phone -->
<div class="input-group">
<span class="input-icon" aria-hidden="true">
<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round">
<rect x="5" y="2" width="10" height="16" rx="2"/><line x1="8" y1="15" x2="12" y2="15"/>
</svg>
</span>
<input type="tel" id="phone" name="phone" placeholder="请输入手机号" autocomplete="tel" pattern="[0-9]*" aria-label="手机号">
</div>
<!-- Register: password -->
<div class="register-fields">
<div class="input-group has-toggle">
<span class="input-icon" aria-hidden="true">
<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round">
<rect x="3" y="9" width="14" height="9" rx="2"/><path d="M6 9V6a4 4 0 018 0v3"/>
</svg>
</span>
<input type="password" id="regPassword" name="password" placeholder="请输入密码" autocomplete="new-password" aria-label="密码">
<button type="button" class="toggle-password" aria-label="显示密码" onclick="togglePwd('regPassword', this)">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round">
<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/>
</svg>
</button>
</div>
</div>
<!-- Verification code -->
<div class="input-group has-action">
<span class="input-icon" aria-hidden="true">
<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round">
<rect x="2" y="4" width="16" height="12" rx="2"/><path d="M6 8v4M10 7v6M14 8v4"/>
</svg>
</span>
<input type="tel" id="code" name="code" placeholder="请输入验证码" autocomplete="one-time-code" pattern="[0-9]*" aria-label="验证码">
<button type="button" class="input-action" aria-label="获取验证码" id="getCodeBtn" onclick="sendCode()">获取验证码</button>
</div>
<!-- Register: agreement -->
<div class="register-fields">
<label class="agreement">
<input type="checkbox" id="agreement" aria-label="同意用户协议">
<span>我已阅读并同意<a href="#" onclick="return false">《用户协议》</a><a href="#" onclick="return false">《隐私政策》</a></span>
</label>
</div>
<!-- Submit -->
<button type="submit" class="btn-login" id="submitBtn" aria-label="登录">登录</button>
</form>
<!-- Divider -->
<div class="divider">其他登录方式</div>
<!-- Social buttons -->
<div class="social-row">
<button type="button" class="social-btn wechat" aria-label="微信登录">
<svg viewBox="0 0 28 28" fill="none">
<path d="M19.1 12.5c-.2-3.3-3.2-5.9-6.8-5.9-3.8 0-6.9 2.8-6.9 6.3 0 1.8.9 3.4 2.3 4.5l-.6 1.8 2.1-1.1c.7.2 1.5.3 2.3.3h.4c-.1-.4-.2-.8-.2-1.2.1-2.6 2.7-4.7 5.9-4.7h.2c.1-.1.2-.1.3 0z" fill="#FFF"/>
<path d="M11.6 11.5c-.5 0-1-.4-1-1s.4-1 1-1 1 .4 1 1-.5 1-1 1zM14.8 10.5c-.5 0-1 .4-1 1s.4 1 1 1 1-.4 1-1-.5-1-1-1z" fill="#07C160"/>
<path d="M25.5 16.8c0-2.9-2.9-5.3-6.3-5.3s-6.3 2.4-6.3 5.3 2.9 5.3 6.3 5.3c.7 0 1.4-.1 2-.3l1.7.9-.5-1.5c1.3-1 2.1-2.5 2.1-4.1 0 .1 0-.1 0-.3zm-8.6-1c-.4 0-.8-.3-.8-.8s.3-.8.8-.8.8.3.8.8-.4.8-.8.8zm4.6 0c-.4 0-.8-.3-.8-.8s.3-.8.8-.8.8.3.8.8-.4.8-.8.8z" fill="#FFF"/>
</svg>
</button>
<button type="button" class="social-btn apple" aria-label="Apple登录">
<svg viewBox="0 0 28 28" fill="#FFF">
<path d="M20.2 14.3c0-2 1.2-3.1 1.3-3.2-0.7-1-1.8-1.6-3-1.6-1.3 0-2 .8-2.7.8-.7 0-1.4-.8-2.5-.8-1.7 0-3.5 1.4-3.5 4.1 0 1.6.6 3.3 1.4 4.5.7 1 1.4 1.8 2.3 1.8.9 0 1.3-.7 2.5-.7 1.2 0 1.5.7 2.5.7.9 0 1.6-.8 2.2-1.7.4-.6.7-1.2.9-1.9-2-.8-2.4-3.8-.4-5zm-1.8-3.3c.5-.6.9-1.4.8-2.2-.8 0-1.8.5-2.3 1.2-.5.6-.9 1.4-.8 2.2.8 0 1.7-.5 2.3-1.2z"/>
</svg>
</button>
<button type="button" class="social-btn google" aria-label="Google登录">
<svg viewBox="0 0 28 28">
<path d="M14 11.5v5.2h7.3c-.3 1.7-1.3 3.1-2.7 4.1l4.4 3.4c2.6-2.4 4-5.9 4-10.1 0-1-.1-1.9-.3-2.8H14z" fill="#4285F4"/>
<path d="M6.3 16.4c-.4-1-.6-2.2-.6-3.4s.2-2.3.6-3.4L1.9 6.2C.7 8.5 0 11.2 0 14s.7 5.5 1.9 7.8l4.4-3.4z" fill="#FBBC05"/>
<path d="M14 28c3.7 0 6.8-1.2 9.1-3.3l-4.4-3.4c-1.2.8-2.8 1.3-4.7 1.3-3.6 0-6.7-2.4-7.8-5.7l-4.4 3.4C4.2 24.7 8.7 28 14 28z" fill="#34A853"/>
<path d="M14 5.6c2 0 3.9.7 5.3 2l4-4C20.8 1.2 17.7 0 14 0 8.7 0 4.2 3.3 2.1 8.1l4.4 3.4c1.1-3.3 4.2-5.9 7.5-5.9z" fill="#EA4335"/>
</svg>
</button>
</div>
<!-- Bottom link -->
<div class="bottom-link">
<span class="login-only">还没有账号?</span>
<a href="#" id="toggleLink" role="button" aria-label="切换到注册">立即注册</a>
</div>
</div>
<!-- Version -->
<div class="version" aria-hidden="true">v1.0.0</div>
</div>
<script>
(function() {
var isRegister = false;
var formArea = document.getElementById('formArea');
var formTitle = document.getElementById('formTitle');
var submitBtn = document.getElementById('submitBtn');
var toggleLink = document.getElementById('toggleLink');
var phoneInput = document.getElementById('phone');
phoneInput.addEventListener('input', function() {
this.value = this.value.replace(/[^0-9]/g, '');
});
var codeInput = document.getElementById('code');
codeInput.addEventListener('input', function() {
this.value = this.value.replace(/[^0-9]/g, '');
});
toggleLink.addEventListener('click', function(e) {
e.preventDefault();
isRegister = !isRegister;
if (isRegister) {
formArea.classList.add('is-register');
formTitle.textContent = '创建账号';
submitBtn.textContent = '注册';
submitBtn.setAttribute('aria-label', '注册');
toggleLink.textContent = '立即登录';
toggleLink.setAttribute('aria-label', '切换到登录');
toggleLink.previousElementSibling.textContent = '已有账号?';
} else {
formArea.classList.remove('is-register');
formTitle.textContent = '欢迎回来';
submitBtn.textContent = '登录';
submitBtn.setAttribute('aria-label', '登录');
toggleLink.textContent = '立即注册';
toggleLink.setAttribute('aria-label', '切换到注册');
toggleLink.previousElementSibling.textContent = '还没有账号?';
}
});
document.getElementById('loginForm').addEventListener('submit', function(e) {
e.preventDefault();
});
})();
function togglePwd(inputId, btn) {
var input = document.getElementById(inputId);
if (input.type === 'password') {
input.type = 'text';
btn.setAttribute('aria-label', '隐藏密码');
btn.innerHTML = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><path d="M17.94 17.94A10.07 10.07 0 0112 20c-7 0-11-8-11-8a18.45 18.45 0 015.06-5.94M9.9 4.24A9.12 9.12 0 0112 4c7 0 11 8 11 8a18.5 18.5 0 01-2.16 3.19m-6.72-1.07a3 3 0 11-4.24-4.24"/><line x1="1" y1="1" x2="23" y2="23"/></svg>';
} else {
input.type = 'password';
btn.setAttribute('aria-label', '显示密码');
btn.innerHTML = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/></svg>';
}
}
function sendCode() {
var btn = document.getElementById('getCodeBtn');
var seconds = 60;
btn.disabled = true;
btn.style.opacity = '0.6';
btn.textContent = seconds + 's';
var timer = setInterval(function() {
seconds--;
if (seconds <= 0) {
clearInterval(timer);
btn.disabled = false;
btn.style.opacity = '1';
btn.textContent = '获取验证码';
} else {
btn.textContent = seconds + 's';
}
}, 1000);
}
</script>
<script src="../../js/theme-switcher.js"></script>
</body>
</html>

View File

@@ -0,0 +1,471 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=1024, height=768, initial-scale=1">
<title>暖记 — 平板端搜索</title>
<link rel="stylesheet" href="../css/tokens.css">
<link rel="stylesheet" href="../css/components.css">
<link rel="stylesheet" href="shared.css">
<style>
body {
width: 1024px;
height: 768px;
overflow: hidden;
background: var(--bg);
font-family: var(--font-body);
}
.search-layout {
display: flex;
height: 768px;
}
/* Full-screen search without sidebar */
.search-main {
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
}
/* Search bar */
.search-bar {
height: 64px;
display: flex;
align-items: center;
gap: var(--space-4);
padding: 0 var(--space-8);
background: var(--surface);
border-bottom: 1px solid var(--border-soft);
flex-shrink: 0;
}
.search-back-btn {
width: 38px;
height: 38px;
border-radius: var(--radius-pill);
border: none;
background: none;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
color: var(--fg);
transition: background var(--motion-fast);
}
.search-back-btn:hover { background: var(--surface-warm); }
.search-back-btn svg { width: 20px; height: 20px; }
.search-input-wrap {
flex: 1;
max-width: 600px;
position: relative;
display: flex;
align-items: center;
}
.search-input-wrap svg {
position: absolute;
left: var(--space-4);
width: 18px;
height: 18px;
color: var(--muted);
pointer-events: none;
}
.search-input {
width: 100%;
height: 44px;
border: none;
border-radius: var(--radius-pill);
background: var(--surface-warm);
padding: 0 var(--space-4) 0 44px;
font-size: var(--text-base);
color: var(--fg);
outline: none;
font-family: var(--font-body);
}
.search-input::placeholder { color: var(--meta); }
.search-cancel-btn {
border: none;
background: none;
color: var(--accent);
font-size: var(--text-base);
font-weight: 600;
cursor: pointer;
min-height: 44px;
display: flex;
align-items: center;
}
.search-cancel-btn:hover { opacity: 0.7; }
/* Scrollable content */
.search-content {
flex: 1;
overflow-y: auto;
padding: var(--space-6) var(--space-8);
scrollbar-width: thin;
scrollbar-color: var(--border) transparent;
max-width: 900px;
margin: 0 auto;
width: 100%;
}
.search-content::-webkit-scrollbar { width: 4px; }
.search-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
/* Sections */
.search-section { margin-bottom: var(--space-6); }
.search-section-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: var(--space-3);
}
.search-section-title {
font-family: var(--font-display);
font-size: var(--text-lg);
font-weight: 700;
color: var(--fg);
}
.search-section-action {
font-size: var(--text-sm);
color: var(--accent);
background: none;
border: none;
cursor: pointer;
font-weight: 500;
min-height: 44px;
display: inline-flex;
align-items: center;
}
.search-tags { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.search-tag {
padding: 8px 18px;
border-radius: var(--radius-pill);
background: var(--surface-warm);
color: var(--fg-2);
font-size: var(--text-sm);
font-weight: 500;
border: 1px solid transparent;
cursor: pointer;
min-height: 44px;
display: inline-flex;
align-items: center;
transition: all var(--motion-fast);
}
.search-tag:hover { border-color: var(--accent); color: var(--accent); }
/* Result tabs */
.result-tabs {
display: flex;
gap: var(--space-1);
margin-bottom: var(--space-5);
border-bottom: 1px solid var(--border-soft);
padding-bottom: 2px;
}
.result-tab {
padding: var(--space-3) var(--space-5);
background: none;
border: none;
font-size: var(--text-sm);
font-weight: 600;
color: var(--muted);
cursor: pointer;
min-height: 44px;
position: relative;
transition: color var(--motion-fast);
}
.result-tab.active { color: var(--accent); }
.result-tab.active::after {
content: '';
position: absolute;
bottom: -3px;
left: var(--space-5);
right: var(--space-5);
height: 3px;
border-radius: 2px;
background: var(--accent);
}
/* Two-column results */
.result-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: var(--space-4);
}
.result-card {
background: var(--surface);
border-radius: var(--radius-md);
padding: var(--space-4);
box-shadow: var(--elev-soft);
border: 1px solid var(--border-soft);
cursor: pointer;
transition: transform var(--motion-fast) var(--ease-standard);
}
.result-card:hover { transform: translateY(-1px); }
.result-card-top {
display: flex;
justify-content: space-between;
align-items: flex-start;
margin-bottom: 4px;
}
.result-card-title {
font-family: var(--font-display);
font-size: var(--text-base);
font-weight: 600;
color: var(--fg);
}
.result-card-title mark {
background: var(--tertiary-soft);
color: var(--accent);
border-radius: 2px;
padding: 0 2px;
}
.result-card-date {
font-size: var(--text-xs);
color: var(--muted);
white-space: nowrap;
margin-left: var(--space-3);
}
.result-card-excerpt {
font-size: var(--text-sm);
color: var(--muted);
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
line-height: 1.5;
}
.result-card-excerpt mark {
background: var(--tertiary-soft);
color: var(--accent);
border-radius: 2px;
padding: 0 2px;
}
.result-card-tags { display: flex; gap: var(--space-1); margin-top: var(--space-2); }
.result-card-tag {
font-size: var(--text-xs);
color: var(--accent);
background: var(--surface-warm);
padding: 2px 8px;
border-radius: var(--radius-pill);
}
.result-template-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: var(--space-4);
}
.result-template-card {
background: var(--surface);
border-radius: var(--radius-md);
padding: var(--space-5);
box-shadow: var(--elev-soft);
border: 1px solid var(--border-soft);
text-align: center;
cursor: pointer;
transition: all var(--motion-fast);
}
.result-template-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.result-template-icon { font-size: 36px; margin-bottom: var(--space-2); }
.result-template-name {
font-family: var(--font-display);
font-size: var(--text-sm);
font-weight: 600;
color: var(--fg);
margin-bottom: 4px;
}
.result-template-name mark {
background: var(--tertiary-soft);
color: var(--accent);
border-radius: 2px;
padding: 0 2px;
}
.result-template-desc { font-size: var(--text-xs); color: var(--muted); }
</style>
</head>
<body>
<div class="search-layout">
<div class="search-main">
<div class="search-bar">
<button class="search-back-btn" aria-label="返回">
<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M15 18l-6-6 6-6"/></svg>
</button>
<div class="search-input-wrap">
<svg viewBox="0 0 22 22" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><line x1="16" y1="16" x2="20" y2="20"/></svg>
<input class="search-input" type="text" id="searchInput" placeholder="搜索日记、模板、标签..." autocomplete="off" aria-label="搜索" autofocus>
</div>
<button class="search-cancel-btn" aria-label="取消搜索">取消</button>
</div>
<div class="search-content">
<!-- Before-search state -->
<div id="searchBefore">
<div class="search-section">
<div class="search-section-header">
<span class="search-section-title">最近搜索</span>
<button class="search-section-action" aria-label="清除搜索历史">清除</button>
</div>
<div class="search-tags">
<button class="search-tag" aria-label="搜索 期末考试">期末考试</button>
<button class="search-tag" aria-label="搜索 读书笔记">读书笔记</button>
<button class="search-tag" aria-label="搜索 旅行计划">旅行计划</button>
<button class="search-tag" aria-label="搜索 心情">心情</button>
</div>
</div>
<div class="search-section">
<div class="search-section-header">
<span class="search-section-title">热门搜索</span>
</div>
<div class="search-tags">
<button class="search-tag" aria-label="搜索 期末">#期末</button>
<button class="search-tag" aria-label="搜索 读书">#读书</button>
<button class="search-tag" aria-label="搜索 心情">#心情</button>
<button class="search-tag" aria-label="搜索 旅行">#旅行</button>
<button class="search-tag" aria-label="搜索 美食">#美食</button>
<button class="search-tag" aria-label="搜索 学习">#学习</button>
<button class="search-tag" aria-label="搜索 运动">#运动</button>
<button class="search-tag" aria-label="搜索 灵感">#灵感</button>
</div>
</div>
</div>
<!-- Search results -->
<div id="searchResults" style="display:none">
<div class="result-tabs" role="tablist">
<button class="result-tab active" role="tab" aria-label="全部结果" aria-selected="true">全部</button>
<button class="result-tab" role="tab" aria-label="日记结果" aria-selected="false">日记</button>
<button class="result-tab" role="tab" aria-label="模板结果" aria-selected="false">模板</button>
<button class="result-tab" role="tab" aria-label="标签结果" aria-selected="false">标签</button>
</div>
<div id="resultDiary">
<div class="result-grid">
<div class="result-card" aria-label="打开日记 期末考试周复习计划">
<div class="result-card-top">
<span class="result-card-title">期末<mark>考试</mark>周复习计划</span>
<span class="result-card-date">2025年12月15日</span>
</div>
<div class="result-card-excerpt">今天开始了为期两周的期末<mark>考试</mark>复习,列了详细的计划表,每一科都安排了时间...</div>
<div class="result-card-tags">
<span class="result-card-tag">#学习</span>
<span class="result-card-tag">#期末</span>
</div>
</div>
<div class="result-card" aria-label="打开日记 考研倒计时30天">
<div class="result-card-top">
<span class="result-card-title">考研倒计时30天</span>
<span class="result-card-date">2025年11月25日</span>
</div>
<div class="result-card-excerpt">距离考研还有30天今天复习了英语阅读和政治感觉<mark>考试</mark>越来越近了...</div>
<div class="result-card-tags">
<span class="result-card-tag">#学习</span>
<span class="result-card-tag">#考研</span>
</div>
</div>
<div class="result-card" aria-label="打开日记 考试后的放松手账">
<div class="result-card-top">
<span class="result-card-title"><mark>考试</mark>后的放松手账</span>
<span class="result-card-date">2025年6月20日</span>
</div>
<div class="result-card-excerpt">终于考完试了!用手账记录了<mark>考试</mark>结束那一刻的心情,画了一幅小小的庆祝插画...</div>
<div class="result-card-tags">
<span class="result-card-tag">#心情</span>
<span class="result-card-tag">#手账</span>
</div>
</div>
<div class="result-card" aria-label="打开日记 图书馆的午后">
<div class="result-card-top">
<span class="result-card-title">图书馆的午后</span>
<span class="result-card-date">2025年5月30日</span>
</div>
<div class="result-card-excerpt">今天在图书馆自习,窗外的阳光洒进来,暖暖的。复习了高数第三章...</div>
<div class="result-card-tags">
<span class="result-card-tag">#日常</span>
<span class="result-card-tag">#学习</span>
</div>
</div>
</div>
</div>
<div id="resultTemplates" style="display:none">
<div class="result-template-grid">
<div class="result-template-card" aria-label="使用模板 考试复习计划">
<div class="result-template-icon">📝</div>
<div class="result-template-name"><mark>考试</mark>复习计划</div>
<div class="result-template-desc">适合期末<mark>考试</mark>周使用</div>
</div>
<div class="result-template-card" aria-label="使用模板 学习打卡">
<div class="result-template-icon">📚</div>
<div class="result-template-name">学习打卡</div>
<div class="result-template-desc">每日学习记录模板</div>
</div>
<div class="result-template-card" aria-label="使用模板 成绩分析">
<div class="result-template-icon">📊</div>
<div class="result-template-name">成绩分析</div>
<div class="result-template-desc"><mark>考试</mark>成绩复盘模板</div>
</div>
<div class="result-template-card" aria-label="使用模板 目标追踪">
<div class="result-template-icon">🎯</div>
<div class="result-template-name">目标追踪</div>
<div class="result-template-desc">学期目标追踪模板</div>
</div>
</div>
</div>
<div id="resultTags" style="display:none">
<div class="search-tags" style="gap: var(--space-3);">
<button class="search-tag" style="padding: 12px 24px; font-size: var(--text-base);" aria-label="搜索标签 考试">#考试 (3篇)</button>
<button class="search-tag" style="padding: 12px 24px; font-size: var(--text-base);" aria-label="搜索标签 考研">#考研 (2篇)</button>
<button class="search-tag" style="padding: 12px 24px; font-size: var(--text-base);" aria-label="搜索标签 考试周">#考试周 (1篇)</button>
<button class="search-tag" style="padding: 12px 24px; font-size: var(--text-base);" aria-label="搜索标签 复习">#复习 (5篇)</button>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
var input = document.getElementById('searchInput');
var beforeEl = document.getElementById('searchBefore');
var resultsEl = document.getElementById('searchResults');
var resultTabs = document.querySelectorAll('.result-tab');
var panels = ['resultDiary', 'resultTemplates', 'resultTags'];
input.addEventListener('input', function() {
if (this.value.trim().length > 0) {
beforeEl.style.display = 'none';
resultsEl.style.display = '';
} else {
beforeEl.style.display = '';
resultsEl.style.display = 'none';
}
});
document.querySelectorAll('.search-tag').forEach(function(tag) {
tag.addEventListener('click', function() {
input.value = this.textContent.trim();
input.dispatchEvent(new Event('input'));
});
});
resultTabs.forEach(function(tab, idx) {
tab.addEventListener('click', function() {
resultTabs.forEach(function(t) { t.classList.remove('active'); t.setAttribute('aria-selected', 'false'); });
tab.classList.add('active');
tab.setAttribute('aria-selected', 'true');
panels.forEach(function(p, i) {
document.getElementById(p).style.display = i === idx ? '' : 'none';
});
});
});
input.focus();
</script>
<script src="../../js/theme-switcher.js"></script>
</body>
</html>

View File

@@ -0,0 +1,227 @@
/* ─────────────────────────────────────────────────────────
* 暖记 — 平板端 (iPad 1024×768) 共享布局组件
* ───────────────────────────────────────────────────────── */
/* Sidebar navigation */
.sidebar {
position: fixed;
left: 0;
top: 0;
bottom: 0;
width: 260px;
background: var(--surface);
border-right: 1px solid var(--border-soft);
display: flex;
flex-direction: column;
z-index: 100;
padding: var(--space-6) 0;
}
.sidebar-brand {
display: flex;
align-items: center;
gap: var(--space-3);
padding: 0 var(--space-6);
margin-bottom: var(--space-8);
}
.sidebar-logo {
width: 42px;
height: 42px;
border-radius: var(--radius-md);
background: linear-gradient(135deg, var(--accent), var(--tertiary));
display: flex;
align-items: center;
justify-content: center;
font-size: 20px;
}
.sidebar-brand-text {
font-family: var(--font-display);
font-size: var(--text-xl);
font-weight: 700;
color: var(--fg);
}
.sidebar-brand-sub {
font-size: var(--text-xs);
color: var(--muted);
}
.sidebar-nav {
flex: 1;
display: flex;
flex-direction: column;
gap: 2px;
padding: 0 var(--space-3);
}
.sidebar-nav-item {
display: flex;
align-items: center;
gap: var(--space-3);
padding: var(--space-3) var(--space-4);
min-height: 44px;
border-radius: var(--radius-sm);
font-size: var(--text-base);
font-weight: 500;
color: var(--muted);
cursor: pointer;
border: none;
background: none;
width: 100%;
text-align: left;
transition: all var(--motion-fast) var(--ease-standard);
}
.sidebar-nav-item:hover {
background: var(--surface-warm);
color: var(--fg);
}
.sidebar-nav-item.active {
background: var(--surface-warm);
color: var(--accent);
font-weight: 600;
}
.sidebar-nav-item svg {
width: 22px;
height: 22px;
flex-shrink: 0;
}
.sidebar-write-btn {
margin: var(--space-4) var(--space-5);
padding: var(--space-4) var(--space-5);
min-height: 44px;
background: var(--accent);
color: var(--accent-on);
border: none;
border-radius: var(--radius-md);
font-family: var(--font-display);
font-size: var(--text-md);
font-weight: 600;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
gap: var(--space-2);
transition: all var(--motion-fast) var(--ease-bounce);
box-shadow: var(--shadow-accent);
}
.sidebar-write-btn:hover {
transform: translateY(-1px);
box-shadow: var(--shadow-accent-hover);
}
.sidebar-write-btn:active { transform: scale(0.97); }
.sidebar-write-btn svg { width: 20px; height: 20px; }
.sidebar-footer {
padding: var(--space-4) var(--space-5);
border-top: 1px solid var(--border-soft);
display: flex;
align-items: center;
gap: var(--space-3);
}
.sidebar-avatar {
width: 36px;
height: 36px;
border-radius: 50%;
background: var(--secondary-soft);
display: flex;
align-items: center;
justify-content: center;
font-size: 16px;
}
.sidebar-user-name {
font-size: var(--text-sm);
font-weight: 600;
color: var(--fg);
}
.sidebar-user-streak {
font-size: var(--text-xs);
color: var(--muted);
}
/* Main content area for tablet */
.main-content {
margin-left: 260px;
height: 100vh;
overflow-y: auto;
background: var(--bg);
scrollbar-width: thin;
scrollbar-color: var(--border) transparent;
}
.main-content::-webkit-scrollbar { width: 6px; }
.main-content::-webkit-scrollbar-track { background: transparent; }
.main-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.content-inner {
padding: var(--space-8) var(--space-10);
max-width: 740px;
}
/* Two-column layout */
.two-col {
display: grid;
grid-template-columns: 1fr 1fr;
gap: var(--space-5);
}
/* Page header for tablet */
.page-header {
margin-bottom: var(--space-6);
}
.page-header h1 {
font-family: var(--font-display);
font-size: var(--text-3xl);
font-weight: 700;
color: var(--fg);
}
.page-header-sub {
font-size: var(--text-base);
color: var(--muted);
margin-top: var(--space-1);
}
/* Tablet status bar (simplified) */
.tablet-statusbar {
position: fixed;
top: 0;
left: 260px;
right: 0;
height: 28px;
background: var(--surface);
border-bottom: 1px solid var(--border-soft);
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 var(--space-5);
font-size: 12px;
color: var(--muted);
font-weight: 500;
z-index: 50;
}
/* Focus visible styles for accessibility */
button:focus-visible,
a:focus-visible,
[role="button"]:focus-visible {
box-shadow: var(--focus-ring);
outline: none;
}
/* Minimum touch target for tablet */
button,
[role="button"] {
min-height: 44px;
}

View File

@@ -0,0 +1,461 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=390, height=844, initial-scale=1, viewport-fit=cover">
<title>暖记 — 模板画廊</title>
<link href="https://fonts.googleapis.com/css2?family=Caveat:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="../css/tokens.css">
<link rel="stylesheet" href="../css/components.css">
<style>
body {
width: 390px;
height: 844px;
overflow: hidden;
background: var(--bg);
position: relative;
}
/* Global focus styles */
button:focus-visible, a:focus-visible, [role="tab"]:focus-visible {
box-shadow: 0 0 0 3px var(--focus-ring);
outline: none;
}
.content-area {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
overflow-y: auto;
padding: 0 var(--space-5);
padding-top: calc(var(--safe-top) + var(--space-2));
padding-bottom: var(--safe-bottom);
scrollbar-width: none;
}
.content-area::-webkit-scrollbar { display: none; }
.top-bar {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: var(--space-4);
}
.top-bar h2 {
font-family: var(--font-display);
font-size: var(--text-2xl);
font-weight: 700;
}
.back-btn {
min-width: 44px;
min-height: 44px;
border-radius: 50%;
border: none;
background: var(--surface);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
color: var(--fg);
box-shadow: var(--elev-soft);
}
.back-btn svg { width: 20px; height: 20px; }
/* View type */
.view-types {
display: flex;
gap: var(--space-2);
margin-bottom: var(--space-5);
}
.view-type-btn {
flex: 1;
padding: 12px;
min-height: 44px;
border-radius: var(--radius-md);
border: 2px solid var(--border);
background: var(--surface);
display: flex;
flex-direction: column;
align-items: center;
gap: 6px;
cursor: pointer;
transition: all var(--motion-fast);
}
.view-type-btn.active {
border-color: var(--accent);
background: var(--surface-warm);
}
.view-type-btn .icon {
font-size: 28px;
}
.view-type-btn .label {
font-size: var(--text-sm);
font-weight: 600;
color: var(--fg-2);
}
.view-type-btn.active .label { color: var(--accent); }
/* Template preview cards */
.template-list {
display: flex;
flex-direction: column;
gap: var(--space-4);
}
.template-card {
background: var(--surface);
border-radius: var(--radius-lg);
overflow: hidden;
box-shadow: var(--elev-soft);
border: 1px solid var(--border-soft);
cursor: pointer;
transition: all var(--motion-fast);
}
.template-card:hover { transform: translateY(-2px); box-shadow: var(--elev-medium); }
.template-preview {
height: 200px;
position: relative;
overflow: hidden;
}
/* Daily template previews */
.tpl-daily-simple {
background: linear-gradient(180deg, var(--bg), #FFE8D6);
padding: var(--space-5);
display: flex;
flex-direction: column;
}
.tpl-daily-simple .tpl-date {
font-family: var(--font-display);
font-size: var(--text-sm);
color: var(--accent);
font-weight: 600;
margin-bottom: var(--space-2);
}
.tpl-daily-simple .tpl-title-line {
width: 60%;
height: 8px;
background: var(--fg);
border-radius: 4px;
opacity: 0.2;
margin-bottom: var(--space-4);
}
.tpl-daily-simple .tpl-lines {
display: flex;
flex-direction: column;
gap: 8px;
}
.tpl-daily-simple .tpl-line {
height: 4px;
background: var(--fg);
border-radius: 2px;
opacity: 0.08;
}
.tpl-daily-photo {
background: linear-gradient(180deg, var(--secondary-soft), #E8F4ED);
padding: var(--space-5);
display: flex;
gap: var(--space-4);
}
.tpl-daily-photo .tpl-text-col {
flex: 1;
display: flex;
flex-direction: column;
gap: 6px;
padding-top: var(--space-4);
}
.tpl-daily-photo .tpl-text-col .line {
height: 4px;
background: var(--fg);
border-radius: 2px;
opacity: 0.1;
}
.tpl-daily-photo .tpl-photo-col {
width: 80px;
border-radius: var(--radius-sm);
background: rgba(255,255,255,0.5);
display: flex;
align-items: center;
justify-content: center;
font-size: 24px;
}
.tpl-daily-grid {
background: linear-gradient(180deg, var(--tertiary-soft), #FFF3E0);
padding: var(--space-5);
display: grid;
grid-template-columns: 1fr 1fr;
gap: var(--space-3);
}
.tpl-daily-grid .cell {
background: rgba(255,255,255,0.5);
border-radius: var(--radius-sm);
padding: var(--space-3);
font-size: 11px;
color: var(--muted);
}
.tpl-daily-grid .cell .emoji { font-size: 18px; margin-bottom: 4px; }
/* Weekly preview */
.tpl-weekly {
background: linear-gradient(180deg, var(--rose-soft), #FFF0F0);
padding: var(--space-4);
}
.tpl-weekly-row {
display: flex;
gap: 4px;
}
.tpl-weekly-cell {
flex: 1;
background: rgba(255,255,255,0.5);
border-radius: 6px;
padding: 6px 4px;
text-align: center;
font-size: 10px;
color: var(--muted);
}
.tpl-weekly-cell .day { font-weight: 600; color: var(--fg-2); margin-bottom: 4px; }
.tpl-weekly-cell .dot { width: 6px; height: 6px; border-radius: 50%; margin: 4px auto; }
/* Monthly preview */
.tpl-monthly {
background: linear-gradient(180deg, #E8F4ED, #F0FFF4);
padding: var(--space-4);
}
.tpl-monthly-grid {
display: grid;
grid-template-columns: repeat(7, 1fr);
gap: 2px;
}
.tpl-monthly-cell {
aspect-ratio: 1;
border-radius: 4px;
background: rgba(255,255,255,0.4);
display: flex;
align-items: center;
justify-content: center;
font-size: 8px;
color: var(--meta);
}
.template-meta {
padding: var(--space-4) var(--space-5);
display: flex;
justify-content: space-between;
align-items: center;
}
.template-meta .info h4 {
font-family: var(--font-display);
font-size: var(--text-base);
font-weight: 600;
margin-bottom: 2px;
}
.template-meta .info .desc {
font-size: var(--text-xs);
color: var(--muted);
}
.template-meta .use-btn {
padding: 8px 20px;
background: var(--accent);
color: var(--accent-on);
border: none;
border-radius: var(--radius-pill);
font-family: var(--font-display);
font-size: var(--text-sm);
font-weight: 600;
cursor: pointer;
min-height: 44px;
transition: all var(--motion-fast);
}
.template-meta .use-btn:hover { background: var(--accent-hover); }
.template-meta .use-btn:active { transform: scale(0.95); }
/* Tags */
.template-tags {
display: flex;
gap: var(--space-2);
padding: 0 var(--space-5) var(--space-4);
}
.tpl-tag {
padding: 3px 10px;
border-radius: var(--radius-pill);
font-size: 11px;
font-weight: 500;
}
</style>
</head>
<body>
<div class="content-area">
<!-- Top bar -->
<div class="top-bar anim-fade">
<button class="back-btn" aria-label="返回">
<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M13 17l-6-6 6-6"/></svg>
</button>
<h2>模板画廊</h2>
<div style="width:44px"></div>
</div>
<!-- View type selector -->
<div class="view-types anim-fade" style="animation-delay: 0.1s">
<button class="view-type-btn active" aria-label="日视图模板">
<div class="icon">📝</div>
<div class="label">日视图</div>
</button>
<button class="view-type-btn" aria-label="周视图模板">
<div class="icon">📅</div>
<div class="label">周视图</div>
</button>
<button class="view-type-btn" aria-label="月视图模板">
<div class="icon">🗓</div>
<div class="label">月视图</div>
</button>
</div>
<!-- Template list -->
<div class="template-list">
<!-- Template 1: Student - Exam Prep -->
<div class="template-card anim-fade" style="animation-delay: 0.15s">
<div class="template-preview">
<div class="tpl-daily-simple" style="background: linear-gradient(180deg, var(--secondary-soft), #C8E6D0)">
<div class="tpl-date" style="color: #2D7D46">期末考试复习计划</div>
<div class="tpl-title-line" style="background: var(--secondary); opacity: 0.4"></div>
<div class="tpl-lines">
<div class="tpl-line" style="width: 100%; background: var(--secondary); opacity: 0.15"></div>
<div class="tpl-line" style="width: 85%; background: var(--secondary); opacity: 0.15"></div>
<div class="tpl-line" style="width: 90%; background: var(--secondary); opacity: 0.15"></div>
<div class="tpl-line" style="width: 70%; background: var(--secondary); opacity: 0.15"></div>
<div class="tpl-line" style="width: 95%; background: var(--secondary); opacity: 0.15"></div>
</div>
</div>
</div>
<div class="template-meta">
<div class="info">
<h4>期末考试复习计划</h4>
<div class="desc">按科目安排复习进度,记录重点难点</div>
</div>
<button class="use-btn" aria-label="使用期末考试复习计划模板">使用</button>
</div>
<div class="template-tags">
<span class="tpl-tag" style="background: var(--secondary-soft); color: #2D7D46">学生专属</span>
<span class="tpl-tag" style="background: var(--tertiary-soft); color: #B8860B">2.3k 人使用</span>
</div>
</div>
<!-- Template 2: Student - Course Schedule -->
<div class="template-card anim-fade" style="animation-delay: 0.2s">
<div class="template-preview">
<div class="tpl-daily-grid" style="background: linear-gradient(180deg, var(--tertiary-soft), #FFE8C0)">
<div class="cell" style="background: rgba(255,255,255,0.6)"><div class="emoji">📚</div>周一</div>
<div class="cell" style="background: rgba(255,255,255,0.6)"><div class="emoji">✏️</div>周二</div>
<div class="cell" style="background: rgba(255,255,255,0.6)"><div class="emoji">📖</div>周三</div>
<div class="cell" style="background: rgba(255,255,255,0.6)"><div class="emoji">🔬</div>周四</div>
</div>
</div>
<div class="template-meta">
<div class="info">
<h4>课程表周计划</h4>
<div class="desc">每周课程安排+作业追踪</div>
</div>
<button class="use-btn" aria-label="使用课程表周计划模板">使用</button>
</div>
<div class="template-tags">
<span class="tpl-tag" style="background: var(--secondary-soft); color: #2D7D46">学生专属</span>
<span class="tpl-tag" style="background: var(--tertiary-soft); color: #B8860B">5.1k 人使用</span>
</div>
</div>
<!-- Template 3: Student - Reading Notes -->
<div class="template-card anim-fade" style="animation-delay: 0.25s">
<div class="template-preview">
<div class="tpl-daily-photo" style="background: linear-gradient(180deg, var(--rose-soft), #FFE4E4)">
<div class="tpl-text-col">
<div class="line" style="width: 50%; height: 6px; background: var(--rose); opacity: 0.4"></div>
<div class="line" style="width: 100%; background: var(--rose); opacity: 0.2"></div>
<div class="line" style="width: 80%; background: var(--rose); opacity: 0.2"></div>
<div class="line" style="width: 90%; background: var(--rose); opacity: 0.2"></div>
<div class="line" style="width: 60%; background: var(--rose); opacity: 0.2"></div>
</div>
<div class="tpl-photo-col" style="background: rgba(255,255,255,0.5)">📖</div>
</div>
</div>
<div class="template-meta">
<div class="info">
<h4>读书笔记手账</h4>
<div class="desc">摘录+感悟+思维导图</div>
</div>
<button class="use-btn" aria-label="使用读书笔记手账模板">使用</button>
</div>
<div class="template-tags">
<span class="tpl-tag" style="background: var(--secondary-soft); color: #2D7D46">学生专属</span>
<span class="tpl-tag" style="background: var(--tertiary-soft); color: #B8860B">3.8k 人使用</span>
</div>
</div>
<!-- Template 4: Student - Campus Life -->
<div class="template-card anim-fade" style="animation-delay: 0.3s">
<div class="template-preview">
<div class="tpl-daily-simple" style="background: linear-gradient(180deg, #FFE8D6, #FFD4B8)">
<div class="tpl-date" style="color: var(--accent-active)">校园生活记录</div>
<div class="tpl-title-line" style="background: var(--accent); opacity: 0.4"></div>
<div class="tpl-lines">
<div class="tpl-line" style="width: 100%; background: var(--accent); opacity: 0.15"></div>
<div class="tpl-line" style="width: 85%; background: var(--accent); opacity: 0.15"></div>
<div class="tpl-line" style="width: 90%; background: var(--accent); opacity: 0.15"></div>
<div class="tpl-line" style="width: 70%; background: var(--accent); opacity: 0.15"></div>
<div class="tpl-line" style="width: 95%; background: var(--accent); opacity: 0.15"></div>
</div>
</div>
</div>
<div class="template-meta">
<div class="info">
<h4>校园生活记录</h4>
<div class="desc">社团活动+友谊+成长</div>
</div>
<button class="use-btn" aria-label="使用校园生活记录模板">使用</button>
</div>
<div class="template-tags">
<span class="tpl-tag" style="background: var(--secondary-soft); color: #2D7D46">学生专属</span>
<span class="tpl-tag" style="background: var(--tertiary-soft); color: #B8860B">1.9k 人使用</span>
</div>
</div>
<!-- Template 5: Monthly -->
<div class="template-card anim-fade" style="animation-delay: 0.35s">
<div class="template-preview">
<div class="tpl-monthly">
<div style="font-size:11px;color:var(--muted);margin-bottom:8px;font-weight:600">2026年5月</div>
<div class="tpl-monthly-grid">
<div class="tpl-monthly-cell"></div><div class="tpl-monthly-cell"></div><div class="tpl-monthly-cell"></div><div class="tpl-monthly-cell"></div><div class="tpl-monthly-cell"></div><div class="tpl-monthly-cell" style="background:var(--secondary-soft)">1</div><div class="tpl-monthly-cell" style="background:var(--secondary-soft)">2</div>
<div class="tpl-monthly-cell" style="background:var(--tertiary-soft)">3</div><div class="tpl-monthly-cell" style="background:var(--rose-soft)">4</div><div class="tpl-monthly-cell" style="background:var(--secondary-soft)">5</div><div class="tpl-monthly-cell" style="background:var(--secondary-soft)">6</div><div class="tpl-monthly-cell" style="background:#E0E0E0">7</div><div class="tpl-monthly-cell" style="background:var(--secondary-soft)">8</div><div class="tpl-monthly-cell" style="background:var(--rose-soft)">9</div>
</div>
</div>
</div>
<div class="template-meta">
<div class="info">
<h4>月历手账</h4>
<div class="desc">月度日历 + 心情色彩,一整月一目了然</div>
</div>
<button class="use-btn" aria-label="使用月历模板">使用</button>
</div>
<div class="template-tags">
<span class="tpl-tag" style="background: var(--border-soft); color: var(--muted)">月视图</span>
</div>
</div>
</div>
<div style="height: var(--space-8)"></div>
</div>
<div class="dynamic-island" aria-hidden="true"></div>
<div class="home-indicator" style="position:absolute;bottom:8px;left:50%;transform:translateX(-50%);z-index:101" aria-hidden="true"></div>
<script src="../js/theme-switcher.js"></script>
</body>
</html>

View File

@@ -0,0 +1,285 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=390, height=844, initial-scale=1, viewport-fit=cover">
<title>暖记 — 周概览</title>
<link href="https://fonts.googleapis.com/css2?family=Caveat:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="../css/tokens.css">
<link rel="stylesheet" href="../css/components.css">
<style>
body {
width: 390px; height: 844px;
overflow: hidden; background: var(--bg);
position: relative;
}
/* Global focus styles */
button:focus-visible, a:focus-visible, [role="tab"]:focus-visible {
box-shadow: 0 0 0 3px var(--focus-ring);
outline: none;
}
.content-area {
position: absolute; top: 0; left: 0; right: 0;
bottom: calc(var(--tab-height) + var(--safe-bottom));
overflow-y: auto; padding: 0 var(--space-5);
padding-top: calc(var(--safe-top) + var(--space-2));
scrollbar-width: none;
}
.content-area::-webkit-scrollbar { display: none; }
.week-header {
display: flex; align-items: center; justify-content: space-between;
margin-bottom: var(--space-5);
}
.week-title {
font-family: var(--font-display);
font-size: var(--text-2xl); font-weight: 700;
}
.week-nav { display: flex; gap: var(--space-2); }
.week-nav button {
min-width: 44px; min-height: 44px; border-radius: 50%;
border: 1.5px solid var(--border); background: var(--surface);
display: flex; align-items: center; justify-content: center;
cursor: pointer; color: var(--fg);
transition: all var(--motion-fast);
}
.week-nav button:hover { border-color: var(--accent); color: var(--accent); }
.week-nav button svg { width: 18px; height: 18px; }
/* Week strip */
.week-strip {
display: flex; gap: 4px; margin-bottom: var(--space-5);
}
.week-day {
flex: 1; text-align: center; padding: var(--space-3) 0;
border-radius: var(--radius-md); cursor: pointer;
transition: all var(--motion-fast);
min-height: 44px;
}
.week-day:hover { background: var(--surface-warm); }
.week-day .wd-name { font-size: 11px; color: var(--meta); margin-bottom: 4px; }
.week-day .wd-num {
font-family: var(--font-display); font-size: var(--text-lg);
font-weight: 700; color: var(--fg-2);
}
.week-day .wd-mood { font-size: 16px; margin-top: 4px; }
.week-day.today {
background: var(--accent); border-radius: var(--radius-md);
}
.week-day.today .wd-name { color: rgba(255,248,240,0.85); }
.week-day.today .wd-num { color: var(--accent-on); }
.week-day.has-entry .wd-num::after {
content: ''; display: block; width: 4px; height: 4px;
border-radius: 50%; background: var(--accent); margin: 4px auto 0;
}
.week-day.today.has-entry .wd-num::after { background: white; }
/* Day cards */
.day-card {
background: var(--surface); border-radius: var(--radius-md);
padding: var(--space-4); margin-bottom: var(--space-3);
box-shadow: var(--elev-soft); border: 1px solid var(--border-soft);
cursor: pointer; transition: all var(--motion-fast);
}
.day-card:hover { transform: translateY(-1px); }
.day-card-header {
display: flex; justify-content: space-between; align-items: center;
margin-bottom: var(--space-3);
}
.day-card-header .date {
font-size: var(--text-sm); font-weight: 600; color: var(--fg-2);
}
.day-card-header .mood-weather {
display: flex; gap: var(--space-2); align-items: center;
font-size: var(--text-sm);
}
.day-card-body {
font-size: var(--text-sm); color: var(--muted); line-height: 1.6;
display: -webkit-box; -webkit-line-clamp: 3;
-webkit-box-orient: vertical; overflow: hidden;
}
.day-card-tags {
display: flex; gap: var(--space-2); margin-top: var(--space-3);
flex-wrap: wrap;
}
.day-tag {
padding: 3px 10px; border-radius: var(--radius-pill);
font-size: 11px; font-weight: 500;
}
.day-card-photo {
width: 100%; height: 80px; border-radius: var(--radius-sm);
margin-top: var(--space-3); object-fit: cover;
}
.photo-placeholder {
width: 100%; height: 80px; border-radius: var(--radius-sm);
background: linear-gradient(135deg, var(--surface-warm), var(--border-soft));
display: flex; align-items: center; justify-content: center;
margin-top: var(--space-3); font-size: 24px;
}
/* Week summary */
.week-summary {
background: var(--surface); border-radius: var(--radius-md);
padding: var(--space-5); margin-bottom: var(--space-5);
box-shadow: var(--elev-soft); border: 1px solid var(--border-soft);
}
.week-summary h4 {
font-family: var(--font-display); font-size: var(--text-base);
font-weight: 600; margin-bottom: var(--space-4);
}
.summary-row {
display: flex; gap: var(--space-4); margin-bottom: var(--space-3);
}
.summary-item {
flex: 1; text-align: center;
}
.summary-item .val {
font-family: var(--font-display); font-size: var(--text-xl);
font-weight: 700;
}
.summary-item .val.accent { color: var(--accent); }
.summary-item .val.green { color: var(--secondary); }
.summary-item .desc {
font-size: var(--text-xs); color: var(--muted); margin-top: 2px;
}
.mood-dist {
display: flex; gap: var(--space-2); margin-top: var(--space-4);
}
.mood-seg {
height: 8px; border-radius: 4px;
}
</style>
</head>
<body>
<div class="content-area">
<div class="week-header anim-fade">
<div class="week-title">本周概览</div>
<div class="week-nav">
<button aria-label="上一周"><svg viewBox="0 0 18 18" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M11 14l-5-5 5-5"/></svg></button>
<button aria-label="下一周"><svg viewBox="0 0 18 18" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M7 4l5 5-5 5"/></svg></button>
</div>
</div>
<!-- Week strip - using standardized 5 moods -->
<div class="week-strip anim-fade" style="animation-delay: 0.1s">
<div class="week-day has-entry">
<div class="wd-name"></div><div class="wd-num">25</div><div class="wd-mood">😊</div>
</div>
<div class="week-day has-entry">
<div class="wd-name"></div><div class="wd-num">26</div><div class="wd-mood">😐</div>
</div>
<div class="week-day has-entry">
<div class="wd-name"></div><div class="wd-num">27</div><div class="wd-mood">😊</div>
</div>
<div class="week-day has-entry">
<div class="wd-name"></div><div class="wd-num">28</div><div class="wd-mood">😊</div>
</div>
<div class="week-day has-entry">
<div class="wd-name"></div><div class="wd-num">29</div><div class="wd-mood">😊</div>
</div>
<div class="week-day has-entry">
<div class="wd-name"></div><div class="wd-num">30</div><div class="wd-mood">😊</div>
</div>
<div class="week-day today has-entry">
<div class="wd-name"></div><div class="wd-num">31</div><div class="wd-mood">😊</div>
</div>
</div>
<!-- Week summary -->
<div class="week-summary anim-fade" style="animation-delay: 0.15s">
<h4>本周总结</h4>
<div class="summary-row">
<div class="summary-item">
<div class="val accent">6</div><div class="desc">记录天数</div>
</div>
<div class="summary-item">
<div class="val green">7</div><div class="desc">日记篇数</div>
</div>
<div class="summary-item">
<div class="val">12</div><div class="desc">使用贴纸</div>
</div>
</div>
<div class="mood-dist">
<div class="mood-seg" style="flex:3;background:var(--secondary)"></div>
<div class="mood-seg" style="flex:2;background:var(--tertiary)"></div>
<div class="mood-seg" style="flex:1;background:#5B7DB1"></div>
</div>
</div>
<!-- Day cards - using standardized 5 moods -->
<div class="day-card anim-fade" style="animation-delay: 0.2s">
<div class="day-card-header">
<span class="date">周日 · 5月31日</span>
<div class="mood-weather">😊 ☀️</div>
</div>
<div class="day-card-body">今天下午去图书馆自习,阳光从窗外洒进来,暖暖的。喝了抹茶拿铁,虽然期末压力大但看到窗外的樱花还在开,觉得一切都会好的。</div>
<div class="day-card-tags">
<span class="day-tag" style="background:var(--secondary-soft);color:#2D7D46">学习</span>
<span class="day-tag" style="background:var(--tertiary-soft);color:#B8860B">美食</span>
</div>
<div class="photo-placeholder">📚</div>
</div>
<div class="day-card anim-fade" style="animation-delay: 0.25s">
<div class="day-card-header">
<span class="date">周六 · 5月30日</span>
<div class="mood-weather">😊 🌤</div>
</div>
<div class="day-card-body">今天在图书馆自习,窗外的阳光洒进来,暖暖的。复习了高数第三章,做了两套模拟题感觉还不错。</div>
<div class="day-card-tags">
<span class="day-tag" style="background:var(--secondary-soft);color:#2D7D46">学习</span>
</div>
</div>
<div class="day-card anim-fade" style="animation-delay: 0.3s">
<div class="day-card-header">
<span class="date">周五 · 5月29日</span>
<div class="mood-weather">😊 ☀️</div>
</div>
<div class="day-card-body">考完试和舍友们去吃了火锅庆祝,大家都好开心,聊了很多有趣的事。这学期终于结束了!</div>
<div class="day-card-tags">
<span class="day-tag" style="background:var(--rose-soft);color:#9B4D4D">朋友</span>
<span class="day-tag" style="background:var(--tertiary-soft);color:#B8860B">美食</span>
</div>
<div class="photo-placeholder">🍲</div>
</div>
<div style="height: var(--space-8)"></div>
</div>
<!-- Tab bar -->
<nav class="tab-bar" role="tablist">
<button class="tab-item" role="tab" aria-label="首页" aria-selected="false">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M3 9l9-7 9 7v11a2 2 0 01-2 2H5a2 2 0 01-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/></svg>
<span>首页</span>
</button>
<button class="tab-item active" role="tab" aria-label="日历" aria-selected="true">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><rect x="3" y="4" width="18" height="18" rx="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg>
<span>日历</span>
</button>
<button class="tab-item" role="tab" aria-label="写日记" aria-selected="false" style="position:relative">
<div style="width:44px;height:44px;border-radius:50%;background:var(--accent);display:flex;align-items:center;justify-content:center;margin-top:-16px;box-shadow:0 4px 12px var(--shadow-accent)">
<svg viewBox="0 0 24 24" fill="none" stroke="var(--accent-on)" stroke-width="2.5" stroke-linecap="round" style="width:22px;height:22px" aria-hidden="true"><path d="M12 5v14M5 12h14"/></svg>
</div>
<span style="margin-top:2px">写日记</span>
</button>
<button class="tab-item" role="tab" aria-label="发现" aria-selected="false">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
<span>发现</span>
</button>
<button class="tab-item" role="tab" aria-label="我的" aria-selected="false">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2"/><circle cx="12" cy="7" r="4"/></svg>
<span>我的</span>
</button>
</nav>
<div class="dynamic-island" aria-hidden="true"></div>
<div class="home-indicator" style="position:absolute;bottom:8px;left:50%;transform:translateX(-50%);z-index:101" aria-hidden="true"></div>
<script src="../js/theme-switcher.js"></script>
</body>
</html>

File diff suppressed because it is too large Load Diff

171
scripts/dev.sh Normal file
View File

@@ -0,0 +1,171 @@
#!/bin/bash
# 暖记开发环境启动脚本 — 自动清理旧进程 + 启动后端和前端
#
# 用法:
# ./scripts/dev.sh # 启动全部
# ./scripts/dev.sh backend # 只启动后端
# ./scripts/dev.sh frontend # 只启动前端
# ./scripts/dev.sh stop # 停止所有服务
set -e
# ===== 配置 =====
BACKEND_PORT=3000
FRONTEND_PORT=8080
PG_HOST="localhost"
PG_PORT=5432
PG_USER="postgres"
PG_PASS="123123"
PG_DB="nuanji"
# ===== 颜色 =====
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m'
log_info() { echo -e "${BLUE}[INFO]${NC} $1"; }
log_ok() { echo -e "${GREEN}[OK]${NC} $1"; }
log_warn() { echo -e "${YELLOW}[WARN]${NC} $1"; }
log_err() { echo -e "${RED}[ERROR]${NC} $1"; }
# ===== 清理端口占用的进程 =====
kill_port() {
local port=$1
local name=$2
local pids=$(netstat -ano 2>/dev/null | grep ":${port}.*LISTENING" | awk '{print $5}' | sort -u)
if [ -n "$pids" ]; then
for pid in $pids; do
if [ "$pid" != "0" ]; then
taskkill //F //PID "$pid" 2>/dev/null && \
log_ok "已停止 ${name} (PID: ${pid}, 端口: ${port})" || \
log_warn "无法停止 ${name} (PID: ${pid})"
fi
done
else
log_info "${name} 端口 ${port} 空闲"
fi
}
stop_all() {
log_info "停止所有暖记服务..."
kill_port $BACKEND_PORT "后端"
kill_port $FRONTEND_PORT "前端"
# 也杀掉可能的残留 Chrome 进程Flutter dev 启动的)
taskkill //F //IM erp-server.exe 2>/dev/null && log_ok "已停止 erp-server.exe" || true
log_ok "所有服务已停止"
}
# ===== 检查依赖 =====
check_deps() {
log_info "检查依赖..."
# PostgreSQL
if PGPASSWORD=$PG_PASS /d/postgreSQL/bin/psql.exe -U $PG_USER -h $PG_HOST -p $PG_PORT \
-d $PG_DB -c "SELECT 1" > /dev/null 2>&1; then
log_ok "PostgreSQL 已连接 (${PG_DB}@${PG_HOST}:${PG_PORT})"
else
log_err "无法连接 PostgreSQL (${PG_DB}@${PG_HOST}:${PG_PORT})"
log_err "请确保 PostgreSQL 已启动且数据库 ${PG_DB} 存在"
exit 1
fi
# Redis
if redis-cli ping > /dev/null 2>&1; then
log_ok "Redis 已连接"
else
log_err "无法连接 Redis (localhost:6379)"
exit 1
fi
# Flutter
if D:/flutter/bin/flutter.bat --version > /dev/null 2>&1; then
log_ok "Flutter SDK 可用"
else
log_err "Flutter SDK 不可用"
exit 1
fi
}
# ===== 启动后端 =====
start_backend() {
log_info "清理旧后端进程..."
kill_port $BACKEND_PORT "后端"
taskkill //F //IM erp-server.exe 2>/dev/null || true
sleep 1
log_info "编译并启动后端 (diary feature)..."
ERP__DATABASE__URL="postgres://${PG_USER}:${PG_PASS}@${PG_HOST}:${PG_PORT}/${PG_DB}" \
ERP__REDIS__URL="redis://localhost:6379" \
ERP__JWT__SECRET="nuanji-dev-jwt-secret-2024-warm-notes-hmac-key-32b" \
ERP__AUTH__SUPER_ADMIN_PASSWORD="admin123" \
ERP__WECHAT__APPID="wx_dev_placeholder" \
ERP__WECHAT__SECRET="wx_dev_secret_placeholder" \
ERP__WECHAT__DEV_MODE="true" \
ERP__CRYPTO__KEK="0000000000000000000000000000000000000000000000000000000000000000" \
cargo run -p erp-server --features diary &
# 等待后端就绪
log_info "等待后端就绪..."
for i in $(seq 1 30); do
if curl -s "http://localhost:${BACKEND_PORT}/api/v1/health" > /dev/null 2>&1; then
log_ok "后端已就绪 → http://localhost:${BACKEND_PORT}"
return 0
fi
sleep 2
done
log_err "后端启动超时"
return 1
}
# ===== 启动前端 =====
start_frontend() {
log_info "清理旧前端进程..."
kill_port $FRONTEND_PORT "前端"
sleep 1
log_info "编译并启动 Flutter Web..."
cd /g/nj/app
D:/flutter/bin/flutter.bat run -d chrome --web-port=$FRONTEND_PORT &
log_info "等待前端就绪..."
for i in $(seq 1 30); do
if curl -s "http://localhost:${FRONTEND_PORT}" > /dev/null 2>&1; then
log_ok "前端已就绪 → http://localhost:${FRONTEND_PORT}"
return 0
fi
sleep 3
done
log_err "前端启动超时"
return 1
}
# ===== 主流程 =====
case "${1:-all}" in
stop)
stop_all
;;
backend)
check_deps
start_backend
;;
frontend)
check_deps
start_frontend
;;
all)
check_deps
start_backend
start_frontend
log_ok "=== 暖记开发环境已启动 ==="
log_ok "后端: http://localhost:${BACKEND_PORT}"
log_ok "前端: http://localhost:${FRONTEND_PORT}"
log_ok "API 文档: http://localhost:${BACKEND_PORT}/api/v1/health"
;;
*)
echo "用法: $0 [all|backend|frontend|stop]"
exit 1
;;
esac