forked from nandujkishor/furry-old
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
49 lines (46 loc) · 1.49 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
---
layout: default
title: Flannel
---
<div id="home">
<p>Flannel contains solutions with explanations to selected solved problems. </p>
<div class="goto-q">
<input type="text" placeholder="Codeforces Problem Code (eg.736B)." id="pcode">
<button onclick="gotoprblink(document.getElementById('pcode').value)" id="pclick">Go</button>
</div>
{% assign categories_array = "" | split:"|" %}
{% for page in site.solutions %}
{% for categories in page.categories %}
{% assign categories_array = categories_array | push: categories | uniq %}
{% endfor %}
{% endfor %}
<div class="front-listing">
{% for cat in categories_array %}
<div class="front-listing-sect">
<span class="front-listing-title">{{ cat }}</span>
<ul>
{% for page in site.solutions %}
{% if page.categories contains cat %}
<li><a href="{{ page.url }}">{{ page.title }}</a></li>
{% endif %}
{% endfor %}
</ul>
</div>
{% endfor %}
</div>
</div>
<script>
function gotoprblink(a) {
var slen = a.length;
var qid = a.charAt(a.length - 1);
var linkto = 'codeforces/problemset/problem/' + a.substring(0, a.length - 1) + '/' + a.charAt(a.length - 1).toUpperCase();
console.log(linkto);
window.location = linkto;
}
var pcodein = document.getElementById('pcode');
pcodein.addEventListener("keydown", function (e) {
if (e.keyCode === 13) {
gotoprblink(document.getElementById('pcode').value)
}
});
</script>