This repository has been archived on 2020-10-24. You can view files and clone it, but cannot push or open issues or pull requests.
pokepicker/picker.html

128 lines
7.4 KiB
HTML
Raw Normal View History

2020-04-11 05:58:02 -05:00
<html>
<style>
2020-04-25 01:36:26 -05:00
body {
background-color: black;
color: white;
}
2020-04-11 05:58:02 -05:00
button {
margin-right: 20px;
display: block;
2020-04-25 01:36:26 -05:00
background-color: black;
color: white;
2020-04-11 05:58:02 -05:00
}
tr {
height: 30px;
}
2020-04-25 01:10:55 -05:00
label {
text-align: center;
display: block;
}
textarea {
display: block;
width: 100%;
}
.main {
width:50vw;
padding-top:10vw;
margin:auto;
display:block;
}
.footer {
width:50vw;
position: fixed;
bottom: 5vh;
left: 25vw;
}
2020-04-11 05:58:02 -05:00
</style>
2020-04-25 02:34:45 -05:00
<body onload="get_ignores()">
2020-04-25 01:10:55 -05:00
<div class="main">
<table>
<tr>
2020-04-25 02:10:02 -05:00
<td><button onClick="pickem('0')">Pick a Poke</button></td><td id="0"></td><td><button onClick="ignorem('0')">Mark used</button></td>
2020-04-25 01:10:55 -05:00
</tr>
<tr>
2020-04-25 02:10:02 -05:00
<td><button onClick="pickem('1')">Pick a Poke</button></td><td id="1"></td><td><button onClick="ignorem('1')">Mark used</button></td>
2020-04-25 01:10:55 -05:00
</tr>
<tr>
2020-04-25 02:10:02 -05:00
<td><button onClick="pickem('2')">Pick a Poke</button></td><td id="2"></td><td><button onClick="ignorem('2')">Mark used</button></td>
2020-04-25 01:10:55 -05:00
</tr>
<tr>
2020-04-25 02:10:02 -05:00
<td><button onClick="pickem('3')">Pick a Poke</button></td><td id="3"></td><td><button onClick="ignorem('3')">Mark used</button></td>
2020-04-25 01:10:55 -05:00
</tr>
<tr>
2020-04-25 02:10:02 -05:00
<td><button onClick="pickem('4')">Pick a Poke</button></td><td id="4"></td><td><button onClick="ignorem('4')">Mark used</button></td>
2020-04-25 01:10:55 -05:00
</tr>
<tr>
2020-04-25 02:10:02 -05:00
<td><button onClick="pickem('5')">Pick a Poke</button></td><td id="5"></td><td><button onClick="ignorem('5')">Mark used</button></td>
2020-04-25 01:10:55 -05:00
</tr>
<tr>
2020-04-25 02:10:02 -05:00
<td></td><td><button onClick="reset()">Clear current team</button></td><td><button onClick="ignore_team()">Mark team used</button></td><td></td>
2020-04-25 01:10:55 -05:00
</tr>
</table>
</div>
<div class="footer">
<label>Used Pokes</label>
2020-04-25 02:00:35 -05:00
<textarea id="ignored_pkmn" onblur="get_ignores()"></textarea>
2020-04-25 01:10:55 -05:00
<button style="display:block; margin:auto;" onClick="copy_used()">Copy Used Pokes</button>
</div>
</body>
2020-04-11 05:58:02 -05:00
<script>
var pkmn=['Abra', 'Aerodactyl', 'Aipom', 'Alakazam', 'Ampharos', 'Arbok', 'Arcanine', 'Ariados', 'Articuno', 'Azumarill', 'Bayleef', 'Beedrill', 'Bellossom', 'Bellsprout', 'Blastoise', 'Blissey', 'Bulbasaur', 'Butterfree', 'Caterpie', 'Chansey', 'Charizard', 'Charmander', 'Charmeleon', 'Chikorita', 'Chinchou', 'Clefable', 'Clefairy', 'Cleffa', 'Cloyster', 'Corsola', 'Crobat', 'Croconaw', 'Cubone', 'Cyndaquil', 'Delibird', 'Dewgong', 'Diglett', 'Ditto', 'Dodrio', 'Doduo', 'Donphan', 'Dragonair', 'Dragonite', 'Dratini', 'Drowzee', 'Dugtrio', 'Dunsparce', 'Eevee', 'Ekans', 'Electabuzz', 'Electrode', 'Elekid', 'Entei', 'Espeon', 'Exeggcute', 'Exeggutor', "Farfetch'd", 'Fearow', 'Feraligatr', 'Flaaffy', 'Flareon', 'Forretress', 'Furret', 'Gastly', 'Gengar', 'Geodude', 'Girafarig', 'Gligar', 'Gloom', 'Golbat', 'Goldeen', 'Golduck', 'Golem', 'Granbull', 'Graveler', 'Grimer', 'Growlithe', 'Gyarados', 'Haunter', 'Heracross', 'Hitmonchan', 'Hitmonlee', 'Hitmontop', 'Ho-Oh', 'Hoothoot', 'Hoppip', 'Horsea', 'Houndoom', 'Houndour', 'Hypno', 'Igglybuff', 'Ivysaur', 'Jigglypuff', 'Jolteon', 'Jumpluff', 'Jynx', 'Kabuto', 'Kabutops', 'Kadabra', 'Kakuna', 'Kangaskhan', 'Kingdra', 'Kingler', 'Koffing', 'Krabby', 'Lanturn', 'Lapras', 'Larvitar', 'Ledian', 'Ledyba', 'Lickitung', 'Machamp', 'Machoke', 'Machop', 'Magby', 'Magcargo', 'Magikarp', 'Magmar', 'Magnemite', 'Magneton', 'Mankey', 'Mantine', 'Mareep', 'Marill', 'Marowak', 'Meganium', 'Meowth', 'Metapod', 'Miltank', 'Misdreavus', 'Moltres', 'Mr. Mime', 'Muk', 'Murkrow', 'Natu', 'Nidoking', 'Nidoqueen', 'Nidoran-F', 'Nidoran-M', 'Nidorina', 'Nidorino', 'Ninetales', 'Noctowl', 'Octillery', 'Oddish', 'Omanyte', 'Omastar', 'Onix', 'Paras', 'Parasect', 'Persian', 'Phanpy', 'Pichu', 'Pidgeot', 'Pidgeotto', 'Pidgey', 'Pikachu', 'Piloswine', 'Pineco', 'Pinsir', 'Politoed', 'Poliwag', 'Poliwhirl', 'Poliwrath', 'Ponyta', 'Porygon', 'Porygon2', 'Primeape', 'Psyduck', 'Pupitar', 'Quagsire', 'Quilava', 'Qwilfish', 'Raichu', 'Raikou', 'Rapidash', 'Raticate', 'Rattata', 'Remoraid', 'Rhydon', 'Rhyhorn', 'Sandshrew', 'Sandslash', 'Scizor', 'Scyther', 'Seadra', 'Seaking', 'Seel', 'Sentret', 'Shellder', 'Shuckle', 'Skarmory', 'Skiploom', 'Slowbro', 'Slowking', 'Slowpoke', 'Slugma', 'Smeargle', 'Smoochum', 'Sneasel', 'Snorlax', 'Snubbull', 'Spearow', 'Spinarak', 'Squirtle', 'Stantler', 'Starmie', 'Staryu', 'Steelix', 'Sudowoodo', 'Suicune', 'Sunflora', 'Sunkern', 'Swinub', 'Tangela', 'Tauros', 'Teddiursa', 'Tentacool', 'Tentacruel', 'Togepi', 'Togetic', 'Totodile', 'Typhlosion', 'Tyranitar', 'Tyrogue', 'Umbreon', 'Unown', 'Ursaring', 'Vaporeon', 'Venomoth', 'Venonat', 'Venusaur', 'Victreebel', 'Vileplume', 'Voltorb', 'Vulpix', 'Wartortle', 'Weedle', 'Weepinbell', 'Weezing', 'Wigglytuff', 'Wobbuffet', 'Wooper', 'Xatu', 'Yanma', 'Zapdos', 'Zubat'];
2020-04-25 01:10:55 -05:00
var ignored_pkmn=[];
2020-04-25 02:34:45 -05:00
var picked = [null, null, null, null, null, null];
2020-04-25 01:10:55 -05:00
function get_ignores () {
var ignores = document.getElementById("ignored_pkmn").value;
2020-04-25 01:50:29 -05:00
ignored_pkmn = ignores.split("\n").filter(line => line !== "").sort();
2020-04-25 01:10:55 -05:00
}
2020-04-11 05:58:02 -05:00
function pickem (id) {
2020-04-25 02:34:45 -05:00
var available = pkmn.filter(i => !ignored_pkmn.includes(i) & !picked.includes(i));
2020-04-25 01:10:55 -05:00
var ix = Math.floor(Math.random()*available.length);
var elem = document.getElementById(id);
elem.innerHTML = available[ix];
2020-04-25 02:34:45 -05:00
picked[Number(id)] = available[ix]
2020-04-25 01:36:26 -05:00
elem.style.color = "white";
2020-04-11 05:58:02 -05:00
}
2020-04-25 01:10:55 -05:00
function ignorem (id) {
var elem = document.getElementById(id);
var to_ignore = elem.innerHTML;
if (!ignored_pkmn.includes(to_ignore)) {
ignored_pkmn[ignored_pkmn.length] = to_ignore;
ignored_pkmn.sort();
document.getElementById("ignored_pkmn").value = ignored_pkmn.join("\n");
elem.style.color = "red";
}
}
function ignore_team () {
2020-04-11 05:58:02 -05:00
for (i=0; i<6; i++) {
2020-04-25 01:10:55 -05:00
var elem = document.getElementById(i.toString());
var to_ignore = elem.innerHTML;
2020-04-11 05:58:02 -05:00
document.getElementById(i.toString()).innerHTML = "";
2020-04-25 01:10:55 -05:00
if (!ignored_pkmn.includes(to_ignore)) {
ignored_pkmn[ignored_pkmn.length] = to_ignore;
}
2020-04-25 01:36:26 -05:00
elem.style.color = "white";
2020-04-25 01:10:55 -05:00
}
ignored_pkmn.sort();
document.getElementById("ignored_pkmn").value = ignored_pkmn.join("\n");
}
function reset () {
for (i=0; i<6; i++) {
var elem = document.getElementById(i.toString());
elem.innerHTML = "";
2020-04-25 02:34:45 -05:00
picked[i] = null;
2020-04-25 01:36:26 -05:00
elem.style.color = "white";
2020-04-11 05:58:02 -05:00
}
}
2020-04-25 01:10:55 -05:00
function copy_used() {
document.getElementById("ignored_pkmn").select();
document.execCommand("copy");
}
2020-04-11 05:58:02 -05:00
</script>
</html>