<button class="nav-btn hidden">Filters</button>
<div class="search">
<input autocomplete="off" type="search" id="tagfilter" name="q" value="" autocapitalize="none" required="">
- <svg class="btn" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"/></svg>
+ <svg class="btn" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="white" d="M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"/></svg>
<div id="tags">
</div>
</nav>
-//------------------------------------navbar script------------------------------------
+ //------------------------------------navbar script------------------------------------
var menu = document.getElementsByClassName("accordion");
for (var i = 0; i < menu.length; i++) {
menu[i].addEventListener("click", function() {
}
}
});
+input.addEventListener('keypress', function (e) {
+ enter_search(e, this.value);
+});
//-----------------------------------------------------------------------------------
//------------------------------------Functions--------------------------------------
+function enter_search(e, input){
+ var count = 0;
+ var key = e.which || e.keyCode;
+ if (key === 13 && input.length > 0) {
+ var all_tags = document.getElementById("tags").children;
+ for(i = 0; i < all_tags.length; i++){
+ if (!all_tags[i].classList.contains("hidden")){
+ count++;
+ var tag_name = all_tags[i].innerText;
+ var tag_id = all_tags[i].id;
+ if (count>1){break}
+ }
+ }
+ if (count == 1){
+ filter_maker(tag_name, tag_id);
+ }
+ }
+}
function filter_maker(text, class_value){
var check = filter_checker(text);
var nav_btn = document.getElementsByClassName("nav-btn")[0];
var node = document.createElement("a");
var textnode = document.createTextNode(text);
node.appendChild(textnode);
- node.classList.add(class_value);
+ node.classList.add(class_value);
nav_btn.appendChild(node);
filter_searcher();
}
gallery[i].classList.add("hidden");
}
}
-
- console.log(doujinshi_id)
}
function filter_checker(text){
switch (event.key.toLowerCase()) {\r
// Previous Image\r
case 'w':\r
+ document.getElementById("dest").style.height = "200%";\r
+ document.getElementById("list").style.height = "200%";\r
+ break;\r
case 'a':\r
changePage(currentPage - 1);\r
break;\r
// Next Image\r
case ' ':\r
case 's':\r
+ document.getElementById("dest").style.height = "100%";\r
+ document.getElementById("list").style.height = "100%";\r
+ break;\r
case 'd':\r
changePage(currentPage + 1);\r
break;\r
case 37: //left\r
changePage(currentPage - 1);\r
break;\r
- case 38: //up\r
- changePage(currentPage - 1);\r
- break;\r
case 39: //right\r
changePage(currentPage + 1);\r
break;\r
- case 40: //down\r
- changePage(currentPage + 1);\r
- break;\r
}\r
};
\ No newline at end of file