ebooks.html (2538B)
1 <!DOCTYPE html> 2 <html lang="en"> 3 <head> 4 <meta charset="UTF-8"> 5 <title>Search - Ebooks</title> 6 <meta charset="utf-8"> 7 <meta name="viewport" content="width=device-width, initial-scale=1.0"> 8 <!-- For browsers without prefers-color-scheme, change theme based on time of day --> 9 <script type="text/javascript"> 10 if (window.matchMedia('(prefers-color-scheme: dark)').media === 'not all') { 11 document.documentElement.style.display = 'none'; 12 var hour = new Date().getHours(); 13 var sheet = (hour >= 18 || hour < 7) ? "css/dark.css" : "css/light.css"; 14 document.head.insertAdjacentHTML( 15 'beforeend', 16 '<link rel="stylesheet" type="text/css" href="'+sheet+'" onload="document.documentElement.style.display = \'\'">' 17 ); 18 } 19 </script> 20 <!-- For browsers without JS, load the light theme --> 21 <noscript><link rel="stylesheet" type="text/css" href="css/light.css"></noscript> 22 <!-- For browsers supporting prefers-color-scheme, use that --> 23 <link rel="stylesheet" type="text/css" href="css/dark.css" media="(prefers-color-scheme: dark)"> 24 <link rel="stylesheet" type="text/css" href="css/light.css" media="(prefers-color-scheme: light)"> 25 26 <script> 27 document.addEventListener('DOMContentLoaded', function() { 28 document.getElementById('searchform').onsubmit = function(event) { 29 event.preventDefault(); 30 var searchstring = event.currentTarget[0].value; 31 console.log(event); 32 var engines = [ 33 `https://libgen.rs/search.php?req=${searchstring}`, 34 `https://annas-archive.org/search?q=${searchstring}`, 35 `https://standardebooks.org/ebooks?query=${searchstring}`, 36 ]; 37 for (var i in engines) { 38 window.open(engines[i], "_blank"); 39 } 40 } 41 }) 42 </script> 43 </head> 44 <body> 45 <noscript> 46 <p>This will not work without JS, which is required to open links in new tabs.</p> 47 <div> 48 Searches: 49 50 <ul> 51 <li><a href='https://libgen.rs'>https://libgen.rs</a></li> 52 <li><a href='https://annas-archive.org'>https://annas-archive.org</a></li> 53 <li><a href='https://standardebooks.org'>https://standardebooks.org</a></li> 54 </ul> 55 </div> 56 </noscript> 57 <h1>Search Ebooks</h1> 58 <form id='searchform'> 59 <input id='search' type="text" class="text" value="" name="q" placeholder="Search..." autocomplete="off" tabindex="0"> 60 </form> 61 </body> 62 </html>