feat: 更新考试时间配置并优化状态显示

This commit is contained in:
MKStoler1024 2025-03-31 15:04:51 +00:00
parent 000df5e1fc
commit 5ffdf84abc
2 changed files with 28 additions and 29 deletions

View File

@ -101,10 +101,9 @@ document.addEventListener("DOMContentLoaded", () => {
remainingTimeElem.textContent = `剩余时间: ${remainingTimeText}`; remainingTimeElem.textContent = `剩余时间: ${remainingTimeText}`;
remainingTimeElem.style.color = "#93b4f7"; remainingTimeElem.style.color = "#93b4f7";
remainingTimeElem.style.fontWeight = "normal"; remainingTimeElem.style.fontWeight = "normal";
statusElem.textContent = "状态: 进行中";
statusElem.style.color = "#5ba838";
} }
statusElem.textContent = "状态: 进行中";
statusElem.style.color = "#5ba838";
} else if (lastExam && now < new Date(lastExam.end).getTime() + 60000) { } else if (lastExam && now < new Date(lastExam.end).getTime() + 60000) {
const timeSinceEnd = (now.getTime() - new Date(lastExam.end).getTime()) / 1000; const timeSinceEnd = (now.getTime() - new Date(lastExam.end).getTime()) / 1000;
currentSubjectElem.textContent = `上场科目: ${lastExam.name}`; currentSubjectElem.textContent = `上场科目: ${lastExam.name}`;

View File

@ -5,43 +5,43 @@
"examInfos": [ "examInfos": [
{ {
"name": "语文", "name": "语文",
"start": "2025-03-30T07:20:00", "start": "2025-03-31T07:20:00",
"end": "2025-03-30T09:50:00"
},
{
"name": "物理",
"start": "2025-03-30T10:20:00",
"end": "2025-03-30T11:50:00"
},
{
"name": "英语",
"start": "2025-03-30T14:10:00",
"end": "2025-03-30T23:50:00"
},
{
"name": "历史",
"start": "2025-03-30T23:55:00",
"end": "2025-03-31T01:00:00"
},
{
"name": "数学",
"start": "2025-03-31T07:50:00",
"end": "2025-03-31T09:50:00" "end": "2025-03-31T09:50:00"
}, },
{ {
"name": "化学", "name": "物理",
"start": "2025-03-31T10:20:00", "start": "2025-03-31T10:20:00",
"end": "2025-03-31T11:50:00" "end": "2025-03-31T11:50:00"
}, },
{ {
"name": "生物/政治", "name": "英语",
"start": "2025-03-31T14:10:00", "start": "2025-03-31T14:10:00",
"end": "2025-03-31T15:40:00" "end": "2025-03-31T23:15:00"
},
{
"name": "历史",
"start": "2025-03-31T23:55:00",
"end": "2025-04-01T01:00:00"
},
{
"name": "数学",
"start": "2025-04-01T07:50:00",
"end": "2025-04-01T09:50:00"
},
{
"name": "化学",
"start": "2025-04-01T10:20:00",
"end": "2025-04-01T11:50:00"
},
{
"name": "生物/政治",
"start": "2025-04-01T14:10:00",
"end": "2025-04-01T15:40:00"
}, },
{ {
"name": "地理", "name": "地理",
"start": "2025-03-31T16:10:00", "start": "2025-04-01T16:10:00",
"end": "2025-03-31T17:40:00" "end": "2025-04-01T17:40:00"
} }
] ]
} }