-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
43 lines (34 loc) · 1.06 KB
/
script.js
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
import {fetchRepoList} from "./fetch.js";
import {searchRepo} from "./search.js";
fetchRepoList();
jQuery(document).ready(function ($) {
$('meta.theme-color').attr("content","var(--theme-color)")
$(window).scroll(function() {
if ($(this).scrollTop() > 60) {
$('div.header').css("padding","10px");
$('span.header').css("font-size","25px");
$('span.search').css("opacity","1");
}
if ($(this).scrollTop() < 60) {
$('div.header').css("padding","2.5em 0 2em 10px");
$('span.header').css("font-size","40px");
$('span.search').css("opacity","0");
}
})
$('span.header, span.search').on("click", function() {
$('span.header').css("display", "none");
$('#searchBar').css("display", "inline");
$('#searchBar').css("width", "75%");
$('#searchBar').focus();
})
$('#searchBar').on("blur", function() {
$('#searchBar').css("width", "0%");
setTimeout(function() {
$('span.header').css("display", "inline");
$('#searchBar').css("display", "none");
},450);
})
$('input.searchBar').on("keyup", function() {
searchRepo();
})
})