feat: CTRL + K search, css
This commit is contained in:
@@ -4,7 +4,13 @@ const searchInput = document.getElementById('searchInput');
|
||||
const table = document.getElementById('table');
|
||||
const table_r = Array.from(table.getElementsByTagName('tr'));
|
||||
|
||||
// allow search from url parameter
|
||||
document.addEventListener('keydown', (event)=>{
|
||||
if (event.ctrlKey && event.key === 'k'){
|
||||
event.preventDefault();
|
||||
searchInput.select();
|
||||
}
|
||||
});
|
||||
// search from url parameter
|
||||
let searchParam = params.get('s');
|
||||
if (searchParam){
|
||||
searchInput.value = searchParam;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
}
|
||||
body{
|
||||
margin:40px auto;
|
||||
max-width:650px;
|
||||
max-width:800px;
|
||||
line-height:1.4;
|
||||
font-size:18px;
|
||||
color:var(--fg);
|
||||
@@ -32,7 +32,15 @@ small{
|
||||
color: var(--fg-deemph);
|
||||
}
|
||||
.searchbar{
|
||||
width: fit-content;
|
||||
width: 100%;
|
||||
}
|
||||
#searchInput {
|
||||
width: 100%;
|
||||
padding: .2em;
|
||||
font-size: larger;
|
||||
}
|
||||
th{
|
||||
text-align: left;
|
||||
}
|
||||
tr:nth-child(even){
|
||||
background-color: var(--bg-acc);
|
||||
|
||||
Reference in New Issue
Block a user