1+ <!DOCTYPE html>
2+ < html lang ="en ">
3+ < head >
4+ < meta charset ="UTF-8 ">
5+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
6+ < title > 专注番茄时钟 PWA</ title >
7+ < link rel ="stylesheet " href ="/static/css/pomodoro-timer.css ">
8+ < link rel ="manifest " href ="/manifest.json ">
9+ </ head >
10+ < body data-theme ="light ">
11+ < div id ="app ">
12+ < header >
13+ < h1 > 专注番茄时钟</ h1 >
14+ < div id ="header-controls ">
15+ < button id ="theme-toggle " title ="切换主题 "> 🎨</ button >
16+ < button id ="settings-toggle " title ="设置 "> ⚙️</ button >
17+ < button id ="focus-mode-toggle " title ="专注模式 "> 🔒</ button >
18+ </ div >
19+ </ header >
20+
21+ < main >
22+ < div id ="timer-wrapper ">
23+ <!-- <div id="session-tabs">
24+ <button data-session="work" class="active">工作</button>
25+ <button data-session="shortBreak">短休息</button>
26+ <button data-session="longBreak">长休息</button>
27+ </div> -->
28+ < div id ="session-tabs ">
29+ < button data-session ="work " class ="active "> 工作</ button >
30+ < button data-session ="shortBreak "> 短休息</ button >
31+ < button data-session ="longBreak "> 长休息</ button >
32+ </ div >
33+
34+ < div id ="timer-display ">
35+ < svg class ="progress-ring " width ="300 " height ="300 ">
36+ < circle class ="progress-ring-bg " stroke ="#e6e6e6 " stroke-width ="12 " fill ="transparent " r ="144 " cx ="150 " cy ="150 "/>
37+ < circle id ="progress-indicator " class ="progress-ring-indicator " stroke ="var(--accent-color) " stroke-width ="12 " fill ="transparent " r ="144 " cx ="150 " cy ="150 " transform ="rotate(-90 150 150) "/>
38+ </ svg >
39+ < div id ="time-left "> 25:00</ div >
40+ </ div >
41+
42+ < div id ="controls ">
43+ < button id ="start-pause-btn " class ="control-btn "> 开始 (Space)</ button >
44+ < button id ="reset-btn " class ="control-btn "> 重置 (R)</ button >
45+ < button id ="skip-btn " class ="control-btn "> 跳过 (S)</ button >
46+ </ div >
47+ </ div >
48+
49+ < div id ="task-panel " class ="card ">
50+ < h2 > 📚 任务清单</ h2 >
51+ < div id ="task-input-group ">
52+ < input type ="text " id ="task-input " placeholder ="添加任务并关联番茄时间... ">
53+ < button id ="add-task-btn "> +</ button >
54+ </ div >
55+ < ul id ="tasks "> </ ul >
56+ </ div >
57+ </ main >
58+
59+ < section id ="settings-panel " class ="hidden card ">
60+ < h2 > ⚙️ 定时器设置</ h2 >
61+ < button id ="save-settings-btn "> 保存</ button >
62+ </ section >
63+
64+ < section id ="stats-panel " class ="card ">
65+ < h2 > 📈 效率统计</ h2 >
66+ < p > 已完成番茄周期: < span id ="pomodoros-count "> 0</ span > </ p >
67+ < canvas id ="daily-chart "> </ canvas >
68+ < canvas id ="weekly-chart "> </ canvas >
69+ </ section >
70+ </ div >
71+
72+ < div id ="focus-overlay " class ="hidden ">
73+ < p > 专注模式激活中... 远离分心!</ p >
74+ </ div >
75+
76+ < script src ="/static/js/pomodoro-timer.js "> </ script >
77+ < script src ="https://cdn.jsdelivr.net/npm/chart.js "> </ script >
78+ < script >
79+ if ( 'serviceWorker' in navigator ) {
80+ window . addEventListener ( 'load' , ( ) => {
81+ navigator . serviceWorker . register ( '/sw.js' ) . then ( registration => {
82+ console . log ( 'SW registered: ' , registration ) ;
83+ } ) . catch ( registrationError => {
84+ console . log ( 'SW registration failed: ' , registrationError ) ;
85+ } ) ;
86+ } ) ;
87+ }
88+ </ script >
89+ </ body >
90+ </ html >
0 commit comments