-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
123 lines (122 loc) · 5.53 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="color-scheme" content="light dark">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>专注木鱼</title>
<script src="./scripts/index.js" type="module" defer></script>
<link rel="stylesheet" href="./styles/style.css">
</head>
<body class="sound-muyu light">
<script>
const darkModeMediaQuery = window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)")
const darkModeSwitcher = () => {
const targetClassList = document.body.classList
const isDarkMode = darkModeMediaQuery.matches
document.body.classList.toggle("dark", isDarkMode)
document.body.classList.toggle("light", !isDarkMode)
}
if (darkModeMediaQuery) {
darkModeMediaQuery.addListener(darkModeSwitcher)
darkModeSwitcher()
}
</script>
<dialog id="time-picker-dialog" is="time-picker"></dialog>
<dialog id="help-info">
<h1>使用说明</h1>
<ol class="portrait">
<li><b>选择时间限制:</b>点击界面中间的时间选择器选择目标专注时长。</li>
<li><b>开始专注:</b>点击界面下方的<img src="./assets/icons/play_arrow.svg">按钮开始计时,程序会自动发出随机间隔的白噪音,请默数白噪音的出现次数。</li>
<li><b>结算:</b>在倒计时结束后,程序会自动弹出结算画面,你可以在此核对你的实际计数并进行专注程度的评估。</li>
</ol>
<ol class="landscape">
<li><b>选择时间限制:</b>通过界面右侧的时间选择器或者时间备选项选择目标专注时长。</li>
<li><b>开始专注:</b>点击界面右下角的<img src="./assets/icons/play_arrow.svg">按钮开始计时,程序会自动发出随机间隔的白噪音,请默数白噪音的出现次数。</li>
<li><b>结算:</b>在倒计时结束后,程序会自动弹出结算画面,你可以在此核对你的实际计数并进行专注程度的评估。</li>
</ol>
<div class="actions">
<button onclick="document.querySelector('#help-info').close()">关闭</button>
</div>
</dialog>
<main>
<div class="sound-source">
<div class="sound-image">
<img class="sound-muyu" src="./assets/muyu.png" loading="lazy">
<img class="sound-drops" src="./assets/drops.png" loading="lazy">
<img class="sound-pendulum" src="./assets/pendulum.png" loading="lazy">
<img class="sound-book" src="./assets/book.png" loading="lazy">
</div>
<div class="sound-switch">
<button id="previous-sound">
<div class="icon">
<img src="./assets/icons/arrow_back.svg" draggable="false">
</div>
</button>
<span><span class="sound-desc">当前音效:</span><span id="current-sound">木鱼</span></span>
<button id="next-sound">
<div class="icon">
<img src="./assets/icons/arrow_forward.svg" draggable="false">
</div>
</button>
</div>
</div>
<div class="tabs-container">
<div class="tabs show-countdown">
<div class="countdown ready">
<count-down id="timer"></count-down>
<div class="time-candidates">
<button>00:00:30</button>
<button>00:02:00</button>
<button>00:03:00</button>
<button>00:05:00</button>
<button>00:08:00</button>
<button>00:10:00</button>
</div>
<div class="actions">
<button class="action" id="stop">
<img src="./assets/icons/stop.svg" draggable="false">
</button>
<button class="action" id="pause">
<img src="./assets/icons/pause.svg" draggable="false">
</button>
<button class="action" id="start">
<img src="./assets/icons/play_arrow.svg" draggable="false">
</button>
</div>
</div>
<div class="result">
<div class="result-info">
<h1>完成!</h1>
<div class="cards">
<div class="card-desc">专注时长:</div>
<count-down id="result-duration"></count-down>
<div class="card-desc">响声次数:</div>
<span><span id="sound-count">0</span>次</span>
</div>
</div>
<div class="actions">
<button id="return">
<div class="icon">
<img src="./assets/icons/return.svg">
</div>
<span class="text">返回</span>
</button>
</div>
</div>
</div>
</div>
</main>
<div class="fab-group">
<button class="action small" id="fullscreen" onclick="document.body.requestFullscreen()">
<img src="./assets/icons/fullscreen.svg" draggable="false">
</button>
<button class="action small" id="fullscreen-exit" onclick="document.exitFullscreen()">
<img src="./assets/icons/fullscreen_exit.svg" draggable="false">
</button>
<button class="action small" onclick="document.querySelector('#help-info').showModal()">
<img src="./assets/icons/help.svg" draggable="false">
</button>
</div>
</body>
</html>