Pokemon Search Tool
3 years ago in HTML
<html>
<style>
input {
height: 100px;
width: 250px;
background-color: rgba(255, 255, 255, 0.2);
color: azure;
font-size: 25px;
text-align: center;
}
table {
margin: auto;
}
body {
background-image: url("https://66.media.tumblr.com/5373ba512f8080d2bcdcafaad581784b/tumblr_oquzk5ejwg1stlfk5o2_500.jpg");
}
</style>
<script>
function pokemonSearch(y, z) {
// y = input ID and z = end search additions.
let input = document.getElementById(y);
let x = document.getElementById(y).value;
// Execute a function when the user releases a key on the keyboard
input.addEventListener("keyup", function(event) {
// Number 13 is the "Enter" key on the keyboard
if (event.keyCode === 13) {
window.open("https://www.google.com/search?q=" + x + " " + z, "null");
setTimeout(self.close(), 5000);
}
});
}
function pokemonSerebii(y) {
// y = input ID and z = end search additions.
let input = document.getElementById(y);
let x = document.getElementById(y).value;
let gen = 'sword and shield';
// Execute a function when the user releases a key on the keyboard
input.addEventListener("keyup", function(event) {
// Number 13 is the "Enter" key on the keyboard
if (event.keyCode === 13) {
window.open("https://www.serebii.net/search.shtml?q=" + x + " " + gen, "null");
setTimeout(self.close(), 5000);
}
});
}
function textBoxWiper(x) {
let y = (document.getElementById(x).value = " ");
}
function loadBoxes(x, y) {
let z = (document.getElementById(x).value = y);
}
</script>
<head>
<title>Pokemon Search Tool</title>
</head>
<body>
<table>
<tr>
<td>
<input type="text" id="serebii" onclick='textBoxWiper("serebii")' onkeypress="pokemonSerebii('serebii')" onblur="loadBoxes('serebii','Search Serebii')" value="Search Serebii" />
</td>
<td>
<input type="text" id="pkmDb" onclick='textBoxWiper("pkmDb")' onkeypress="pokemonSearch('pkmDb','PokemonDB')" onblur="loadBoxes('pkmDb','Search PokemonDB')" value="Search PokemonDB" />
</td>
</tr>
<td>
<input type="text" id="bPda" onclick='textBoxWiper("bPda")' onkeypress="pokemonSearch('bPda','Bulbapedia')" onblur="loadBoxes('bPda','Search Bulbapedia')" value="Search Bulbapedia" />
</td>
<td>
<input type="text" id="pkm" onclick='textBoxWiper("pkm")' onkeypress="pokemonSearch('pkm','Pokemon')" onblur="loadBoxes('pkm','Search Google')" value="Search Google" />
</td>
</tr>
</table>
</body>
</html>