This repository has been archived by the owner on Nov 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
106 lines (95 loc) · 3.35 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
---
layout: default
scripts: [protip]
---
<div class="index">
<div class="slogan">
<p>由學生建立、為學生設計的非官方師大生存手冊。</p>
<input type="text" class="search_bar" placeholder="搜尋" id="search">
</div>
<div class="news" id="highlight-banner"></div>
<div class="container">
<div id="lists" class="select">
<h2>你想尋求什麼協助?</h2>
<form action="https://iportal.ntnu.edu.tw/login.do" method="post" name="login">
<input name="muid" type="text" />
<input name="mpassword" type="password" />
<input name="inputsubmit1" type="submit" value="登入 iPortal" />
</form>
<form action="https://moodle2.ntnu.edu.tw/login/index.php" method="post" name="login">
<input name="username" type="text" />
<input name="password" type="password" />
<input type="submit" value="登入 Moodle 2" />
</form>
<hr>
{% for order in site.data.order.homepage %}
{% for page in site.references %}
{% assign fname = page.relative_path | replace: '_references/', '' | replace: '.md', '' %}
{% if fname == order %}
<div>
<a href="{{ page.url | prepend: site.baseurl }}">
<img src="{{ site.baseurl }}/images/icons/{{ page.icon }}" alt="{{ page.alticon}} icon" width="50" height="50" />
{{ page.title }}
</a>
</div>
{% endif %}
{% endfor %}
{% endfor %}
<div>
<a href="{{ site.baseurl }}/other.html">
<img src="{{ site.baseurl }}/images/icons/play45.svg" alt="others" width="50" height="50" />
其他文件
</a>
</div>
</div>
</div>
<div class="container">
<div id="favs" class="select">
<h2>常用連結</h2>
<hr>
{% for item in site.data.favs %}
<div>
<a href="{{ item.link }}">
<img src="{{ site.baseurl }}/images/icons/{{ item.image }}" alt="{{ item.name }}的 icon" width="50" height="50" >
{{ item.name }}
</a>
</div>
{% endfor %}
</div>
</div>
</div>
<script src="{{ site.baseurl }}/vendor/fuse.min.js" ></script>
<script type="text/javascript">
$(document).ready(function() {
var colors = ["red", "blue", "purple", "yellow", "green", "orange"];
var squares = $(".select > div");
squares.toArray().forEach( function(div, i, divs) {
do {
div.className = colors[parseInt(Math.random() * 6)];
}
while(i > 0 && div.className === divs[i-1].className)
});
function searchbar_changed() {
var search_str = $('.search_bar').val();
var f = new Fuse(squares.toArray(), {keys: ['innerHTML', 'textContent']});
var result = f.search(search_str);
if(search_str.length === 0)
squares.removeClass('hide');
else {
squares.addClass("hide");
result.forEach( function(div) {
$(div).removeClass("hide");
});
}
}
$("#search").keypress(function(e){
code = (e.keyCode ? e.keyCode : e.which);
if (code == 13)
$("html, body").animate({scrollTop: $(".select").offset().top}, 600);
});
if (/msie/i.test(navigator.userAgent)) //ie
document.getElementById('search').onpropertychange = searchbar_changed;
else
document.getElementById('search').addEventListener("input", searchbar_changed, false);
});
</script>