20 lines
1.2 KiB
HTML
20 lines
1.2 KiB
HTML
<title>project732</title>
|
|
<meta name='color-scheme' content='dark light'>
|
|
<input id='searchbar' placeholder='search...' type='search' style='width:60%' autofocus onkeydown='(event)=>{}'
|
|
/><input id='username' placeholder='username...' type='text' style='width:20%' onload='document.getElementById("username").value=localStorage.getItem("username")' oninput='localStorage.setItem("username", this.value)'
|
|
/><input id='authkey' placeholder='auth key...' type='password' style='width:20%' onload='document.getElementById("authkey").value=localStorage.getItem("authkey")' oninput='localStorage.setItem("authkey", this.value)'/>
|
|
<script>
|
|
// search function
|
|
function search(searchinput){
|
|
fetch("https://e621.net/posts.json?tags=${searchinput}")
|
|
.then(response=>response.json())
|
|
.then(data=>{if(Array.isArray(data.posts)){
|
|
for(var item of data.posts){
|
|
document.body.innerHTML+='<div><a href="${item.file.url}"><img src="${encodeURIComponent(item.preview.url)}"></a></div>';
|
|
}
|
|
};console.log(data)})
|
|
};
|
|
</script>
|
|
<style>
|
|
*{margin:0;padding:0;font-family:monospace;-ms-overflow-style:none;scrollbar-width:none;scroll-behavior:smooth;border:none;outline:none;background:none}
|
|
::-webkit-scrollbar{display:none} |