forked from mmm25002500/Nutc-class-timetable
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
353 lines (326 loc) · 12.3 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
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
<!DOCTYPE HTML>
<!--
(C) Cutespirit 2022
service@cutespirit.org
Updated on 2022/09/06 for version 2.0
UpdInfo: finish the content
TODO: 手機內容控制(RWD)
-->
<html>
<head>
<title>國立臺中科技大學 課表</title>
<meta charset="utf-8" />
<meta name="description" content="國立臺中科技大學課表,一個更便捷使用的課表,更快速查詢的工具。">
<meta name="keywords" content="中科大,課表,國立臺中科技大學,NUTC,eprotal,中科">
<meta name="author" content="夏特稀">
<meta name="copyright" content="夏特稀">
<meta http-equiv="Content-Language" content="zh-TW">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
<link rel="stylesheet" href="assets/css/main.css" />
<noscript><link rel="stylesheet" href="/assets/css/noscript.css" /></noscript>
<script src="js/vue.global-3.0.2.js"></script>
<script src="js/axios.min-0.21.1.js"></script>
<link rel="stylesheet" href="assets/css/bootstrap-iso.css" />
<!-- <link rel="stylesheet" href="https://formden.com/static/assets/demos/bootstrap-iso/bootstrap-iso/bootstrap-iso.css" /> -->
<!-- Facebook Meta property -->
<meta property="og:title" content="臺中科大課表 - 改編版" />
<meta property="og:description" content="一個比學校課表系統更好的工具" />
<meta property="og:image" content="https://upload.wikimedia.org/wikipedia/zh/7/77/NUTC_logo.gif" />
<style>
sup {
vertical-align: super;
font-size: 20px;
}
</style>
</head>
<body class="is-preload">
<script type="text/javascript">
// var cacheSearch = "<?php echo htmlspecialchars($_GET['search']); ?>";
</script>
<!-- <?php header('Access-Control-Allow-Origin: *'); ?> -->
<!-- Wrapper -->
<div id="app">
<div id="wrapper">
<div class="bootstrap-iso">
</div>
<!-- Header -->
<header id="header">
<h1>臺中科大課表</h1>
<p>打造比學校系統更好用的課表</p>
</header>
<center><h6 style="color:red;">看一下廣告支持一下我拉XD (๑•́ ₃ •̀๑)</h6></center>
<!-- Nav -->
<nav id="nav">
<ul>
<li><a href="#curriculum" class="active">課表</a></li>
<li><a href="#ClassroomInfo">教室資訊</a></li>
<li><a href="#map1">三民校區平面圖</a></li>
<li><a href="#map2">民生校區平面圖</a></li>
<!-- <li><a href="#map2">民生校區平面圖</a></li> -->
</ul>
</nav>
<!-- Main -->
<div id="main">
<!-- {{data}} -->
<!-- Curriculum -->
<input type="text" class="form-control" id="search" placeholder="快速搜尋您的教室吧!" v-model="cacheSearch">
<select name="school" v-if="school_id" v-model="cacheID">
<option value="" disabled>請選擇您的班級</option>
<option v-for="(item, key) in filiterData" :key="key" :value="item.id" > {{item.name}} {{ item.id}} </option>
</select>
<div id="curriculum">
<section style="text-align: center;" v-if="cacheID">
<table class="alt">
<thead>
<tr>
<td v-for="(item,key) in data[0]" :key="key" v-html="item"></td>
</tr>
</thead>
<tbody>
<tr v-for="(item, key) in data.slice(1)" :key="key">
<td style="padding: 0em 0em;" v-for="(item2, key2) in item" :key="key2" v-html="item2"></td>
</tr>
</tbody>
</table>
<p style="color: red;">請注意!教室代碼為 地點(6)、樓層(7)、教室(01),如6701。</p>
</section>
</div>
<section id="ClassroomInfo" class="main inactive">
<table class="alt">
<thead>
<tr>
<td>開頭</td>
<td>位置</td>
<td>校區</td>
</tr>
</thead>
<tbody>
<tr v-for="item in classroom">
<td>{{ item.position }}</td>
<td>{{ item.name }}</td>
<td>{{ item.address }}</td>
</tr>
</tbody>
</table>
</section>
<section id="map1" class="main inactive">
<center>
<img style="width: 100%;" src="https://www.nutc.edu.tw/ezfiles/0/1000/img/11/map-1.jpg" alt="Can not show img">
</center>
</section>
<section id="map2" class="main inactive">
<center>
<img style="width: 100%;" src="https://ga.nutc.edu.tw/ezfiles/77/1077/img/1554/971425825.jpg" alt="Can not show img">
</center>
</section>
</div>
<!-- Footer -->
<footer id="footer">
<section>
<h2>關於作者</h2>
<p>大家好,我是夏特稀,是本專案作者,因為覺得學校的課表系統很難用,因此製作了這個版本,在查學校資料的時候會更加方便,也解決了常常找不到教室的窘境,不僅可以更快速的找到教室,也變得更加方便查詢課表。未來也會增加更多功能。</p>
<ul class="actions">
<li><a target="_blank" href="https://tershi.com/" class="button">夏特稀 個人網站</a></li>
<li><a target="_blank" href="https://github.com/mmm25002500/Nutc-class-timetable" class="button">本開源專案 Github</a></li>
</ul>
</section>
<section>
<h2>聯繫作者</h2>
<dl class="alt">
<dt>MyGamil</dt>
<dd><a href="mailto:marryhan25648@gmail.com">marryhan25648@gmail.com</a></dd>
<dt>MyEmail</dt>
<dd><a href="mailto:admin@tershi.com">admin@tershi.com</a></dd>
有什麼錯誤或是資訊歡迎來信!聯絡夏特稀喔!
</dl>
<ul class="icons">
<!--<li><a target="_blank" href="#" class="icon brands fa-twitter alt"><span class="label">Twitter</span></a></li> -->
<li><a target="_blank" href="https://www.facebook.com/TershiXia/" class="icon brands fa-facebook-f alt"><span class="label">Facebook</span></a></li>
<li><a target="_blank" href="https://www.instagram.com/tershixia/" class="icon brands fa-instagram alt"><span class="label">Instagram</span></a></li>
<li><a target="_blank" href="https://github.com/mmm25002500" class="icon brands fa-github alt"><span class="label">GitHub</span></a></li>
<li><a target="_blank" href="http://youtube.com/%E5%A4%8F%E7%89%B9%E7%A8%80" class="icon brands fa-youtube alt"><span class="label">Dribbble</span></a></li>
</ul>
</section>
<!-- <center>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-2160145108933116" crossorigin="anonymous"></script> -->
<!-- 廣告 -->
<!-- <ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-2160145108933116"
data-ad-slot="2737071950"
data-ad-format="auto"
data-full-width-responsive="true"></ins>
<script>(adsbygoogle = window.adsbygoogle || []).push({});</script>
</center> -->
<p class="copyright">© Cutespirit 2022. <br> © TershiXia 2022. <!--<?php echo date("Y"); ?>. --></p>
</footer>
</div>
</div>
<script>
const App = {
data(){
return{
data: [],
cacheSearch: '',
cacheID: '',
school_id: [],
classroom: [
{
position: 1,
name: '行政大樓',
address: '三民校區'
},
{
position: 2,
name: '資訊館',
address: '三民校區'
},
{
position: 3,
name: '中正大樓',
address: '三民校區'
},
{
position: 4,
name: '昌明樓',
address: '三民校區'
},
{
position: 5,
name: '翰英樓',
address: '三民校區'
},
{
position: 6,
name: '弘業樓',
address: '三民校區'
},
{
position: 7,
name: '中商大樓',
address: '三民校區'
},
{
position: 8,
name: '奇秀樓',
address: '三民校區'
},
{
position: 'T',
name: '誠敬樓',
address: '民生校區'
},
{
position: 'R',
name: '仁愛樓',
address: '民生校區'
},
{
position: 'M',
name: '綜合大樓',
address: '民生校區'
}
]
}
},
methods:{
getClassRoom(){
const url = 'https://api.tershi.com/getClassRoom';
axios.get(url).then((res) => {
this.school_id = res.data;
});
},
getCookie(name) {
// Split cookie string and get all individual name=value pairs in an array
var cookieArr = document.cookie.split(";");
// Loop through the array elements
for(var i = 0; i < cookieArr.length; i++) {
var cookiePair = cookieArr[i].split("=");
/* Removing whitespace at the beginning of the cookie name
and compare it with the given string */
if(name == cookiePair[0].trim()) {
// Decode the cookie value and return
return decodeURIComponent(cookiePair[1]);
}
}
// Return null if not found
return null;
}
},
created(){
// this.cacheSearch = cacheSearch;
this.getClassRoom();
this.cacheID = this.getCookie('id');
},
watch: {
cacheID: function (id){
const url = 'https://api.tershi.com/getTable?id=' + id;
document.cookie = "id=" + id + ';';
axios.get(url).then((res) => {
this.data = res.data;
});
},
cacheSearch: function (text){
var i = 0;
var aTmp = new Array();
var zStr1 = text;
var zStr2 = "";
for(i = 0; i < zStr1.length; i++) {
if(zStr1.charCodeAt(i) >=0 && zStr1.charCodeAt(i) <= 32) {
aTmp[i] = 0; //ascii 小於等於 32的字元,都先清為 null
} else if(zStr1.charCodeAt(i) >=33 && zStr1.charCodeAt(i) <= 126) {
aTmp[i] = zStr1.charCodeAt(i) + 65248; //ascii介於33~126之間的字元,加上65248準備轉為全型unicode
} else {
aTmp[i] = zStr1.charCodeAt(i);
}
zStr2 += String.fromCharCode(aTmp[i]); //轉為全型unicode
}
this.cacheSearch = zStr2; //裝轉換結果回填到原來源字串位置
}
},
computed:{
filiterData(){
return this.school_id.filter((item) => {
// console.log(item);
return item.name.toUpperCase().match(this.cacheSearch.toUpperCase());
});
}
}
};
Vue.createApp(App).mount('#app');
</script>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-2160145108933116" crossorigin="anonymous"></script>
<!-- Messenger 洽談外掛程式 Code Start -->
<div id="fb-root"></div>
<!-- Your 洽談外掛程式 code -->
<div id="fb-customer-chat" class="fb-customerchat">
</div>
<script async>
var chatbox = document.getElementById('fb-customer-chat');
chatbox.setAttribute("page_id", "537822183232239");
chatbox.setAttribute("attribution", "biz_inbox");
window.fbAsyncInit = function() {
FB.init({
xfbml : true,
version : 'v12.0'
});
};
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = 'https://connect.facebook.net/zh_TW/sdk/xfbml.customerchat.js';
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
<!-- Messenger 洽談外掛程式 Code End -->
<!-- Scripts -->
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/jquery.scrollex.min.js"></script>
<script src="assets/js/jquery.scrolly.min.js"></script>
<script src="assets/js/browser.min.js"></script>
<script src="assets/js/breakpoints.min.js"></script>
<script src="assets/js/util.js"></script>
<script src="assets/js/main.js"></script>
</body>
</html>