Skip to content

Commit 27a7a76

Browse files
committed
feat: 添加考试提醒功能,更新主题样式并优化配置
1 parent 24c9a6a commit 27a7a76

File tree

12 files changed

+352
-433
lines changed

12 files changed

+352
-433
lines changed

exam/Scripts/examInfo.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ document.addEventListener("DOMContentLoaded", () => {
6767
let currentExam = null;
6868
let nextExam = null;
6969
let lastExam = null;
70+
let isnotificated = false;
7071

7172
data.examInfos.forEach(exam => {
7273
const start = new Date(exam.start);
@@ -79,6 +80,7 @@ document.addEventListener("DOMContentLoaded", () => {
7980
}
8081
if (now > end && (!lastExam || end > new Date(lastExam.end))) {
8182
lastExam = exam;
83+
isnotificated = false;
8284
}
8385
});
8486

@@ -97,6 +99,16 @@ document.addEventListener("DOMContentLoaded", () => {
9799
remainingTimeElem.style.fontWeight = "bold";
98100
statusElem.textContent = "状态: 即将结束";
99101
statusElem.style.color = "red";
102+
103+
// 在剩余15分钟时显示提醒
104+
if (isnotificated === false) {
105+
const overlay = document.getElementById('reminder-overlay');
106+
overlay.classList.add('show');
107+
setTimeout(() => {
108+
overlay.classList.remove('show');
109+
}, 5000);
110+
isnotificated = true;
111+
}
100112
} else {
101113
remainingTimeElem.textContent = `剩余时间: ${remainingTimeText}`;
102114
remainingTimeElem.style.color = "#93b4f7";

exam/Scripts/settings.js

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,17 @@ document.addEventListener("DOMContentLoaded", () => {
1616
let offsetTime = getCookie("offsetTime") || 0;
1717
let room = getCookie("room") || "";
1818
let zoomLevel = getCookie("zoomLevel") || 1;
19-
let theme = getCookie("theme") || "dark";
2019
let currentTheme = getCookie("currentTheme") || "md3";
20+
let theme = getCookie("theme") || "dark";
2121
let themeConfig = [];
2222

2323
offsetTime = parseInt(offsetTime);
2424
roomElem.textContent = room;
2525

26-
if (theme === "light") {
27-
themeLink.href = "Styles/light.css";
28-
themeToggle.checked = true;
29-
} else {
30-
themeLink.href = "Styles/dark.css";
31-
themeToggle.checked = false;
32-
}
26+
// 初始化主题
27+
const currentThemePath = `Styles/${currentTheme}/${theme}.css`;
28+
themeLink.href = currentThemePath;
29+
themeToggle.checked = theme === "light";
3330

3431
// 加载主题配置
3532
fetch('Styles/profile.json')
@@ -91,7 +88,7 @@ document.addEventListener("DOMContentLoaded", () => {
9188
setCookie("currentTheme", currentTheme, 365);
9289
roomElem.textContent = room;
9390
document.body.style.zoom = zoomLevel;
94-
themeLink.href = theme === "light" ? "Styles/light.css" : "Styles/dark.css";
91+
updateThemeLink();
9592
settingsModal.classList.add("fade-out");
9693
setTimeout(() => {
9794
settingsModal.style.display = "none";

exam/Styles/ealg/dark.css

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,3 +456,52 @@ input:checked + .slider:before {
456456
color: #E6E1E5;
457457
margin-bottom: 8px;
458458
}
459+
460+
.reminder-overlay {
461+
position: fixed;
462+
top: 0;
463+
left: 0;
464+
width: 100%;
465+
height: 100%;
466+
background-color: rgba(0, 0, 0, 0.95);
467+
display: flex;
468+
align-items: center;
469+
justify-content: center;
470+
opacity: 0;
471+
visibility: hidden;
472+
transition: all 0.5s ease;
473+
backdrop-filter: blur(8px);
474+
z-index: 9999;
475+
}
476+
477+
.reminder-overlay.show {
478+
opacity: 1;
479+
visibility: visible;
480+
}
481+
482+
.reminder-content {
483+
text-align: center;
484+
animation: fadeIn 0.5s ease;
485+
}
486+
487+
.reminder-title {
488+
font-size: 5rem;
489+
color: #FF453A;
490+
margin-bottom: 2rem;
491+
}
492+
493+
.reminder-subtitle {
494+
font-size: 3rem;
495+
color: #FFD60A;
496+
}
497+
498+
@keyframes fadeIn {
499+
from {
500+
opacity: 0;
501+
transform: translateY(-20px);
502+
}
503+
to {
504+
opacity: 1;
505+
transform: translateY(0);
506+
}
507+
}

exam/Styles/ealg/light.css

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,3 +456,52 @@ input:checked + .slider:before {
456456
color: #1C1B1F;
457457
margin-bottom: 8px;
458458
}
459+
460+
.reminder-overlay {
461+
position: fixed;
462+
top: 0;
463+
left: 0;
464+
width: 100%;
465+
height: 100%;
466+
background-color: rgba(255, 255, 255, 0.95);
467+
display: flex;
468+
align-items: center;
469+
justify-content: center;
470+
opacity: 0;
471+
visibility: hidden;
472+
transition: all 0.5s ease;
473+
backdrop-filter: blur(8px);
474+
z-index: 9999;
475+
}
476+
477+
.reminder-overlay.show {
478+
opacity: 1;
479+
visibility: visible;
480+
}
481+
482+
.reminder-content {
483+
text-align: center;
484+
animation: fadeIn 0.5s ease;
485+
}
486+
487+
.reminder-title {
488+
font-size: 5rem;
489+
color: #FF3B30;
490+
margin-bottom: 2rem;
491+
}
492+
493+
.reminder-subtitle {
494+
font-size: 3rem;
495+
color: #FF9500;
496+
}
497+
498+
@keyframes fadeIn {
499+
from {
500+
opacity: 0;
501+
transform: translateY(-20px);
502+
}
503+
to {
504+
opacity: 1;
505+
transform: translateY(0);
506+
}
507+
}

0 commit comments

Comments
 (0)