Skip to content

Commit cf7451a

Browse files
committed
2026/5/5
1 parent ac50331 commit cf7451a

3 files changed

Lines changed: 557 additions & 19 deletions

File tree

WHKScore/attention/atn.css

Lines changed: 305 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,9 @@ body {
1616
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
1717
background-color: var(--bg-color);
1818
color: var(--text-color);
19-
display: flex;
20-
justify-content: center;
21-
align-items: center;
22-
min-height: 100vh;
23-
overflow: hidden;
19+
margin: 0;
20+
padding: 0;
21+
overflow-x: hidden;
2422
}
2523

2624
.bgi {
@@ -52,9 +50,14 @@ body {
5250

5351
.container {
5452
width: 100%;
55-
max-width: 800px;
56-
padding: 20px;
53+
height: 100vh;
54+
display: flex;
55+
flex-direction: column;
56+
justify-content: center;
57+
align-items: center;
5758
text-align: center;
59+
padding: 20px;
60+
box-sizing: border-box;
5861
}
5962

6063
.time-display {
@@ -257,26 +260,310 @@ body {
257260
border: 1px solid rgba(88, 166, 255, 0.2);
258261
}
259262

263+
/* 倒计时功能板块样式 */
264+
.timer-container {
265+
width: 100%;
266+
height: 100vh;
267+
padding: 20px;
268+
background-color: #1a1b1d;
269+
border-radius: 0;
270+
border: none;
271+
box-shadow: none;
272+
transition: background-color 0.3s ease;
273+
box-sizing: border-box;
274+
display: flex;
275+
flex-direction: column;
276+
align-items: center;
277+
justify-content: flex-start;
278+
}
279+
280+
.timer-container.flashing {
281+
animation: flash 0.5s ease-in-out infinite;
282+
}
283+
284+
@keyframes flash {
285+
0%, 100% {
286+
background-color: #1a1b1d;
287+
}
288+
50% {
289+
background-color: #da3633;
290+
}
291+
}
292+
293+
.timer-header {
294+
text-align: center;
295+
margin-bottom: 30px;
296+
}
297+
298+
.timer-header h2 {
299+
font-size: 1.5rem;
300+
font-weight: 600;
301+
color: var(--text-color);
302+
margin-bottom: 15px;
303+
}
304+
305+
.timer-display {
306+
font-size: 4rem;
307+
font-weight: 700;
308+
color: var(--accent-color);
309+
font-family: 'Courier New', monospace;
310+
letter-spacing: 0.1em;
311+
}
312+
313+
.timer-controls {
314+
display: flex;
315+
justify-content: center;
316+
gap: 15px;
317+
margin-bottom: 20px;
318+
flex-wrap: wrap;
319+
}
320+
321+
.timer-btn {
322+
padding: 12px 30px;
323+
border: none;
324+
border-radius: 8px;
325+
font-size: 1rem;
326+
font-weight: 600;
327+
cursor: pointer;
328+
transition: all 0.3s ease;
329+
min-width: 100px;
330+
}
331+
332+
.timer-btn:hover {
333+
transform: translateY(-2px);
334+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
335+
}
336+
337+
.timer-btn:active {
338+
transform: translateY(0);
339+
}
340+
341+
.start-btn {
342+
background-color: #238636;
343+
color: white;
344+
}
345+
346+
.start-btn:hover {
347+
background-color: #2ea043;
348+
}
349+
350+
.pause-btn {
351+
background-color: #8b949e;
352+
color: white;
353+
}
354+
355+
.pause-btn:hover {
356+
background-color: #6e7681;
357+
}
358+
359+
.reset-btn {
360+
background-color: #da3633;
361+
color: white;
362+
}
363+
364+
.reset-btn:hover {
365+
background-color: #f85149;
366+
}
367+
368+
.timer-status {
369+
text-align: center;
370+
font-size: 1rem;
371+
color: var(--accent-color);
372+
font-weight: 500;
373+
padding: 12px;
374+
background-color: rgba(88, 166, 255, 0.1);
375+
border-radius: 8px;
376+
border: 1px solid rgba(88, 166, 255, 0.2);
377+
margin-bottom: 30px;
378+
}
379+
380+
.timer-status.running {
381+
background-color: rgba(35, 134, 54, 0.1);
382+
border-color: rgba(35, 134, 54, 0.3);
383+
color: #3fb950;
384+
}
385+
386+
.timer-status.paused {
387+
background-color: rgba(139, 148, 158, 0.1);
388+
border-color: rgba(139, 148, 158, 0.3);
389+
color: #8b949e;
390+
}
391+
392+
.timer-status.finished {
393+
background-color: rgba(218, 54, 51, 0.1);
394+
border-color: rgba(218, 54, 51, 0.3);
395+
color: #da3633;
396+
}
397+
398+
/* 计时记录列表样式 */
399+
.timer-records {
400+
margin-top: 30px;
401+
}
402+
403+
.timer-records h3 {
404+
font-size: 1.2rem;
405+
font-weight: 600;
406+
color: var(--text-color);
407+
margin-bottom: 15px;
408+
padding-bottom: 10px;
409+
border-bottom: 1px solid var(--border-color);
410+
}
411+
412+
#recordList {
413+
list-style: none;
414+
padding: 0;
415+
margin: 0;
416+
max-height: 300px;
417+
overflow-y: auto;
418+
}
419+
420+
#recordList li {
421+
padding: 12px 15px;
422+
background-color: rgba(255, 255, 255, 0.05);
423+
border-radius: 6px;
424+
margin-bottom: 10px;
425+
border: 1px solid var(--border-color);
426+
display: flex;
427+
justify-content: space-between;
428+
align-items: center;
429+
transition: all 0.3s ease;
430+
}
431+
432+
#recordList li:hover {
433+
background-color: rgba(255, 255, 255, 0.1);
434+
}
435+
436+
.record-info {
437+
display: flex;
438+
flex-direction: column;
439+
gap: 4px;
440+
text-align: left;
441+
}
442+
443+
.record-time {
444+
font-size: 0.9rem;
445+
color: var(--accent-color);
446+
font-family: 'Courier New', monospace;
447+
}
448+
449+
.record-description {
450+
font-size: 0.9rem;
451+
color: var(--text-color);
452+
opacity: 0.8;
453+
}
454+
455+
.record-date {
456+
font-size: 0.8rem;
457+
color: #8b949e;
458+
}
459+
460+
/* 弹窗样式 */
461+
.modal-overlay {
462+
position: fixed;
463+
top: 0;
464+
left: 0;
465+
width: 100%;
466+
height: 100%;
467+
background-color: rgba(0, 0, 0, 0.8);
468+
display: flex;
469+
justify-content: center;
470+
align-items: center;
471+
z-index: 1000;
472+
backdrop-filter: blur(5px);
473+
}
474+
475+
.modal-content {
476+
background-color: #161b22;
477+
border: 1px solid var(--border-color);
478+
border-radius: 12px;
479+
padding: 30px;
480+
width: 90%;
481+
max-width: 400px;
482+
text-align: center;
483+
box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
484+
}
485+
486+
.modal-content h3 {
487+
font-size: 1.5rem;
488+
font-weight: 600;
489+
color: var(--accent-color);
490+
margin-bottom: 15px;
491+
}
492+
493+
.modal-content p {
494+
font-size: 1rem;
495+
color: var(--text-color);
496+
opacity: 0.8;
497+
margin-bottom: 20px;
498+
}
499+
500+
.modal-content input {
501+
width: 100%;
502+
padding: 12px;
503+
background-color: rgba(255, 255, 255, 0.05);
504+
border: 1px solid var(--border-color);
505+
border-radius: 8px;
506+
color: var(--text-color);
507+
font-size: 1rem;
508+
margin-bottom: 20px;
509+
transition: all 0.3s ease;
510+
}
511+
512+
.modal-content input:focus {
513+
outline: none;
514+
border-color: var(--accent-color);
515+
box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1);
516+
}
517+
518+
.modal-content input::placeholder {
519+
color: #8b949e;
520+
}
521+
522+
.confirm-btn {
523+
padding: 12px 40px;
524+
background-color: #58a6ff;
525+
color: white;
526+
border: none;
527+
border-radius: 8px;
528+
font-size: 1rem;
529+
font-weight: 600;
530+
cursor: pointer;
531+
transition: all 0.3s ease;
532+
}
533+
534+
.confirm-btn:hover {
535+
background-color: #316dca;
536+
transform: translateY(-2px);
537+
box-shadow: 0 4px 12px rgba(88, 166, 255, 0.3);
538+
}
539+
540+
.confirm-btn:active {
541+
transform: translateY(0);
542+
}
543+
260544
/* 响应式调整 */
261545
@media (max-width: 768px) {
262-
.timer-section {
263-
bottom: 10px;
546+
.timer-container {
264547
padding: 15px;
265-
width: 95%;
548+
margin-top: 10px;
266549
}
267550

268-
.timer-settings {
269-
grid-template-columns: 1fr;
270-
gap: 12px;
551+
.timer-display {
552+
font-size: 2.5rem;
271553
}
272554

273555
.timer-controls {
274-
flex-direction: column;
275-
align-items: center;
556+
gap: 10px;
276557
}
277558

278-
.control-btn {
279-
width: 100%;
280-
max-width: 200px;
559+
.timer-btn {
560+
padding: 10px 20px;
561+
min-width: 80px;
562+
font-size: 0.9rem;
563+
}
564+
565+
.modal-content {
566+
padding: 20px;
567+
width: 95%;
281568
}
282569
}

WHKScore/attention/atn.html

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,40 @@
1515
<div class="time-display" id="timeDisplay"></div>
1616
</div>
1717

18+
<!-- 倒计时功能板块 -->
19+
<div class="timer-container" id="timerContainer">
20+
<div class="timer-header">
21+
<h2>专注倒计时</h2>
22+
<div class="timer-display" id="timerDisplay">120:00</div>
23+
</div>
24+
25+
<div class="timer-controls">
26+
<button class="timer-btn start-btn" id="startBtn">开始</button>
27+
<button class="timer-btn pause-btn" id="pauseBtn">暂停</button>
28+
<button class="timer-btn reset-btn" id="resetBtn">重置</button>
29+
</div>
30+
31+
<div class="timer-status" id="timerStatus">准备开始</div>
32+
33+
<!-- 计时记录列表 -->
34+
<div class="timer-records">
35+
<h3>计时记录</h3>
36+
<ul id="recordList">
37+
<!-- 记录将通过JavaScript动态生成 -->
38+
</ul>
39+
</div>
40+
41+
<!-- 结束弹窗 -->
42+
<div class="modal-overlay" id="modalOverlay" style="display: none;">
43+
<div class="modal-content">
44+
<h3>计时结束!</h3>
45+
<p>恭喜你完成了本次专注时间!</p>
46+
<input type="text" id="recordInput" placeholder="添加本次计时的描述...">
47+
<button class="confirm-btn" id="confirmBtn">确定</button>
48+
</div>
49+
</div>
50+
</div>
51+
1852
<script src="atn.js"></script>
1953
</body>
2054
</html>

0 commit comments

Comments
 (0)