diff options
Diffstat (limited to 'assets_src')
-rw-r--r-- | assets_src/css/gril.css | 31 | ||||
-rw-r--r-- | assets_src/css/list.css | 27 | ||||
-rw-r--r-- | assets_src/css/search.css | 20 | ||||
-rw-r--r-- | assets_src/js/list.js | 17 | ||||
-rw-r--r-- | assets_src/js/search.js | 40 |
5 files changed, 135 insertions, 0 deletions
diff --git a/assets_src/css/gril.css b/assets_src/css/gril.css new file mode 100644 index 0000000..b82e2c7 --- /dev/null +++ b/assets_src/css/gril.css | |||
@@ -0,0 +1,31 @@ | |||
1 | #gril-title { | ||
2 | margin-bottom: 0rem; | ||
3 | } | ||
4 | |||
5 | #gril-alias { | ||
6 | margin-top: 0rem; | ||
7 | margin-bottom: 1rem; | ||
8 | } | ||
9 | |||
10 | .gril-tag { | ||
11 | transition: background-color .2s, color .2s; | ||
12 | } | ||
13 | |||
14 | .gril-tag:hover { | ||
15 | background-color: #BA68C8; | ||
16 | color: #FFF; | ||
17 | } | ||
18 | |||
19 | h1 > small { | ||
20 | padding-left: 8px; | ||
21 | font-size: 50%; | ||
22 | } | ||
23 | |||
24 | .card-title.big { | ||
25 | font-size: 36px !important; | ||
26 | } | ||
27 | |||
28 | .card-content.center-big { | ||
29 | padding-top: 9px; | ||
30 | padding-bottom: 9px; | ||
31 | } | ||
diff --git a/assets_src/css/list.css b/assets_src/css/list.css new file mode 100644 index 0000000..7e6dde9 --- /dev/null +++ b/assets_src/css/list.css | |||
@@ -0,0 +1,27 @@ | |||
1 | .jap-name { | ||
2 | color: rgb(166, 166, 166); | ||
3 | } | ||
4 | |||
5 | .list-entry { | ||
6 | height: 80px; | ||
7 | padding: 8px; | ||
8 | } | ||
9 | |||
10 | .list-img { | ||
11 | width: 64px; | ||
12 | height: 64px; | ||
13 | } | ||
14 | |||
15 | .list-controls { | ||
16 | position: relative; | ||
17 | top: 8px; | ||
18 | left: -15px; | ||
19 | } | ||
20 | |||
21 | .gril-img { | ||
22 | background-repeat: no-repeat; | ||
23 | background-position: center center; | ||
24 | background-size: cover; | ||
25 | width: 64px; | ||
26 | height: 64px; | ||
27 | } \ No newline at end of file | ||
diff --git a/assets_src/css/search.css b/assets_src/css/search.css new file mode 100644 index 0000000..124a378 --- /dev/null +++ b/assets_src/css/search.css | |||
@@ -0,0 +1,20 @@ | |||
1 | .collection .collection-item.avatar { | ||
2 | min-height: 64px !important; | ||
3 | } | ||
4 | |||
5 | .collection-item.avatar > .circle { | ||
6 | top: 12px; | ||
7 | } | ||
8 | |||
9 | .search-results { | ||
10 | top: -50px; | ||
11 | z-index: 2; | ||
12 | } | ||
13 | |||
14 | .collection > .collection-item { | ||
15 | transition: background-color .35s; | ||
16 | } | ||
17 | |||
18 | .collection > .collection-item:hover { | ||
19 | background-color: #e1bee7; | ||
20 | } \ No newline at end of file | ||
diff --git a/assets_src/js/list.js b/assets_src/js/list.js new file mode 100644 index 0000000..25ff80d --- /dev/null +++ b/assets_src/js/list.js | |||
@@ -0,0 +1,17 @@ | |||
1 | function clickSearchResult(resId) { | ||
2 | var xhr = new XMLHttpRequest(); | ||
3 | xhr.onreadystatechange = function() { | ||
4 | if (xhr.readyState == XMLHttpRequest.DONE) { | ||
5 | if (xhr.status !== 200) { | ||
6 | alert(xhr.status + ": " + xhr.response); | ||
7 | return; | ||
8 | } | ||
9 | |||
10 | data = xhr.responseText; | ||
11 | document.getElementById("gril-list").innerHTML += data; | ||
12 | } | ||
13 | } | ||
14 | xhr.open('POST', window.location, true); | ||
15 | xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); | ||
16 | xhr.send('id=' + resId); | ||
17 | } \ No newline at end of file | ||
diff --git a/assets_src/js/search.js b/assets_src/js/search.js new file mode 100644 index 0000000..0cb33df --- /dev/null +++ b/assets_src/js/search.js | |||
@@ -0,0 +1,40 @@ | |||
1 | var strokeTimeout = null; | ||
2 | |||
3 | function instantSearch() { | ||
4 | if (strokeTimeout) { | ||
5 | clearTimeout(strokeTimeout); | ||
6 | } | ||
7 | strokeTimeout = setTimeout(doSearch, 150); | ||
8 | } | ||
9 | |||
10 | function doSearch() { | ||
11 | value = document.getElementById("search").value; | ||
12 | |||
13 | if (value === "") { | ||
14 | strokeTimeout = null; | ||
15 | document.getElementById("search-results").innerHTML = ""; | ||
16 | return; | ||
17 | } | ||
18 | var xhr = new XMLHttpRequest(); | ||
19 | xhr.onreadystatechange = function() { | ||
20 | if (xhr.readyState == XMLHttpRequest.DONE) { | ||
21 | if (xhr.status === 404 || xhr.status === 400 || typeof xhr.response === 'undefined' || xhr.response === '404 not found') { | ||
22 | document.getElementById("search-results").innerHTML = ''; | ||
23 | return | ||
24 | } | ||
25 | if (value === "") { | ||
26 | document.getElementById("search-results").innerHTML = ""; | ||
27 | return; | ||
28 | } | ||
29 | |||
30 | document.getElementById("search-results").innerHTML = xhr.response.replace(new RegExp('{ (.*?)(' + value + ')(.*?) }', 'gi'), "$1<b>$2</b>$3").replace(new RegExp('{ (.*?) }', 'gi'), '$1'); | ||
31 | } | ||
32 | } | ||
33 | xhr.open('GET', '/search/gril_instant/' + value, true); | ||
34 | xhr.send(null); | ||
35 | strokeTimeout = null; | ||
36 | } | ||
37 | |||
38 | function clickSearchResult(resId) { | ||
39 | |||
40 | } \ No newline at end of file | ||