-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
338 lines (301 loc) · 13.1 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
<!DOCTYPE html>
<html lang="zh-Hant">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>資訊工程系碩士班 修課資料</title>
<link rel="icon" href="./img/Taipei-Tech-Logo.png" type="image/x-icon">
<style>
/* 全局樣式 */
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #eaf8e6;
}
header {
background: #a8d5a3;
color: #fff;
padding: 20px;
display: flex;
align-items: center;
}
header .img{
size: 30%;
}
.logo {
height: 60px;
margin-right: 15px;
}
.header-title {
font-size: 28px;
margin: 0;
flex: 1;
text-align: center;
}
main {
max-width: 1200px;
margin: 20px auto;
padding: 20px;
background: #ffffff;
border-radius: 8px;
box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
}
.section-header {
margin-bottom: 20px;
}
.section-header-left {
text-align: left;
}
#semester-dropdown {
border: 1px solid #a8d5a3;
padding: 8px 12px;
border-radius: 5px;
background-color: #e0f7fa;
color: #00695c;
font-size: 14px;
cursor: pointer;
margin-top: 10px;
}
.course-container {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 20px;
}
.course-card {
background: #f4fff4;
border: 1px solid #c8e6c9;
border-radius: 8px;
padding: 15px;
box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
display: flex;
flex-direction: column;
justify-content: space-between;
gap: 10px;
transition: transform 0.2s ease-in-out;
}
.course-card:hover {
transform: scale(1.03);
background-color: #f0fff0;
}
.course-card h3 {
margin: 0;
color: #388e3c;
}
.course-card p {
margin: 0;
font-size: 14px;
color: #555;
}
.view-materials-btn {
display: inline-block;
padding: 10px 15px;
background-color: #66bb6a;
color: white;
border: none;
border-radius: 5px;
text-decoration: none;
font-size: 14px;
font-weight: bold;
text-align: center;
transition: background-color 0.3s;
cursor: pointer;
}
.view-materials-btn:hover {
background-color: #43a047;
}
footer {
background: #d4e6d2;
color: #727171;
text-align: center;
padding: 20px 0;
position: relative;
font-size: 12px;
}
footer a {
color: #2e7d32;
text-decoration: none;
font-weight: bold;
}
footer a:hover {
text-decoration: underline;
}
footer .language-switcher {
position: absolute;
top: 10px;
right: 20px;
font-size: 14px;
}
footer .language-switcher a {
color: #388e3c;
text-decoration: none;
margin: 0 5px;
font-weight: bold;
cursor: pointer;
}
footer .language-switcher a:hover {
text-decoration: underline;
}
.disclaimer {
margin-top: 20px;
font-size: 12px;
color: #727171;
}
.back-to-top {
position: fixed;
bottom: 20px;
right: 20px;
background-color: #66bb6a;
color: white;
padding: 10px 20px; /* 調整為相等的 padding 使其成為正方形 */
border-radius: 15px; /* 圓角效果 */
text-align: center;
font-size: 16px;
cursor: pointer;
box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
display: none;
transition: background-color 0.3s, transform 0.3s;
}
.back-to-top:hover {
background-color: #43a047;
transform: scale(1.1);
}
</style>
</head>
<body>
<header>
<img src="./img/Taipei-Tech-Logo.png" alt="校徽" class="logo">
<h1 class="header-title" id="main-title">北科大-資訊工程系碩士班修課資料</h1>
</header>
<main id="content">
<section>
<div class="section-header section-header-left">
<p id="cohort"><strong>入學年份:2024 秋季班</strong></p>
<label for="semester-dropdown"><strong>選擇學期:</strong></label>
<select id="semester-dropdown">
<option value="113-1">113-1</option>
<option value="113-2">113-2</option>
</select>
</div>
<div class="course-container" id="course-container">
<!-- 課程卡片將根據所選語言和學期動態生成 -->
</div>
</section>
</main>
<footer>
<div class="language-switcher">
<a id="lang-zh" href="#">中文</a> | <a id="lang-en" href="#">English</a>
</div>
<p>© 2024 <a href="https://github.com/Yucheng0208">Yu-Cheng Chang's GitHub</a>. Licensed under MIT License.</p>
<div class="disclaimer">
<p id="disclaimer-text">此網頁由本人建置,供同儕及學弟妹參考使用。內容屬於個人主觀意見,不代表學校、系所或所有學生立場。</p>
</div>
</footer>
<div class="back-to-top" id="back-to-top">TOP</div>
<script>
const backToTop = document.getElementById('back-to-top');
const semesterDropdown = document.getElementById("semester-dropdown");
const courseContainer = document.getElementById("course-container");
const langZh = document.getElementById("lang-zh");
const langEn = document.getElementById("lang-en");
const mainTitle = document.getElementById("main-title");
const cohort = document.getElementById("cohort");
const disclaimerText = document.getElementById("disclaimer-text");
const contentData = {
"zh-Hant": {
mainTitle: "資訊工程系碩士班修課資料",
cohort: "入學年份:2024 秋季班",
disclaimer: "此網頁由本人建置,供同儕及學弟妹參考使用。內容屬於個人主觀意見,不代表學校、系所或所有學生立場。",
courses: {
"113-1": [
{ name: "電腦動畫", code: "337851", teacher: "謝東儒", credits: 3, status: "已修畢", language: "中文", url: "./113-1/Computer-Animation/" },
{ name: "密碼學", code: "336160", teacher: "陳昱圻", credits: 3, status: "已修畢", language: "英文", url: "./113-1/Cryptography" },
{ name: "嵌入式系統", code: "338069", teacher: "張世豪", credits: 3, status: "已修畢", language: "英文", url: "./113-1/Embedded-System" },
{ name: "自然語言處理", code: "343646", teacher: "清華大學 高宏宇", credits: 3, status: "已修畢", language: "中文", url: "./113-1/NTHU-Natural-Language-Processing" },
{ name: "樣式物件導向設計", code: "336150", teacher: "鄭有進", credits: 3, status: "已停修", language: "中文", url: "./113-1/Pattern-oriented-Software-Design" },
],
"113-2": [
{ name: "電腦圖學", code: "342744", teacher: "江佩穎", credits: 3, status: "待開課", language: "中文", url: "#" },
{ name: "雲端與物聯網安全", code: "342790", teacher: "張世豪", credits: 3, status: "待開課", language: "英文", url: "#" },
{ name: "區塊鏈技術與應用", code: "342793", teacher: "陳昱圻", credits: 3, status: "待開課", language: "中文", url: "#" },
{ name: "資料科學原理與教育數據應用", code: "342797", teacher: "劉傳銘", credits: 3, status: "待開課", language: "英文", url: "#" },
]
},
viewText: "檢視課程資料"
},
"en": {
mainTitle: "CSIE Master's Program Course Reference",
cohort: "Cohort: Fall 2024",
disclaimer: "This webpage is personally created to provide course reference for peers and juniors. The content reflects individual opinions and does not represent the views of the university, department, or all students.",
courses: {
"113-1": [
{ name: "Computer Animation", code: "337851", teacher: "謝東儒", credits: 3, status: "Done", language: "Chinese", url: "./113-1/Computer-Animation/" },
{ name: "Cryptography", code: "336160", teacher: "陳昱圻", credits: 3, status: "Done", language: "English", url: "./113-1/Cryptography" },
{ name: "Embedded Systems", code: "338069", teacher: "張世豪", credits: 3, status: "Done", language: "English", url: "./113-1/Embedded-System" },
{ name: "Natural Language Processing", code: "343646", teacher: "清華大學 高宏宇", credits: 3, status: "Done", language: "Chinese", url: "./113-1/NTHU-Natural-Language-Processing" },
{ name: "Pattern-oriented Software Design (POSD)", code: "336150", teacher: "鄭有進", credits: 3, status: "Dropped", language: "Chinese", url: "./113-1/Pattern-oriented-Software-Design" },
],
"113-2": [
{ name: "Computer Graphics", code: "342744", teacher: "江佩穎", credits: 3, status: "To Be Announced", language: "Chinese", url: "#" },
{ name: "Cloud and IoT Security", code: "342790", teacher: "張世豪", credits: 3, status: "To Be Announced", language: "English", url: "#" },
{ name: "Blockchain Techniques and Applications", code: "342793", teacher: "陳昱圻", credits: 3, status: "To Be Announced", language: "Chinese", url: "#" },
{ name: "Data Science Principles with Applications on Educational Data", code: "342797", teacher: "劉傳銘", credits: 3, status: "To Be Announced", language: "English", url: "#" },
]
},
viewText: "View Course Materials"
}
};
const renderCourses = (lang, semester) => {
const courses = contentData[lang].courses[semester];
courseContainer.innerHTML = courses.map(course => `
<div class="course-card">
<h3>${course.name}</h3>
<p>課程代碼: ${course.code}</p>
<p>學分數: ${course.credits}</p>
<p>修課狀態: ${course.status}</p>
<p>授課教師: ${course.teacher}</p>
<p>講授語言: ${course.language}</p>
<a href="${course.url}" class="view-materials-btn">${contentData[lang].viewText}</a>
</div>
`).join('');
};
const updateLanguage = (lang) => {
const data = contentData[lang];
mainTitle.textContent = data.mainTitle;
cohort.textContent = data.cohort;
disclaimerText.textContent = data.disclaimer;
// 渲染當前選定學期的課程
const selectedSemester = semesterDropdown.value;
renderCourses(lang, selectedSemester);
};
semesterDropdown.addEventListener("change", () => {
const selectedLang = document.body.lang || "zh-Hant";
const selectedSemester = semesterDropdown.value;
renderCourses(selectedLang, selectedSemester);
});
langZh.addEventListener("click", (e) => {
e.preventDefault();
document.body.lang = "zh-Hant";
updateLanguage("zh-Hant");
});
langEn.addEventListener("click", (e) => {
e.preventDefault();
document.body.lang = "en";
updateLanguage("en");
});
window.addEventListener('scroll', () => {
if (window.scrollY > 200) {
backToTop.style.display = 'block';
} else {
backToTop.style.display = 'none';
}
});
backToTop.addEventListener('click', () => {
window.scrollTo({ top: 0, behavior: 'smooth' });
});
// 預設為繁體中文與 113年度 第一學期
document.body.lang = "zh-Hant";
updateLanguage("zh-Hant");
</script>
</body>
</html>