Compare commits
29 Commits
37612ee218
...
master
Author | SHA1 | Date | |
---|---|---|---|
06f0835353 | |||
fe4dd38656 | |||
b6393beaee | |||
9429626a25 | |||
8afa5684cf | |||
cba1c7c3ef | |||
670b33850f | |||
a4b32ca3ae | |||
38bdaf397b | |||
9992e7cc28 | |||
4ab3df9b81 | |||
bd413faf9f | |||
ae165903bd | |||
36dc9b5923 | |||
09bbf223c3 | |||
c3f84ab2ab | |||
109334f441 | |||
5ec2590920 | |||
68d555c676 | |||
9edf9e135d | |||
3bde0a4a4f | |||
caab9fe47d | |||
074726aea4 | |||
396681cfb0 | |||
14e784f821 | |||
0b19f84814 | |||
18c80456c4 | |||
8eeb0dee35 | |||
19aa6b70b3 |
2
.gitmodules
vendored
@ -1,3 +1,3 @@
|
|||||||
[submodule "pokemon"]
|
[submodule "pokemon"]
|
||||||
path = pokemon
|
path = pokemon
|
||||||
url = https://git.n700.ovh/keb/poketest-pokemon.git
|
url = https://git.marchal.dev/keb/poketest-pokemon.git
|
||||||
|
16
README.md
@ -2,28 +2,30 @@
|
|||||||
|
|
||||||
### About
|
### About
|
||||||
|
|
||||||
Around 2012, when I was still a computer science student, I found increasingly difficult the remember the name of all Pokémons. So I decided, as a way to be familiar with JavaScript (even though I've never touched it again after that) to program this little website: <u>Pokétest</u>, an interactive browser game, where you have to find the name of Pokémons in a limited time ; and <u>Flashdex</u>, which is a simple Pokédex with high resolution images.
|
Around 2012, when I was still a computer science student, I found increasingly difficult the remember the name of all Pokémons. So I decided, as a way to be familiar with JavaScript (even though I've never touched it again after that) to program this little website: <u>Pokétest</u>, an interactive browser game, where you have to find the name of Pokémons in a limited time; and <u>Flashdex</u>, which is a simple Pokédex with high resolution images.
|
||||||
|
|
||||||
Now that there are now more than 900 of them, and it's as useful as ever! The website features filters for all generations, eight languages settings (English, French, Deutsch, Korean, Japanese, Rōmaji, Traditional and Simplified Chinese) and four combinables modes (image visible or as a silhouette ; configurable number of questions or infinite). It can be played with the mouse or the keyboard (input 1, 2, 3, 4).
|
Now that there are now more than a thousand of them, and it's as useful as ever! The website features filters for all generations, eight languages settings (English, French, Deutsch, Korean, Japanese, Rōmaji, Traditional and Simplified Chinese) and four combinables modes (image visible or as a silhouette; configurable number of questions or infinite). It can be played with the mouse or the keyboard (input 1, 2, 3, 4).
|
||||||
|
|
||||||
### Planned updates
|
### Planned updates
|
||||||
|
|
||||||
- Multiple forms visible in Flashdex
|
- Make answer choices closer by type
|
||||||
- Custom input answers for harder difficulty
|
|
||||||
- Pokémon type support
|
|
||||||
- Type weakness calculator
|
- Type weakness calculator
|
||||||
|
|
||||||
### Scripts
|
### Scripts
|
||||||
|
|
||||||
**imagemagick** can be extremely useful to work with batch of images. This script allows to resize a batch of PNG images to a max width of 700px, without altering the height while keeping the ratio:
|
**imagemagick** can be extremely useful to work with batch of images. This script allows to resize a batch of PNG images to a max width of 700px, without altering the height while keeping the ratio:
|
||||||
|
|
||||||
`mogrify '*.png[x700>]'`
|
`magick mogrify '*.png[x700>]'`
|
||||||
|
|
||||||
|
And this one allows to resize to 700x700px, but putting the image at the center if it is smaller than that.
|
||||||
|
|
||||||
|
`magick mogrify -resize 700x700 -background transparent -gravity center -extent 700x700 *.png`
|
||||||
|
|
||||||
### Licenses
|
### Licenses
|
||||||
|
|
||||||
This website has been developed in <strong>JavaScript</strong> using the <strong>jQuery</strong> library. It uses the <a href="https://github.com/alexanderdickson/waitForImages">waitForImages plugin</a>. All of those components are licensed under the MIT license, as is this website's source code. This website is <strong>HTML5</strong> and <strong>CSS3</strong> compliant.
|
This website has been developed in <strong>JavaScript</strong> using the <strong>jQuery</strong> library. It uses the <a href="https://github.com/alexanderdickson/waitForImages">waitForImages plugin</a>. All of those components are licensed under the MIT license, as is this website's source code. This website is <strong>HTML5</strong> and <strong>CSS3</strong> compliant.
|
||||||
|
|
||||||
The Pokémon names, the associated artworks and the Pokémon licence is trademarked by <strong>Nintendo</strong> and <strong>The Pokémon Company</strong>, 1996 - 2022.
|
The Pokémon names, the associated artworks and the Pokémon licence is trademarked by <strong>Nintendo</strong> and <strong>The Pokémon Company</strong>, 1996 - 2025.
|
||||||
|
|
||||||
All the Pokémon artworks were taken from <a href="https://bulbapedia.bulbagarden.net/wiki/Main_Page">Bulbapedia</a>, that I'd like to thank for their huge work for the Pokémon community.
|
All the Pokémon artworks were taken from <a href="https://bulbapedia.bulbagarden.net/wiki/Main_Page">Bulbapedia</a>, that I'd like to thank for their huge work for the Pokémon community.
|
||||||
|
|
||||||
|
82
about.html
@ -7,10 +7,10 @@
|
|||||||
<link rel="stylesheet" type="text/css" href="normalize-8.0.1.css" id="stylesheet">
|
<link rel="stylesheet" type="text/css" href="normalize-8.0.1.css" id="stylesheet">
|
||||||
<link rel="stylesheet" type="text/css" href="style.css" id="stylesheet">
|
<link rel="stylesheet" type="text/css" href="style.css" id="stylesheet">
|
||||||
<link rel="shortcut icon" type="image/png" href="img/favicon.png" />
|
<link rel="shortcut icon" type="image/png" href="img/favicon.png" />
|
||||||
<script src="jquery-3.6.0.min.js"></script>
|
<script src="jquery-3.7.1.min.js"></script>
|
||||||
<script src="interface.js"></script>
|
<script src="interface.js"></script>
|
||||||
<script src="poketest.js"></script>
|
<script src="poketest.js"></script>
|
||||||
<title>Pokétest</title>
|
<title>Pokétest - About</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="bg"></div>
|
<div class="bg"></div>
|
||||||
@ -32,54 +32,58 @@
|
|||||||
<img src="pokemon/877-0.png" class="top-companion" alt="morpeko" />
|
<img src="pokemon/877-0.png" class="top-companion" alt="morpeko" />
|
||||||
<h1>About</h1>
|
<h1>About</h1>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="#1">Who are you?</a></li>
|
<li><a href="#1">How to play: Pokétest</a></li>
|
||||||
<li><a href="#2">What is this website made with?</a></li>
|
<li><a href="#2">How to use: Flashdex</a></li>
|
||||||
<li><a href="#3">Can I use my keyboard to play?</a></li>
|
<li><a href="#3">Website informations</a></li>
|
||||||
<li><a href="#4">What is the «Infinite» option in the number of questions exactly?</a></li>
|
<li><a href="#4">Copyrights</a></li>
|
||||||
<li><a href="#5">This website doesn't work well on my browser.</a></li>
|
|
||||||
<li><a href="#6">Can you add more languages?</a></li>
|
|
||||||
<li><a href="#7">Can you add this feature?</a></li>
|
|
||||||
<li><a href="#8">Copyrights</a></li>
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h3 id="1">Who are you?</h3>
|
<h3 id="1">How to play: Pokétest</h3>
|
||||||
<p>Hi! My name is <a href="https://theo.marchal.dev/">Théo</a> and I'm a game developer. I love Pokémon, but it has been getting hard to remember all those names, even though I always complete the Pokédex in my games!</p>
|
<p>The Pokétest is a game where you have to guess the name of the Pokémon appearing. The following options are available:</p>
|
||||||
|
<ul>
|
||||||
<h3 id="2">What is this website made with?</h3>
|
<li><strong>Generations</strong>: you can filter the Pokémon generations that you want. Either all of them, or what you choose, including options for regional forms, mega-evolutions and gigantamax forms.</li>
|
||||||
|
<li><strong>Language</strong>: all the languages available in the main games are present. Choose the one you're familiar with or want to learn! Please note that in certain country, the Pokémon names are the english ones.</li>
|
||||||
|
<li><strong>Answer type</strong>: "choice" makes you choose between 4 propositions ; "input" makes you type the exact name, for a harder difficulty!</li>
|
||||||
|
<li><strong>Silhouette</strong>: "silhouette" only allows you the see the shape, "full art" allows you to see the whole artwork.</li>
|
||||||
|
<li><strong>Number of questions</strong>: a number to choose between 15, 30, 50, 100, Infinite or Whole Set. In the case of Infinite, the game ends when you have made 5 bad answers.</li>
|
||||||
|
<li><strong>Time to answer</strong>: the timer, to choose between 2, 5, 10, 30 and 99 seconds. You can also deactivate it.</li>
|
||||||
|
</ul>
|
||||||
|
<p>Note: if the answer type is "Choice", you can use the "1", "2", "3" or "4" keys to answer. You can also use the "Enter" key to launch the game.</p>
|
||||||
|
|
||||||
|
<h3 id="2">How to use: Flashdex</h3>
|
||||||
|
<p>The Flashdex is a very simple Pokédex, useful to see the Pokémons in a good resolution. It is filtered by generation and alternate forms. You can chose the language in which it is displayed.</p>
|
||||||
|
<p>When a deck is generated, the URL is changed with the parameters that were selected. This way, you can easily share it to whoever you want.</p>
|
||||||
|
<p>Types are displayed in the top-left corner, and generations on the top-right corner. If there are different artworks available for the Pokémon, arrows are displayed on the bottom-left corner. You can use them to switch between artworks. Please note that those are not always alternate forms, they are alternate artworks. For example:</p>
|
||||||
|
<ul>
|
||||||
|
<li>The first generation has at least three artworks available by Pokémon.</li>
|
||||||
|
<li>The starters of the third and fourth generations have two official artworks.</li>
|
||||||
|
<li>A Pokémon like Pikachu (#25) has 17 official artworks, some of them are different forms available ingame.</li>
|
||||||
|
<li>Castform (#351) or Rotom (#479), for example, have different forms with different types associated.</li>
|
||||||
|
<li>A unique case is Beldum (#374) which has an artwork for its shiny form.</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h3 id="3">Website informations</h3>
|
||||||
<p>
|
<p>
|
||||||
This website has been developed in <strong>JavaScript</strong> using the <strong>jQuery</strong> library.<br />
|
This website is <strong>HTML5</strong> and <strong>CSS3</strong> compliant.<br />
|
||||||
It uses the <a href="https://github.com/alexanderdickson/waitForImages">waitForImages plugin</a>.<br />
|
It has been developed in <strong>JavaScript</strong> using the <strong>jQuery</strong> library.<br />
|
||||||
|
It uses the <a href="https://github.com/alexanderdickson/waitForImages">waitForImages plugin</a>.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
All of those components are licensed under the MIT license, as is the website source code, which is <a href="https://git.n700.ovh/keb/poketest">available here</a>.<br />
|
All of those components are licensed under the MIT license, as is the website source code, which is <a href="https://git.marchal.dev/keb/poketest">available here</a>.<br />
|
||||||
This website is <strong>HTML5</strong> and <strong>CSS3</strong> compliant.
|
If you found a bug or want to add a feature, you can always contact me or make a pull request.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
This website has been developed by <a href="https://theo.marchal.dev/">Théo</a>, a game developer having trouble to remember the name of all those monsters.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h3 id="3">Can I use my keyboard to play?</h3>
|
|
||||||
<p>Yes! You can launch the game with "Enter", then press "1", "2", "3" or "4" to answer.</p>
|
|
||||||
|
|
||||||
<h3 id="4">What is the «Infinite» option in the number of questions exactly?</h3>
|
<h3 id="4">Copyrights</h3>
|
||||||
<p>When playing with the Infinite option, the game ends when you have 5 bad answers on all the set.</p>
|
<p>The Pokémon names, the associated artworks and the Pokémon licence is trademarked by <strong>Nintendo</strong> and <strong>The Pokémon Company</strong>, 1996 - 2025.</p>
|
||||||
|
<p>All the Pokémon artworks were taken from <a href="https://bulbapedia.bulbagarden.net/wiki/Main_Page">Bulbapedia</a>, that I'd like to thank for their huge work for the Pokémon community.</p>
|
||||||
<img src="pokemon/60RB.png" class="middle-companion" alt="poliwag" />
|
|
||||||
|
|
||||||
<h3 id="5">This website doesn't work well on my browser.</h3>
|
|
||||||
<p>Please contact me or make a pull request!</p>
|
|
||||||
|
|
||||||
<h3 id="6">Can you add more languages?</h3>
|
|
||||||
<p>The game currently supports all of the languages available in the main games. If your language is not on the list, it probably uses the English names! I will not support other languages by myself, but you can always contribute by making a pull request!</p>
|
|
||||||
|
|
||||||
<h3 id="7">Can you add this feature?</h3>
|
|
||||||
<p>Please contact me or make a pull request!</p>
|
|
||||||
|
|
||||||
<h3 id="8">Copyrights</h3>
|
|
||||||
<p>The Pokémon names, the associated artworks and the Pokémon licence is trademarked by <strong>Nintendo</strong> and <strong>The Pokémon Company</strong>, 1996 - 2022.<br />
|
|
||||||
All the Pokémon artworks were taken from <a href="https://bulbapedia.bulbagarden.net/wiki/Main_Page">Bulbapedia</a>, that I'd like to thank for their huge work for the Pokémon community.</p>
|
|
||||||
</div>
|
</div>
|
||||||
</article>
|
</article>
|
||||||
</div>
|
</div>
|
||||||
<footer>
|
<footer>
|
||||||
<p>© 2012 - 2022 Pokétest 2.7</p>
|
<p>© 2012 - 2025 Pokétest 2.10</p>
|
||||||
</footer>
|
</footer>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
Before Width: | Height: | Size: 334 KiB After Width: | Height: | Size: 334 KiB |
Before Width: | Height: | Size: 800 KiB After Width: | Height: | Size: 761 KiB |
BIN
artwork/artwork11.jpg
Normal file
After Width: | Height: | Size: 820 KiB |
BIN
artwork/artwork12.jpg
Normal file
After Width: | Height: | Size: 730 KiB |
Before Width: | Height: | Size: 302 KiB After Width: | Height: | Size: 302 KiB |
Before Width: | Height: | Size: 240 KiB After Width: | Height: | Size: 240 KiB |
Before Width: | Height: | Size: 185 KiB After Width: | Height: | Size: 185 KiB |
Before Width: | Height: | Size: 332 KiB After Width: | Height: | Size: 332 KiB |
Before Width: | Height: | Size: 416 KiB After Width: | Height: | Size: 416 KiB |
Before Width: | Height: | Size: 462 KiB After Width: | Height: | Size: 462 KiB |
Before Width: | Height: | Size: 474 KiB After Width: | Height: | Size: 474 KiB |
Before Width: | Height: | Size: 422 KiB After Width: | Height: | Size: 408 KiB |
@ -7,11 +7,11 @@
|
|||||||
<link rel="stylesheet" type="text/css" href="normalize-8.0.1.css" id="stylesheet">
|
<link rel="stylesheet" type="text/css" href="normalize-8.0.1.css" id="stylesheet">
|
||||||
<link rel="stylesheet" type="text/css" href="style.css" id="stylesheet">
|
<link rel="stylesheet" type="text/css" href="style.css" id="stylesheet">
|
||||||
<link rel="shortcut icon" type="image/png" href="img/favicon.png" />
|
<link rel="shortcut icon" type="image/png" href="img/favicon.png" />
|
||||||
<script src="jquery-3.6.0.min.js"></script>
|
<script src="jquery-3.7.1.min.js"></script>
|
||||||
<script src="waitforimages-2.4.0.min.js"></script>
|
<script src="waitforimages-2.4.0.min.js"></script>
|
||||||
<script src="interface.js"></script>
|
<script src="interface.js"></script>
|
||||||
<script src="flashdex.js"></script>
|
<script src="flashdex.js"></script>
|
||||||
<title>Pokétest</title>
|
<title>Pokétest - Flashdex</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="bg"></div>
|
<div class="bg"></div>
|
||||||
@ -31,13 +31,15 @@
|
|||||||
<article>
|
<article>
|
||||||
<div id="container">
|
<div id="container">
|
||||||
<div id="game">
|
<div id="game">
|
||||||
<img src="pokemon/R79-99.png" alt="slowbro" class="flashdex-companion" />
|
<img src="pokemon/963-999.png" alt="finizen" class="flashdex-companion" />
|
||||||
|
|
||||||
<h1>Flashdex</h1>
|
<h1>Flashdex</h1>
|
||||||
|
|
||||||
<p>✨ <strong>Now including the first monsters from Pokémon Scarlet & Violet!</strong></p>
|
<p>✨ <strong>Now updated for Pokémon Scarlet and Violet DLC: The Hidden Treasure of Area Zero!</strong></p>
|
||||||
|
|
||||||
<p>The Flashdex is a very simple Pokédex, useful to see your favorite creatures in good resolution. Perfect for learning new names, and to see the different generations and different Pokémon forms!</p>
|
<p>The Flashdex is a very simple Pokédex, useful to see your favorite creatures in good resolution. Perfect for learning new names, and to see the different generations and Pokémon forms! It also includes the monster's type.</p>
|
||||||
|
|
||||||
|
<p>For more details, please read the <a href="about.html">About page</a>!</p>
|
||||||
|
|
||||||
<div id="flashdex_config">
|
<div id="flashdex_config">
|
||||||
<h2><a href="#" class="all unselected"><strong>Select all</strong></a></h2>
|
<h2><a href="#" class="all unselected"><strong>Select all</strong></a></h2>
|
||||||
@ -85,7 +87,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</article>
|
</article>
|
||||||
<footer>
|
<footer>
|
||||||
<p>© 2012 - 2022 Pokétest 2.7</p>
|
<p>© 2012 - 2025 Pokétest 2.10</p>
|
||||||
</footer>
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
270
flashdex.js
@ -1,5 +1,5 @@
|
|||||||
$(document).ready(function() {
|
$(document).ready(function()
|
||||||
|
{
|
||||||
/****** Generations ******/
|
/****** Generations ******/
|
||||||
var G1 = [1, 151];
|
var G1 = [1, 151];
|
||||||
var G2 = [152, 251];
|
var G2 = [152, 251];
|
||||||
@ -9,24 +9,26 @@ $(document).ready(function() {
|
|||||||
var G6 = [650, 721];
|
var G6 = [650, 721];
|
||||||
var G7 = [722, 809];
|
var G7 = [722, 809];
|
||||||
var G8 = [810, 905];
|
var G8 = [810, 905];
|
||||||
var G9 = [906, 908];
|
var G9 = [906, 1025];
|
||||||
var MEGA = [909, 958];
|
var MEGA = [1026, 1075];
|
||||||
var GIGA = [959, 990];
|
var GIGA = [1076, 1107];
|
||||||
var REG = [991, 1043];
|
var REG = [1108, 1162];
|
||||||
|
var gen_number = 9;
|
||||||
|
var extra_number = 3; // mega, giga, reg
|
||||||
|
|
||||||
/************ GAME *************/
|
/************ GAME *************/
|
||||||
/*******************************/
|
/*******************************/
|
||||||
|
|
||||||
// loading json file
|
// loading json file
|
||||||
var json = $.getJSON('pokemon.json', function(pk) {
|
$.getJSON('pokemon.json', function(pk)
|
||||||
|
{
|
||||||
$('article #container #game #loading').hide();
|
$('article #container #game #loading').hide();
|
||||||
var pklist = pk;
|
var pklist = pk;
|
||||||
|
|
||||||
$('article #container #flashdex_config .all').click(function() {
|
$('article #container #flashdex_config .all').click(function()
|
||||||
|
{
|
||||||
if ($(this).hasClass("unselected")) {
|
if ($(this).hasClass("unselected"))
|
||||||
|
{
|
||||||
for (i = 1; i < 10; ++i)
|
for (i = 1; i < 10; ++i)
|
||||||
$('input[name="'+i+'g"]').prop('checked', true);
|
$('input[name="'+i+'g"]').prop('checked', true);
|
||||||
$('input[name="mega"]').prop('checked', true);
|
$('input[name="mega"]').prop('checked', true);
|
||||||
@ -34,7 +36,9 @@ $(document).ready(function() {
|
|||||||
$('input[name="gigantamax"]').prop('checked', true);
|
$('input[name="gigantamax"]').prop('checked', true);
|
||||||
$(this).removeClass("unselected").addClass("selected");
|
$(this).removeClass("unselected").addClass("selected");
|
||||||
$(this).text("Unselect all");
|
$(this).text("Unselect all");
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
for (i = 1; i < 10; ++i)
|
for (i = 1; i < 10; ++i)
|
||||||
$('input[name="'+i+'g"]').prop('checked', false);
|
$('input[name="'+i+'g"]').prop('checked', false);
|
||||||
$('input[name="mega"]').prop('checked', false);
|
$('input[name="mega"]').prop('checked', false);
|
||||||
@ -45,21 +49,38 @@ $(document).ready(function() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
// start the game when clicking on start game
|
$('article #container .button input.start').click(function()
|
||||||
$('article #container .button input.start').click(function() {
|
{
|
||||||
|
|
||||||
$('article #container #game #loading').show();
|
|
||||||
$('article #container #game #flashdex').empty();
|
|
||||||
|
|
||||||
var lang = $('article select.lang option:selected').attr('id');
|
var lang = $('article select.lang option:selected').attr('id');
|
||||||
var gen_list = new Array();
|
var gen_list = new Array();
|
||||||
var pokemon_generation_list = new Array();
|
var pokemon_generation_list = new Array();
|
||||||
|
|
||||||
generations();
|
generations();
|
||||||
|
|
||||||
$('article #container #game #flashdex').hide();
|
if (gen_list.length == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
function getFormText(pkmn) {
|
setUrlSearch();
|
||||||
|
|
||||||
|
$('article #container #game #loading').show();
|
||||||
|
$('article #container #game #flashdex').empty().hide();
|
||||||
|
|
||||||
|
function setUrlSearch()
|
||||||
|
{
|
||||||
|
gen = '';
|
||||||
|
if (gen_list.length < (gen_number + extra_number))
|
||||||
|
{
|
||||||
|
for (i in gen_list)
|
||||||
|
gen += gen_list[i].substring(0,1);
|
||||||
|
}
|
||||||
|
else gen += "all";
|
||||||
|
|
||||||
|
window.history.replaceState(null, null, "?gen=" + gen + "&lang=" + lang);
|
||||||
|
localStorage.setItem('lang', lang);
|
||||||
|
}
|
||||||
|
|
||||||
|
function getFormText(pkmn)
|
||||||
|
{
|
||||||
if (pkmn["origin"] == "Kanto")
|
if (pkmn["origin"] == "Kanto")
|
||||||
return '<span class="form RB"></span>'
|
return '<span class="form RB"></span>'
|
||||||
else if (pkmn["origin"] == "Johto")
|
else if (pkmn["origin"] == "Johto")
|
||||||
@ -78,57 +99,191 @@ $(document).ready(function() {
|
|||||||
return '<span class="form SWSH"></span>'
|
return '<span class="form SWSH"></span>'
|
||||||
else if (pkmn["origin"] == "Hisui")
|
else if (pkmn["origin"] == "Hisui")
|
||||||
return '<span class="form LA"></span>'
|
return '<span class="form LA"></span>'
|
||||||
else if (pkmn["origin"] == "9G")
|
else if (pkmn["origin"] == "Paldea")
|
||||||
return '<span class="form SV"></span>'
|
return '<span class="form SV"></span>'
|
||||||
else if (pkmn["type"] == "mega")
|
else if (pkmn["form"] == "mega")
|
||||||
return '<span class="form mega"></span>';
|
return '<span class="form mega"></span>';
|
||||||
else if (pkmn["type"] == "giga")
|
else if (pkmn["form"] == "giga")
|
||||||
return '<span class="form giga"></span>';
|
return '<span class="form giga"></span>';
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
function getFormattedNumber(num) {
|
function getFormattedNumber(num)
|
||||||
|
{
|
||||||
if (num[0] == 'M' || num[0] == 'R' || num[0] == 'G')
|
if (num[0] == 'M' || num[0] == 'R' || num[0] == 'G')
|
||||||
return num.substring(1, num.length);
|
return num.substring(1, num.length);
|
||||||
return num;
|
return num;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i in pokemon_generation_list) {
|
function getFormattedTypes(num) {
|
||||||
|
str = '<span class="types"><span class="'+num["type"][0]+'">'+num["type"][0]+'</span>';
|
||||||
|
if (num["type"][1])
|
||||||
|
str += '<span class="'+num["type"][1]+'">'+num["type"][1]+'</span>';
|
||||||
|
str += '</span>';
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getFormattedTypes(num, index)
|
||||||
|
{
|
||||||
|
str = '<span class="'+num["type"+index][0]+'">'+num["type"+index][0]+'</span>';
|
||||||
|
if (num["type"+index][1])
|
||||||
|
str += '<span class="'+num["type"+index][1]+'">'+num["type"+index][1]+'</span>';
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getFormattedSpriteButton(num)
|
||||||
|
{
|
||||||
|
if (num["sprite"] || num["origin"] == "Kanto")
|
||||||
|
return '<span class="button"><span class="left-arrow">◀︎</span><span class="right-arrow">▶︎</span></span>';
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i in pokemon_generation_list)
|
||||||
|
{
|
||||||
$('article #container #game #flashdex').append(
|
$('article #container #game #flashdex').append(
|
||||||
'<div class="pokedex id_'+pklist.mn[pokemon_generation_list[i]]["num"]+'">'
|
'<div class="pokedex id_'+pklist.mn[pokemon_generation_list[i]]["num"]+'">'
|
||||||
|
+ '<span class="types">' + getFormattedTypes(pklist.mn[pokemon_generation_list[i]], '') + '</span>'
|
||||||
|
+ getFormattedSpriteButton(pklist.mn[pokemon_generation_list[i]], '')
|
||||||
+ getFormText(pklist.mn[pokemon_generation_list[i]]) // either gigantamax or mega-evolution
|
+ getFormText(pklist.mn[pokemon_generation_list[i]]) // either gigantamax or mega-evolution
|
||||||
+ '<img src="pokemon/'+ imageType((pklist.mn[pokemon_generation_list[i]]["num"])) +'.png"/>'
|
+ '<img src="pokemon/'+ imageType(pklist.mn[pokemon_generation_list[i]]) +'.png"/>'
|
||||||
+ '<span class="name">' + '<strong>' + '#' + getFormattedNumber(pklist.mn[[pokemon_generation_list[i]]]["num"]) + '</strong> '
|
+ '<span class="name">' + '<strong>' + '#' + getFormattedNumber(pklist.mn[[pokemon_generation_list[i]]]["num"]) + '</strong> '
|
||||||
+ pklist.mn[[pokemon_generation_list[i]]][lang] + '</span>'
|
+ pklist.mn[[pokemon_generation_list[i]]][lang] + '</span>'
|
||||||
+ '</div>'
|
+ '</div>'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$('article #container #game #flashdex').waitForImages(function() {
|
$('article #container #game #flashdex').waitForImages(function()
|
||||||
|
{
|
||||||
$(this).show();
|
$(this).show();
|
||||||
$('article #container #game #loading').hide();
|
$('article #container #game #loading').hide();
|
||||||
});
|
});
|
||||||
|
|
||||||
function generations() {
|
function handleArtworks(origin, left)
|
||||||
|
{
|
||||||
|
function handleDefault()
|
||||||
|
{
|
||||||
|
var form = url.split('-')[1];
|
||||||
|
|
||||||
|
if (left)
|
||||||
|
{
|
||||||
|
if (form > 0)
|
||||||
|
form--;
|
||||||
|
else
|
||||||
|
form = pklist.mn[pokemon]["sprite"] - 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (form < pklist.mn[pokemon]["sprite"] - 1)
|
||||||
|
form++;
|
||||||
|
else
|
||||||
|
form = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
var newUrl = 'pokemon/' + pokemonUrl + '-' + form + '.png';
|
||||||
|
|
||||||
|
origin.parent().parent().find("img").attr('src', newUrl);
|
||||||
|
handleChangeType(form, pokemon);
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleKanto()
|
||||||
|
{
|
||||||
|
var KantoForm = '';
|
||||||
|
for (var i = 0; i < originalUrl.length; i++)
|
||||||
|
{
|
||||||
|
if (originalUrl[i].match(/[A-Z]/))
|
||||||
|
KantoForm += originalUrl[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (left)
|
||||||
|
{
|
||||||
|
if (KantoForm == "RG")
|
||||||
|
KantoForm = "RB";
|
||||||
|
else if (KantoForm == "RB")
|
||||||
|
KantoForm = "";
|
||||||
|
else
|
||||||
|
KantoForm = "RG";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (KantoForm == "RB")
|
||||||
|
KantoForm = "RG";
|
||||||
|
else if (KantoForm == "RG")
|
||||||
|
KantoForm = "";
|
||||||
|
else
|
||||||
|
KantoForm = "RB";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (KantoForm)
|
||||||
|
KantoForm = "-" + KantoForm;
|
||||||
|
|
||||||
|
var newUrl = 'pokemon/' + pokemonUrl + KantoForm + '.png';
|
||||||
|
origin.parent().parent().find("img").attr('src', newUrl);
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleChangeType(form, num)
|
||||||
|
{
|
||||||
|
if (form != 0)
|
||||||
|
{
|
||||||
|
if (pklist.mn[num]["type"+form])
|
||||||
|
origin.parent().parent().find(".types").empty().append(getFormattedTypes(pklist.mn[num], form));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
origin.parent().parent().find(".types").empty().append(getFormattedTypes(pklist.mn[num], ''));
|
||||||
|
}
|
||||||
|
|
||||||
|
var url = origin.parent().parent().find("img").attr('src');
|
||||||
|
var originalUrl = url;
|
||||||
|
|
||||||
|
url = url.split('/')[1];
|
||||||
|
url = url.split('.')[0];
|
||||||
|
var pokemonUrl = url.split('-')[0];
|
||||||
|
|
||||||
|
var pokemon = pklist.mn.findIndex(function(item, i)
|
||||||
|
{
|
||||||
|
return item.num == pokemonUrl;
|
||||||
|
});
|
||||||
|
|
||||||
|
if (pklist.mn[pokemon]["origin"] == "Kanto" && !pklist.mn[pokemon]["sprite"])
|
||||||
|
handleKanto();
|
||||||
|
else if (pklist.mn[pokemon]["sprite"])
|
||||||
|
handleDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
$('.left-arrow').click(function(e)
|
||||||
|
{
|
||||||
|
handleArtworks($(this), true);
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.right-arrow').click(function(e)
|
||||||
|
{
|
||||||
|
handleArtworks($(this), false);
|
||||||
|
});
|
||||||
|
|
||||||
|
function generations()
|
||||||
|
{
|
||||||
// create the list of the different generations
|
// create the list of the different generations
|
||||||
function createGenerationList(name) {
|
function createGenerationList(name)
|
||||||
|
{
|
||||||
if ( $('article input[name="'+name+'"]').is(':checked') )
|
if ( $('article input[name="'+name+'"]').is(':checked') )
|
||||||
gen_list[gen_list.length] = name;
|
gen_list[gen_list.length] = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
// create the list of all possible pokemons for selected options
|
// create the list of all possible pokemons for selected options
|
||||||
function generatePokemonList() {
|
function generatePokemonList()
|
||||||
|
{
|
||||||
function evaluateByGeneration(index, name, variable) {
|
function evaluateByGeneration(index, name, variable)
|
||||||
if (gen_list[index] == name) {
|
{
|
||||||
|
if (gen_list[index] == name)
|
||||||
|
{
|
||||||
for (j = (variable[0] - 1); j <= (variable[1] - 1); j++)
|
for (j = (variable[0] - 1); j <= (variable[1] - 1); j++)
|
||||||
pokemon_generation_list[pokemon_generation_list.length] = j;
|
pokemon_generation_list[pokemon_generation_list.length] = j;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gen_list.length > 0) {
|
if (gen_list.length > 0)
|
||||||
for (i in gen_list) {
|
{
|
||||||
|
for (i in gen_list)
|
||||||
|
{
|
||||||
evaluateByGeneration(i, "1g", G1); evaluateByGeneration(i, "2g", G2); evaluateByGeneration(i, "3g", G3);
|
evaluateByGeneration(i, "1g", G1); evaluateByGeneration(i, "2g", G2); evaluateByGeneration(i, "3g", G3);
|
||||||
evaluateByGeneration(i, "4g", G4); evaluateByGeneration(i, "5g", G5); evaluateByGeneration(i, "6g", G6);
|
evaluateByGeneration(i, "4g", G4); evaluateByGeneration(i, "5g", G5); evaluateByGeneration(i, "6g", G6);
|
||||||
evaluateByGeneration(i, "7g", G7); evaluateByGeneration(i, "8g", G8); evaluateByGeneration(i, "9g", G9);
|
evaluateByGeneration(i, "7g", G7); evaluateByGeneration(i, "8g", G8); evaluateByGeneration(i, "9g", G9);
|
||||||
@ -146,44 +301,13 @@ $(document).ready(function() {
|
|||||||
generatePokemonList();
|
generatePokemonList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// multiple artworks
|
// multiple artworks
|
||||||
function imageType(result) {
|
function imageType(num)
|
||||||
var four_types = [351, 386, 585, 586, 676, 741, 800];
|
{
|
||||||
var three_types = [249, 250, 384, 412, 413, 718, 745, 898];
|
if (num["sprite"])
|
||||||
var two_types = [251, 252, 255, 258, 374, 387, 390, 393, 421, 422, 423, 487, 492, 495, 498, 501, 521, 550, 555,
|
return num["num"] + "-0";
|
||||||
592, 593, 641, 642, 643, 644, 645, 647, 648, 668, 678, 681, 720, 746, 774, 791, 792, 802, 849,
|
return num["num"];
|
||||||
876, 877, 888, 889, 892, 905, "G892"];
|
|
||||||
|
|
||||||
function no_randomizer() {
|
|
||||||
if (result === 25)
|
|
||||||
return (result+'-9');
|
|
||||||
if (result === 666)
|
|
||||||
return (result+'-0');
|
|
||||||
if (result === 646)
|
|
||||||
return (result+'-0');
|
|
||||||
if (result === 479)
|
|
||||||
return (result+'-0');
|
|
||||||
for (a in four_types) {
|
|
||||||
if (four_types[a] == result)
|
|
||||||
return (result+'-0');
|
|
||||||
}
|
|
||||||
for (a in three_types) {
|
|
||||||
if (three_types[a] == result)
|
|
||||||
return (result+'-0');
|
|
||||||
}
|
|
||||||
for (a in two_types) {
|
|
||||||
if (two_types[a] == result)
|
|
||||||
return (result+'-0');
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
return no_randomizer(result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
BIN
img/border.png
Before Width: | Height: | Size: 3.9 KiB |
46
index.html
@ -7,7 +7,7 @@
|
|||||||
<link rel="stylesheet" type="text/css" href="normalize-8.0.1.css" id="stylesheet">
|
<link rel="stylesheet" type="text/css" href="normalize-8.0.1.css" id="stylesheet">
|
||||||
<link rel="stylesheet" type="text/css" href="style.css" id="stylesheet">
|
<link rel="stylesheet" type="text/css" href="style.css" id="stylesheet">
|
||||||
<link rel="shortcut icon" type="image/png" href="img/favicon.png" />
|
<link rel="shortcut icon" type="image/png" href="img/favicon.png" />
|
||||||
<script src="jquery-3.6.0.min.js"></script>
|
<script src="jquery-3.7.1.min.js"></script>
|
||||||
<script src="interface.js"></script>
|
<script src="interface.js"></script>
|
||||||
<script src="poketest.js"></script>
|
<script src="poketest.js"></script>
|
||||||
<title>Pokétest</title>
|
<title>Pokétest</title>
|
||||||
@ -30,14 +30,14 @@
|
|||||||
<article>
|
<article>
|
||||||
<div id="container">
|
<div id="container">
|
||||||
<div id="game">
|
<div id="game">
|
||||||
<img src="pokemon/R58.png" alt="Growlithe" class="poketest-companion" />
|
<img src="pokemon/912.png" alt="Quaxly" class="poketest-companion" />
|
||||||
<h1>What is Pokétest?</h1>
|
<h1>Pokétest</h1>
|
||||||
|
|
||||||
<p>✨ <strong>Now updated for Pokémon Legends: Arceus!</strong></p>
|
<p>✨ <strong>Now updated for Pokémon Scarlet and Violet DLC: The Hidden Treasure of Area Zero!</strong></p>
|
||||||
|
|
||||||
<p>There are now more than 900 Pocket Monsters, and a handful number of alternative forms. It's getting pretty tricky to know them all, let alone to catch them all. With Pokétest, you can train yourself and become unbeatable! Filter by generation, language and even by Mega Evolutions, Regional or Gigantamax Forms!</p>
|
<p>We have now reached the thousand Pocket Monsters mark, and more than a hundred of alternative forms. It's getting pretty tricky to know them all, let alone to catch them all. With Pokétest, you can train yourself and become unbeatable! Filter by generation, language and even by Mega Evolutions, Regional or Gigantamax Forms!</p>
|
||||||
|
|
||||||
<p>You can play with your keyboard: just press 1, 2, 3 or 4 to choose the answer!</p>
|
<p>For more details, please read the <a href="about.html">About page</a>!</p>
|
||||||
|
|
||||||
<div id="configuration">
|
<div id="configuration">
|
||||||
<h2>Configuration</h2>
|
<h2>Configuration</h2>
|
||||||
@ -75,13 +75,17 @@
|
|||||||
<span class="SM1">7</span><span class="SM2">G</span>
|
<span class="SM1">7</span><span class="SM2">G</span>
|
||||||
</strong> (722 - 809)</label><br />
|
</strong> (722 - 809)</label><br />
|
||||||
|
|
||||||
<input type="checkbox" name="8g" id="8g"><label for="8g"> <strong title="8g">
|
<input type="checkbox" name="8g" id="8g"><label for="8g"> <strong title="Galar">
|
||||||
<span class="SWSH1">8</span><span class="SWSH2">G</span>
|
<span class="SWSH1">8</span><span class="SWSH2">G</span>
|
||||||
</strong> (810 - 905)</label><br />
|
</strong> (810 - 905)</label><br />
|
||||||
|
|
||||||
|
<input type="checkbox" name="9g" id="9g"><label for="9g"> <strong title="Paldea">
|
||||||
|
<span class="SV1">9</span><span class="SV2">G</span>
|
||||||
|
</strong> (906 - 1008)</label><br />
|
||||||
|
|
||||||
<input type="checkbox" name="regional" id="regional"><label for="regional"> <strong title="Regional">
|
<input type="checkbox" name="regional" id="regional"><label for="regional"> <strong title="Regional">
|
||||||
Regional Forms
|
Regional Forms
|
||||||
</strong> (53)</label><br />
|
</strong> (55)</label><br />
|
||||||
|
|
||||||
<input type="checkbox" name="mega" id="mega"><label for="mega"> <strong title="Mega">
|
<input type="checkbox" name="mega" id="mega"><label for="mega"> <strong title="Mega">
|
||||||
Mega-Evolutions
|
Mega-Evolutions
|
||||||
@ -104,6 +108,10 @@
|
|||||||
<option name="lang" id="cn" value="cn">繁體中文</option>
|
<option name="lang" id="cn" value="cn">繁體中文</option>
|
||||||
<option name="lang" id="cs" value="cs">简体中文</option>
|
<option name="lang" id="cs" value="cs">简体中文</option>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<h3>Answer type</h3>
|
||||||
|
<input type="radio" name="answertype" class="first" id="choice" checked><label for="choice"> Choice</label>
|
||||||
|
<input type="radio" name="answertype" id="input"><label for="input"> Input</label>
|
||||||
</div>
|
</div>
|
||||||
<div id="right_config">
|
<div id="right_config">
|
||||||
<h3>Silhouette</h3>
|
<h3>Silhouette</h3>
|
||||||
@ -112,7 +120,7 @@
|
|||||||
|
|
||||||
<h3>Number of questions</h3>
|
<h3>Number of questions</h3>
|
||||||
<select class="questions first">
|
<select class="questions first">
|
||||||
<!--<option name="questions" id="1" value="1">1 (debug)</option>-->
|
<!-- <option name="questions" id="1" value="1">1 (debug)</option> -->
|
||||||
<option name="questions" id="15" value="15">15</option>
|
<option name="questions" id="15" value="15">15</option>
|
||||||
<option name="questions" id="30" value="30">30</option>
|
<option name="questions" id="30" value="30">30</option>
|
||||||
<option name="questions" id="50" value="50">50</option>
|
<option name="questions" id="50" value="50">50</option>
|
||||||
@ -123,14 +131,15 @@
|
|||||||
|
|
||||||
<h3>Time to answer</h3>
|
<h3>Time to answer</h3>
|
||||||
<select class="time first">
|
<select class="time first">
|
||||||
<!--<option name="time" id="1" value="1">1 (debug)</option>-->
|
<!-- <option name="time" id="1" value="1">1 (debug)</option> -->
|
||||||
<option name="time" id="2" value="2">2</option>
|
<option name="time" id="2" value="2">2 seconds</option>
|
||||||
<option name="time" id="5" value="5" selected>5</option>
|
<option name="time" id="5" value="5" selected>5 seconds</option>
|
||||||
<option name="time" id="10" value="10">10</option>
|
<option name="time" id="10" value="10">10 seconds</option>
|
||||||
<option name="time" id="30" value="30">30</option>
|
<option name="time" id="30" value="30">30 seconds</option>
|
||||||
<option name="time" id="99" value="99">99</option>
|
<option name="time" id="99" value="99">99 seconds</option>
|
||||||
|
<option name="time" id="notimer" value="notimer">No timer</option>
|
||||||
<!--<option name="time" id="10000" value="10000">10000 (debug)</option>-->
|
<!--<option name="time" id="10000" value="10000">10000 (debug)</option>-->
|
||||||
</select> seconds
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -141,11 +150,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</article>
|
</article>
|
||||||
<footer>
|
<footer>
|
||||||
<p>© 2012 - 2022 Pokétest 2.7</p>
|
<p>© 2012 - 2025 Pokétest 2.10</p>
|
||||||
</footer>
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
|
||||||
!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');
|
|
||||||
</script>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
242
interface.js
@ -1,103 +1,19 @@
|
|||||||
$(document).ready(function() {
|
$(document).ready(function()
|
||||||
|
{
|
||||||
function random(min, max) {
|
function random(min, max)
|
||||||
|
{
|
||||||
return Math.floor(Math.random()*(max-min+1)+min);
|
return Math.floor(Math.random()*(max-min+1)+min);
|
||||||
}
|
}
|
||||||
|
|
||||||
// have a nice little background
|
// have a nice little background
|
||||||
//$.backstretch("artwork/artwork"+random(1, 10)+".jpg");
|
//$.backstretch("artwork/artwork"+random(1, 10)+".jpg");
|
||||||
|
|
||||||
// splice url arguments
|
|
||||||
function gup(name, url) {
|
|
||||||
if (!url) url = location.href;
|
|
||||||
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
|
|
||||||
var regexS = "[\\?&]"+name+"=([^&#]*)";
|
|
||||||
var regex = new RegExp( regexS );
|
|
||||||
var results = regex.exec( url );
|
|
||||||
return results == null ? null : results[1];
|
|
||||||
}
|
|
||||||
|
|
||||||
// read url
|
|
||||||
local_gen = gup('gen', window.location.href);
|
|
||||||
if (local_gen != null) {
|
|
||||||
if (local_gen == "all")
|
|
||||||
$('article #container #game #configuration input#all').attr('checked', true);
|
|
||||||
else {
|
|
||||||
$('article #container #game #configuration input#select').attr('checked', true);
|
|
||||||
for (i = 0; i < local_gen.length; i++) {
|
|
||||||
if (local_gen.charAt(i)) {
|
|
||||||
if (local_gen.charAt(i) == "m")
|
|
||||||
$('article #container #game #configuration #selected_options input#mega').attr('checked', true);
|
|
||||||
else if (local_gen.charAt(i) == "r")
|
|
||||||
$('article #container #game #configuration #selected_options input#regional').attr('checked', true);
|
|
||||||
else if (local_gen.charAt(i) == "g")
|
|
||||||
$('article #container #game #configuration #selected_options input#gigantamax').attr('checked', true);
|
|
||||||
else
|
|
||||||
$('article #container #game #configuration #selected_options input#' + local_gen.charAt(i) + 'g').attr('checked', true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$('#selected_options').slideDown();
|
|
||||||
}
|
|
||||||
$('article #container #game #configuration select.lang').val(gup('lang', window.location.href));
|
|
||||||
if (gup('silhouette', window.location.href) == "true")
|
|
||||||
$('article #container #game #configuration input#silhouette').attr('checked', true);
|
|
||||||
else
|
|
||||||
$('article #container #game #configuration input#full').attr('checked', true);
|
|
||||||
$('article #container #game #configuration select.questions').val(gup('questions', window.location.href));
|
|
||||||
$('article #container #game #configuration select.time').val(gup('time', window.location.href));
|
|
||||||
}
|
|
||||||
else { // if we did not come from a personalized URL, we read localstorage
|
|
||||||
|
|
||||||
if (localStorage.getItem('generation') != null) {
|
|
||||||
if (localStorage.getItem('generation') != 'all') {
|
|
||||||
gen_list = localStorage.getItem('generation');
|
|
||||||
|
|
||||||
$('article #container #game #configuration input#select').attr('checked', true);
|
|
||||||
for (i = 0; i < gen_list.length; i++) {
|
|
||||||
if (gen_list.charAt(i)) {
|
|
||||||
|
|
||||||
if (gen_list.charAt(i) == "m")
|
|
||||||
$('article #container #game #configuration #selected_options input#mega').attr('checked', true);
|
|
||||||
else if (gen_list.charAt(i) == "r")
|
|
||||||
$('article #container #game #configuration #selected_options input#regional').attr('checked', true);
|
|
||||||
else if (gen_list.charAt(i) == "g")
|
|
||||||
$('article #container #game #configuration #selected_options input#gigantamax').attr('checked', true);
|
|
||||||
else
|
|
||||||
$('article #container #game #configuration #selected_options input#' + gen_list.charAt(i) + 'g').attr('checked', true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$('#selected_options').slideDown();
|
|
||||||
} else
|
|
||||||
$('article #container #game #configuration input#all').attr('checked', true);
|
|
||||||
}
|
|
||||||
if (localStorage.getItem('lang') != null)
|
|
||||||
$('article #game #configuration select.lang').val(localStorage.getItem('lang'));
|
|
||||||
if (localStorage.getItem('silhouette') != null)
|
|
||||||
$('article #game #configuration input:radio[name=silhouette]#'+localStorage.getItem('silhouette')).attr('checked', true);
|
|
||||||
if (localStorage.getItem('questions') != null)
|
|
||||||
$('article #game #configuration select.questions').val(localStorage.getItem('questions'));
|
|
||||||
if (localStorage.getItem('time') != null)
|
|
||||||
$('article #game #configuration select.time').val(localStorage.getItem('time'));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// select generation toggle
|
|
||||||
$('#configuration input#all').click(function() {
|
|
||||||
$('#selected_options').slideUp();
|
|
||||||
});
|
|
||||||
|
|
||||||
$('#configuration input#select').click(function() {
|
|
||||||
$('#selected_options').slideDown();
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// hamburger mobile
|
// hamburger mobile
|
||||||
$("#hamburger .container").click(function()
|
$("#hamburger .container").click(function()
|
||||||
{
|
{
|
||||||
if ($("nav").hasClass("active"))
|
if ($("nav").hasClass("active"))
|
||||||
{
|
{
|
||||||
$("ul").slideUp(200, function()
|
$("nav ul").slideUp(200, function()
|
||||||
{
|
{
|
||||||
$("nav").removeClass("active");
|
$("nav").removeClass("active");
|
||||||
});
|
});
|
||||||
@ -105,7 +21,153 @@ $(document).ready(function() {
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$("nav").addClass("active");
|
$("nav").addClass("active");
|
||||||
$("ul").slideDown(200);
|
$("nav ul").slideDown(200);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// splice url arguments
|
||||||
|
function gup(name, url)
|
||||||
|
{
|
||||||
|
if (!url) url = location.href;
|
||||||
|
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
|
||||||
|
var regexS = "[\\?&]"+name+"=([^&#]*)";
|
||||||
|
var regex = new RegExp(regexS);
|
||||||
|
var results = regex.exec(url);
|
||||||
|
return results == null ? null : results[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
// index.html
|
||||||
|
if (location.pathname.includes("index.html"))
|
||||||
|
{
|
||||||
|
// read url
|
||||||
|
local_gen = gup('gen', location.href);
|
||||||
|
if (local_gen != null)
|
||||||
|
{
|
||||||
|
if (local_gen == "all")
|
||||||
|
$('article #container #game #configuration input#all').attr('checked', true);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$('article #container #game #configuration input#select').attr('checked', true);
|
||||||
|
for (i = 0; i < local_gen.length; i++)
|
||||||
|
{
|
||||||
|
if (local_gen.charAt(i)) {
|
||||||
|
if (local_gen.charAt(i) == "m")
|
||||||
|
$('article #container #game #configuration #selected_options input#mega').attr('checked', true);
|
||||||
|
else if (local_gen.charAt(i) == "r")
|
||||||
|
$('article #container #game #configuration #selected_options input#regional').attr('checked', true);
|
||||||
|
else if (local_gen.charAt(i) == "g")
|
||||||
|
$('article #container #game #configuration #selected_options input#gigantamax').attr('checked', true);
|
||||||
|
else
|
||||||
|
$('article #container #game #configuration #selected_options input#' + local_gen.charAt(i) + 'g').attr('checked', true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$('#selected_options').slideDown();
|
||||||
|
}
|
||||||
|
$('article #container #game #configuration select.lang').val(gup('lang', window.location.href));
|
||||||
|
|
||||||
|
if (gup('silhouette', window.location.href) == "true")
|
||||||
|
$('article #container #game #configuration input#silhouette').attr('checked', true);
|
||||||
|
else
|
||||||
|
$('article #container #game #configuration input#full').attr('checked', true);
|
||||||
|
|
||||||
|
if (gup('answertype', window.location.href) == "choice")
|
||||||
|
$('article #container #game #configuration input#choice').attr('checked', true);
|
||||||
|
else
|
||||||
|
$('article #container #game #configuration input#input').attr('checked', true);
|
||||||
|
|
||||||
|
$('article #container #game #configuration select.questions').val(gup('questions', window.location.href));
|
||||||
|
$('article #container #game #configuration select.time').val(gup('time', window.location.href));
|
||||||
|
}
|
||||||
|
else // if we did not come from a personalized URL, we read localstorage
|
||||||
|
{
|
||||||
|
if (localStorage.getItem('generation') != null)
|
||||||
|
{
|
||||||
|
if (localStorage.getItem('generation') != 'all')
|
||||||
|
{
|
||||||
|
gen_list = localStorage.getItem('generation');
|
||||||
|
|
||||||
|
$('article #container #game #configuration input#select').attr('checked', true);
|
||||||
|
for (i = 0; i < gen_list.length; i++)
|
||||||
|
{
|
||||||
|
if (gen_list.charAt(i))
|
||||||
|
{
|
||||||
|
if (gen_list.charAt(i) == "m")
|
||||||
|
$('article #container #game #configuration #selected_options input#mega').attr('checked', true);
|
||||||
|
else if (gen_list.charAt(i) == "r")
|
||||||
|
$('article #container #game #configuration #selected_options input#regional').attr('checked', true);
|
||||||
|
else if (gen_list.charAt(i) == "g")
|
||||||
|
$('article #container #game #configuration #selected_options input#gigantamax').attr('checked', true);
|
||||||
|
else
|
||||||
|
$('article #container #game #configuration #selected_options input#' + gen_list.charAt(i) + 'g').attr('checked', true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$('#selected_options').slideDown();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
$('article #container #game #configuration input#all').attr('checked', true);
|
||||||
|
}
|
||||||
|
if (localStorage.getItem('lang') != null)
|
||||||
|
$('article #game #configuration select.lang').val(localStorage.getItem('lang'));
|
||||||
|
if (localStorage.getItem('silhouette') != null)
|
||||||
|
$('article #game #configuration input:radio[name=silhouette]#'+localStorage.getItem('silhouette')).attr('checked', true);
|
||||||
|
if (localStorage.getItem('answertype') != null)
|
||||||
|
$('article #game #configuration input:radio[name=answertype]#'+localStorage.getItem('answertype')).attr('checked', true);
|
||||||
|
if (localStorage.getItem('questions') != null)
|
||||||
|
$('article #game #configuration select.questions').val(localStorage.getItem('questions'));
|
||||||
|
if (localStorage.getItem('time') != null)
|
||||||
|
$('article #game #configuration select.time').val(localStorage.getItem('time'));
|
||||||
|
}
|
||||||
|
|
||||||
|
// select generation toggle
|
||||||
|
$('#configuration input#all').click(function()
|
||||||
|
{
|
||||||
|
$('#selected_options').slideUp();
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#configuration input#select').click(function()
|
||||||
|
{
|
||||||
|
$('#selected_options').slideDown();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// flashdex.html
|
||||||
|
if (location.pathname.includes("flashdex.html"))
|
||||||
|
{
|
||||||
|
// read url
|
||||||
|
local_gen = gup('gen', location.href);
|
||||||
|
if (local_gen != null)
|
||||||
|
{
|
||||||
|
if (local_gen == "all")
|
||||||
|
{
|
||||||
|
for (i = 0; i < 10; i++)
|
||||||
|
$('article #container #game #flashdex_config input#' + i + 'g').attr('checked', true);
|
||||||
|
$('article #container #game #flashdex_config input#mega').attr('checked', true);
|
||||||
|
$('article #container #game #flashdex_config input#regional').attr('checked', true);
|
||||||
|
$('article #container #game #flashdex_config input#gigantamax').attr('checked', true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (i = 0; i < local_gen.length; i++)
|
||||||
|
{
|
||||||
|
if (local_gen.charAt(i)) {
|
||||||
|
if (local_gen.charAt(i) == "m")
|
||||||
|
$('article #container #game #flashdex_config input#mega').attr('checked', true);
|
||||||
|
else if (local_gen.charAt(i) == "r")
|
||||||
|
$('article #container #game #flashdex_config input#regional').attr('checked', true);
|
||||||
|
else if (local_gen.charAt(i) == "g")
|
||||||
|
$('article #container #game #flashdex_config input#gigantamax').attr('checked', true);
|
||||||
|
else
|
||||||
|
$('article #container #game #flashdex_config input#' + local_gen.charAt(i) + 'g').attr('checked', true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$('article #container #game #flashdex_config select.lang').val(gup('lang', window.location.href));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (localStorage.getItem('lang') != null)
|
||||||
|
$('article #container #game #flashdex_config select.lang').val(localStorage.getItem('lang'));
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
2
jquery-3.6.0.min.js
vendored
2
jquery-3.7.1.min.js
vendored
Normal file
2
pokemon
2209
pokemon.json
166
poketest.js
@ -8,7 +8,6 @@ $(document).ready(function() {
|
|||||||
/********************************/
|
/********************************/
|
||||||
|
|
||||||
/****** General variables ******/
|
/****** General variables ******/
|
||||||
var score = 0;
|
|
||||||
var questions = 0;
|
var questions = 0;
|
||||||
var good_answers = 0;
|
var good_answers = 0;
|
||||||
var bad_answers = 0;
|
var bad_answers = 0;
|
||||||
@ -30,10 +29,10 @@ $(document).ready(function() {
|
|||||||
var G6 = [650, 721];
|
var G6 = [650, 721];
|
||||||
var G7 = [722, 809];
|
var G7 = [722, 809];
|
||||||
var G8 = [810, 905];
|
var G8 = [810, 905];
|
||||||
var G9 = [906, 908];
|
var G9 = [906, 1025];
|
||||||
var MEGA = [909, 958];
|
var MEGA = [1026, 1075];
|
||||||
var GIGA = [959, 990];
|
var GIGA = [1076, 1107];
|
||||||
var REG = [991, 1043];
|
var REG = [1108, 1162];
|
||||||
var gen_number = 9;
|
var gen_number = 9;
|
||||||
var extra_number = 3; // mega, giga, reg
|
var extra_number = 3; // mega, giga, reg
|
||||||
|
|
||||||
@ -65,6 +64,11 @@ $(document).ready(function() {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function normalizeString(string)
|
||||||
|
{
|
||||||
|
return string.toLowerCase().normalize('NFD').replace(/[\u0300-\u036f]/g, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/************ GAME *************/
|
/************ GAME *************/
|
||||||
/*******************************/
|
/*******************************/
|
||||||
@ -96,6 +100,7 @@ $(document).ready(function() {
|
|||||||
else // else, it's all the generation, from the first one to the regional forms
|
else // else, it's all the generation, from the first one to the regional forms
|
||||||
max_questions = REG[1] + 1;
|
max_questions = REG[1] + 1;
|
||||||
}
|
}
|
||||||
|
answertype = $('article input[name="answertype"]:checked').attr('id');
|
||||||
game();
|
game();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -156,7 +161,7 @@ $(document).ready(function() {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (i = 0; i < gen_number; i++)
|
for (i = 1; i <= gen_number; i++)
|
||||||
createGenerationList((i + "g"));
|
createGenerationList((i + "g"));
|
||||||
createGenerationList("mega");
|
createGenerationList("mega");
|
||||||
createGenerationList("gigantamax");
|
createGenerationList("gigantamax");
|
||||||
@ -170,36 +175,26 @@ $(document).ready(function() {
|
|||||||
// multiple artworks
|
// multiple artworks
|
||||||
function imageType(result)
|
function imageType(result)
|
||||||
{
|
{
|
||||||
// TODO
|
function randomizer(result)
|
||||||
|
|
||||||
var four_types = [351, 386, 585, 586, 676, 741, 800];
|
|
||||||
var three_types = [249, 250, 384, 412, 413, 718, 745, 898];
|
|
||||||
var two_types = [251, 252, 255, 258, 374, 387, 390, 393, 421, 422, 423, 487, 492, 495, 498, 501, 521, 550, 555,
|
|
||||||
592, 593, 641, 642, 643, 644, 645, 647, 648, 668, 678, 681, 720, 746, 774, 791, 792, 802, 849,
|
|
||||||
876, 877, 888, 889, 892, 905, "G892"];
|
|
||||||
|
|
||||||
function randomizer()
|
|
||||||
{
|
{
|
||||||
if (result >= MEGA[0]) return (pklist.mn[result-1]["num"])
|
if (pk.mn[result]["sprite"])
|
||||||
if (result === 25) return (result+'-'+random(0, 16));
|
return pklist.mn[result]["num"] + '-' + random(0, pk.mn[result]["sprite"] - 1);
|
||||||
if (result === 666) return (result+'-'+random(0, 20));
|
else
|
||||||
if (result === 646) return (result+'-'+random(0, 6));
|
{
|
||||||
if (result === 479) return (result+'-'+random(0, 5));
|
if (pk.mn[result]["origin"] == "Kanto")
|
||||||
for (i in four_types) {
|
{
|
||||||
if (four_types[i] == result) return (result+'-'+random(0, 3));
|
randomValue = random(0, 2);
|
||||||
|
if (randomValue == 0)
|
||||||
|
return pklist.mn[result]["num"];
|
||||||
|
else if (randomValue == 1)
|
||||||
|
return pklist.mn[result]["num"]+'-RB';
|
||||||
|
else if (randomValue == 2)
|
||||||
|
return pklist.mn[result]["num"]+'-RG';
|
||||||
|
}
|
||||||
|
return pklist.mn[result]["num"];
|
||||||
}
|
}
|
||||||
for (i in three_types) {
|
|
||||||
if (three_types[i] == result) return (result+'-'+random(0, 2));
|
|
||||||
}
|
|
||||||
for (i in two_types) {
|
|
||||||
if (two_types[i] == result) return (result+'-'+random(0, 1));
|
|
||||||
}
|
|
||||||
if (result > 151) return result;
|
|
||||||
if ((tmp = random(0, 2)) == 0) return result;
|
|
||||||
else if (tmp == 1) return (result+'RB');
|
|
||||||
else return (result+'RG');
|
|
||||||
}
|
}
|
||||||
image_name = randomizer(result+1);
|
image_name = randomizer(result);
|
||||||
image_memory = new Image();
|
image_memory = new Image();
|
||||||
image_memory.src = 'pokemon/' + image_name + '.png';
|
image_memory.src = 'pokemon/' + image_name + '.png';
|
||||||
return image_name;
|
return image_name;
|
||||||
@ -238,8 +233,10 @@ $(document).ready(function() {
|
|||||||
available_pokemon.splice(resultIndex, 1);
|
available_pokemon.splice(resultIndex, 1);
|
||||||
|
|
||||||
answer = pklist.mn[result][lang];
|
answer = pklist.mn[result][lang];
|
||||||
chooseOptions(result, lang);
|
|
||||||
imageType(result + 1);
|
if (answertype == "choice")
|
||||||
|
chooseOptions(result, lang);
|
||||||
|
imageType(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
function game()
|
function game()
|
||||||
@ -248,16 +245,29 @@ $(document).ready(function() {
|
|||||||
questions++;
|
questions++;
|
||||||
chrono = max_chrono;
|
chrono = max_chrono;
|
||||||
$('article #container').addClass('game_active');
|
$('article #container').addClass('game_active');
|
||||||
$('article #container #share').empty();
|
$('article #container #share').remove();
|
||||||
$('article #container #seed').empty();
|
$('article #container #seed').remove();
|
||||||
$('article #container #copyseed').empty();
|
$('article #container #copyseed').remove();
|
||||||
$('article #container .chrono').empty().append(chrono);
|
if (chrono != "notimer")
|
||||||
$('article #container .whois').empty().append("Who's that Pokémon? " + (!infinite? " ("+questions+"/"+max_questions+")" : ""));
|
$('article #container .chrono').empty().append(chrono);
|
||||||
$('article #container .pokemon').empty().append('<img src="pokemon/'+image_name+'.png" class="'+(silhouette)+'" />');
|
else
|
||||||
$('article #container #answers').empty().append('<span><input type="submit" class="option a1" name="a1" value="'+options[0]+'"></span>')
|
$('article #container .chrono').hide();
|
||||||
$('article #container #answers').append('<span><input type="submit" class="option a2" name="a2" value="'+options[1]+'"></span>')
|
$('article #container .whois').empty().append("Who's that Pokémon? " + (!infinite? " (" + questions + "/" + max_questions + ")" : ""));
|
||||||
$('article #container #answers').append('<span><input type="submit" class="option a3" name="a3" value="'+options[2]+'"></span>')
|
$('article #container .pokemon').empty().append('<img src="pokemon/' + image_name + '.png" class="' + (silhouette) + ' ' + (answertype) + '" />');
|
||||||
$('article #container #answers').append('<span><input type="submit" class="option a4" name="a4" value="'+options[3]+'"></span>')
|
|
||||||
|
if (answertype == "choice")
|
||||||
|
{
|
||||||
|
$('article #container #answers').empty().append('<span><input type="submit" class="option a1" name="a1" value="' + options[0] + '"></span>');
|
||||||
|
$('article #container #answers').append('<span><input type="submit" class="option a2" name="a2" value="' + options[1] + '"></span>');
|
||||||
|
$('article #container #answers').append('<span><input type="submit" class="option a3" name="a3" value="' + options[2] + '"></span>');
|
||||||
|
$('article #container #answers').append('<span><input type="submit" class="option a4" name="a4" value="' + options[3] + '"></span>');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$('article #container #answers').empty().append('<form autocomplete="off"><input type="text" id="answer" name="answer" placeholder="Input the Pokémon name!"\
|
||||||
|
class="choice"><p class="button"><input type="submit" value="Answer!"></p></form>');
|
||||||
|
$('article #container #answers input').focus().select();
|
||||||
|
}
|
||||||
|
|
||||||
// timer setting
|
// timer setting
|
||||||
var clock = setInterval(function()
|
var clock = setInterval(function()
|
||||||
@ -278,18 +288,34 @@ $(document).ready(function() {
|
|||||||
($(this).attr('value') == answer) ? showAnswer(true) : showAnswer(false);
|
($(this).attr('value') == answer) ? showAnswer(true) : showAnswer(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
document.addEventListener('keydown', funcListener = function(event)
|
if (answertype == "choice")
|
||||||
{
|
{
|
||||||
function checkAnswer(v)
|
document.addEventListener('keydown', funcListener = function(event)
|
||||||
|
{
|
||||||
|
function checkAnswer(v)
|
||||||
|
{
|
||||||
|
clearInterval(clock);
|
||||||
|
($('#answers input.a'+v).attr('value') == answer) ? showAnswer(true) : showAnswer(false);
|
||||||
|
}
|
||||||
|
if (event.keyCode == 49 || event.keyCode == 72) checkAnswer(1);
|
||||||
|
else if (event.keyCode == 50 || event.keyCode == 74) checkAnswer(2);
|
||||||
|
else if (event.keyCode == 51 || event.keyCode == 75) checkAnswer(3);
|
||||||
|
else if (event.keyCode == 52 || event.keyCode == 76) checkAnswer(4);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$("form").submit(function(event)
|
||||||
{
|
{
|
||||||
clearInterval(clock);
|
clearInterval(clock);
|
||||||
($('#answers input.a'+v).attr('value') == answer) ? showAnswer(true) : showAnswer(false);
|
pokemon_name = event.currentTarget[0].value;
|
||||||
}
|
event.preventDefault(); // do not submit form
|
||||||
if (event.keyCode == 49 || event.keyCode == 72) checkAnswer(1);
|
if (normalizeString(answer) == normalizeString(pokemon_name))
|
||||||
else if (event.keyCode == 50 || event.keyCode == 74) checkAnswer(2);
|
showAnswer(true);
|
||||||
else if (event.keyCode == 51 || event.keyCode == 75) checkAnswer(3);
|
else
|
||||||
else if (event.keyCode == 52 || event.keyCode == 76) checkAnswer(4);
|
showAnswer(false);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function showAnswer(ok)
|
function showAnswer(ok)
|
||||||
{
|
{
|
||||||
@ -320,16 +346,6 @@ $(document).ready(function() {
|
|||||||
|
|
||||||
function score()
|
function score()
|
||||||
{
|
{
|
||||||
function generateTwitterText()
|
|
||||||
{
|
|
||||||
var start_sentence = 'I got ';
|
|
||||||
var end_sentence = 'Can you get a better score than me?';
|
|
||||||
var score_sentence = (Math.floor(good_answers/max_questions*100))+'% Pokémons right!'
|
|
||||||
|
|
||||||
if (!infinite) return start_sentence+score_sentence+" "+end_sentence;
|
|
||||||
else return start_sentence+good_answers+" good Pokémon answers! "+end_sentence;
|
|
||||||
}
|
|
||||||
|
|
||||||
function generateSeed()
|
function generateSeed()
|
||||||
{
|
{
|
||||||
gen = '';
|
gen = '';
|
||||||
@ -339,8 +355,10 @@ $(document).ready(function() {
|
|||||||
gen += gen_list[i].substring(0,1);
|
gen += gen_list[i].substring(0,1);
|
||||||
}
|
}
|
||||||
else gen += "all";
|
else gen += "all";
|
||||||
|
|
||||||
s_gen = "?gen=" + gen;
|
s_gen = "?gen=" + gen;
|
||||||
s_lang = "&lang=" + lang;
|
s_lang = "&lang=" + lang;
|
||||||
|
s_answertype = "&answertype=" + answertype;
|
||||||
s_silhouette = "&silhouette=" + (silhouette == "silhouette" ? "true" : "false");
|
s_silhouette = "&silhouette=" + (silhouette == "silhouette" ? "true" : "false");
|
||||||
s_questions = "&questions=" + (!whole_set? max_questions : "set");
|
s_questions = "&questions=" + (!whole_set? max_questions : "set");
|
||||||
s_time = "&time=" + max_chrono;
|
s_time = "&time=" + max_chrono;
|
||||||
@ -348,14 +366,15 @@ $(document).ready(function() {
|
|||||||
// save in the local storage for default use
|
// save in the local storage for default use
|
||||||
localStorage.setItem('generation', gen);
|
localStorage.setItem('generation', gen);
|
||||||
localStorage.setItem('lang', lang);
|
localStorage.setItem('lang', lang);
|
||||||
|
localStorage.setItem('answertype', answertype);
|
||||||
localStorage.setItem('silhouette', silhouette);
|
localStorage.setItem('silhouette', silhouette);
|
||||||
localStorage.setItem('questions', (!whole_set? max_questions : "set"));
|
localStorage.setItem('questions', (!whole_set? max_questions : "set"));
|
||||||
localStorage.setItem('time', max_chrono);
|
localStorage.setItem('time', max_chrono);
|
||||||
|
|
||||||
return domain + s_gen + s_lang + s_silhouette + s_questions + s_time;
|
return domain + s_gen + s_lang + s_answertype + s_silhouette + s_questions + s_time;
|
||||||
}
|
}
|
||||||
|
|
||||||
$('article #container #score .pokemon').after('<div id="seed"></div><div id="share"></div>');
|
$('article #container #score .pokemon').empty().after('<div id="seed"></div><div id="share"></div>');
|
||||||
$('article #container').addClass('diploma');
|
$('article #container').addClass('diploma');
|
||||||
$('article #container').removeClass('game_active');
|
$('article #container').removeClass('game_active');
|
||||||
$('article #container .chrono').hide();
|
$('article #container .chrono').hide();
|
||||||
@ -366,19 +385,15 @@ $(document).ready(function() {
|
|||||||
|
|
||||||
$('article #container #seed').empty().append('<p style="margin:0px;">Share your configuration</p><input type="text" name="seed" value="'+
|
$('article #container #seed').empty().append('<p style="margin:0px;">Share your configuration</p><input type="text" name="seed" value="'+
|
||||||
generateSeed()+'">');
|
generateSeed()+'">');
|
||||||
$('article #container #share').empty().append('<div id="copyseed"><a href="#">Copy</a></div><a href="https://twitter.com/share" \
|
$('article #container #share').empty().append('<div id="copyseed"><a href="#">Copy</a></div>');
|
||||||
class="twitter-share-button" data-url="'+generateSeed()+'" data-text="'+generateTwitterText()+
|
$('article #container #answers').empty().append('<p class="button"><input type="submit" \
|
||||||
'" data-size="large" data-hashtags="Pokétest">Tweet</a>');
|
class="start_again" name="start_again" value="Play again!"></p>');
|
||||||
$.getScript("//platform.twitter.com/widgets.js"); // for the twitter button to work
|
|
||||||
$('article #container #answers').remove(); // until play again is fixed
|
|
||||||
//$('article #container #answers').empty().append('<p class="button"><input type="submit" \
|
|
||||||
// class="start_again" name="start_again" value="Play again!"></p>');
|
|
||||||
|
|
||||||
// copy seed in clipboard
|
// copy seed in clipboard
|
||||||
$("article #container #copyseed").click(function()
|
$("article #container #copyseed").click(function()
|
||||||
{
|
{
|
||||||
$('article #container #seed input').select();
|
$('article #container #seed input').select();
|
||||||
document.execCommand("copy");
|
navigator.clipboard.writeText($('article #container #seed input').val());
|
||||||
});
|
});
|
||||||
|
|
||||||
$('article #container .button input.start_again').click(function()
|
$('article #container .button input.start_again').click(function()
|
||||||
@ -387,6 +402,7 @@ $(document).ready(function() {
|
|||||||
chrono = max_chrono;
|
chrono = max_chrono;
|
||||||
$('article #container .chrono').show();
|
$('article #container .chrono').show();
|
||||||
$('article #container').removeClass('diploma');
|
$('article #container').removeClass('diploma');
|
||||||
|
$('article #container').addClass('game_active');
|
||||||
game();
|
game();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
139
style.css
@ -17,7 +17,7 @@ body {
|
|||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
z-index: -1;
|
z-index: -1;
|
||||||
background: url("artwork/artwork10.jpg") center center;
|
background: url("artwork/artwork11.jpg") center center;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
background-attachment: fixed;
|
background-attachment: fixed;
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
@ -100,7 +100,7 @@ article #container .flashdex-companion {
|
|||||||
}
|
}
|
||||||
|
|
||||||
article #container .top-companion {
|
article #container .top-companion {
|
||||||
margin-top: 20px;
|
margin-top: 20px; margin-bottom: 10px;
|
||||||
float: right;
|
float: right;
|
||||||
width: 250px;
|
width: 250px;
|
||||||
margin-left: 25px; margin-right: 25px;
|
margin-left: 25px; margin-right: 25px;
|
||||||
@ -114,7 +114,6 @@ article #container .middle-companion {
|
|||||||
|
|
||||||
article #container.about p { margin-left:20px; }
|
article #container.about p { margin-left:20px; }
|
||||||
|
|
||||||
article #container.about ul { margin-bottom: 3.5%; }
|
|
||||||
article #container.about ul li { margin-top: 5px; margin-bottom: 5px; }
|
article #container.about ul li { margin-top: 5px; margin-bottom: 5px; }
|
||||||
article #container.about ul li a { margin-top: 5px; margin-bottom: 5px; font-weight: normal; }
|
article #container.about ul li a { margin-top: 5px; margin-bottom: 5px; font-weight: normal; }
|
||||||
|
|
||||||
@ -257,8 +256,20 @@ article #container #answers {
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
article #container #answers input { margin-right: 30px; display: inline; }
|
article #container #answers input { margin-right: 15px; margin-left: 15px; display: inline; }
|
||||||
article #container #answers input:last-child { margin-right: 30px; }
|
|
||||||
|
article #container #answers form input:last-child { margin: initial; }
|
||||||
|
article #container #answers form input.choice {
|
||||||
|
padding: 10px;
|
||||||
|
min-width: 25vw;
|
||||||
|
margin: auto;
|
||||||
|
margin-bottom: auto;
|
||||||
|
border-radius: 9px;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
margin-right: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
article #container #answers form .button { margin: 5px; display: inline-block; }
|
||||||
|
|
||||||
article #container #answers .final_answer { font-size: 23px; }
|
article #container #answers .final_answer { font-size: 23px; }
|
||||||
article #container #answers .final_answer .good { color:#3ad48d; font-weight:bold; }
|
article #container #answers .final_answer .good { color:#3ad48d; font-weight:bold; }
|
||||||
@ -293,7 +304,6 @@ article #container #seed input {
|
|||||||
}
|
}
|
||||||
|
|
||||||
article #container #copyseed {
|
article #container #copyseed {
|
||||||
float: left;
|
|
||||||
width: 60px; height: 16px;
|
width: 60px; height: 16px;
|
||||||
display: block;
|
display: block;
|
||||||
padding: 10px; padding-top: 4px; padding-bottom: 8px;
|
padding: 10px; padding-top: 4px; padding-bottom: 8px;
|
||||||
@ -302,7 +312,8 @@ article #container #copyseed {
|
|||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
font-variant: small-caps;
|
font-variant: small-caps;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
cursor:pointer;
|
cursor: pointer;
|
||||||
|
margin: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
article #container #copyseed a {
|
article #container #copyseed a {
|
||||||
@ -313,12 +324,6 @@ article #container #copyseed a {
|
|||||||
|
|
||||||
article #container #copyseed:hover { background:lightseagreen; }
|
article #container #copyseed:hover { background:lightseagreen; }
|
||||||
|
|
||||||
article #container.diploma {
|
|
||||||
border-style: solid;
|
|
||||||
border-image: url(img/border.png) 64 64 64 62 repeat;
|
|
||||||
border-width: 8px 8px 8px 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
article #container.diploma #score {
|
article #container.diploma #score {
|
||||||
background: url('img/red.png') no-repeat;
|
background: url('img/red.png') no-repeat;
|
||||||
background-size: 180px; background-position: right bottom;
|
background-size: 180px; background-position: right bottom;
|
||||||
@ -349,11 +354,10 @@ article #container.diploma #score {
|
|||||||
margin:auto;
|
margin:auto;
|
||||||
display:none;
|
display:none;
|
||||||
text-align:center;
|
text-align:center;
|
||||||
margin-top:2vh;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#container #game #flashdex .pokedex {
|
#container #game #flashdex .pokedex {
|
||||||
width: 250px; height: 285px;
|
width: 250px;
|
||||||
border: 1px solid white;
|
border: 1px solid white;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
margin: 10px;
|
margin: 10px;
|
||||||
@ -368,32 +372,85 @@ article #container.diploma #score {
|
|||||||
height: 250px;
|
height: 250px;
|
||||||
display: block;
|
display: block;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
|
margin: 12px auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
#game #flashdex .pokedex span.name {
|
#game #flashdex .pokedex .button {
|
||||||
text-align: center;
|
position: absolute;
|
||||||
font-size: 1em;
|
bottom: 0;
|
||||||
display: block;
|
left: 0;
|
||||||
margin: auto; margin-top: 15px;
|
margin: 8px;
|
||||||
|
background: white;
|
||||||
|
padding: 0px;
|
||||||
|
border-radius: 5px;
|
||||||
|
color: dimgray;
|
||||||
|
padding-bottom: 1.5px;
|
||||||
|
padding-top: 0.5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
span.form {
|
#game #flashdex .pokedex .left-arrow, #game #flashdex .pokedex .right-arrow {
|
||||||
|
cursor: pointer;
|
||||||
|
user-select: none;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
padding: 0rem 0.2rem;
|
||||||
|
line-height: 1.2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
#game #flashdex .pokedex span.form {
|
||||||
display: block;
|
display: block;
|
||||||
float: right;
|
float: right;
|
||||||
width: 25px; height: 25px;
|
width: 25px; height: 25px;
|
||||||
background-size: 25px 25px;
|
background-size: 25px 25px;
|
||||||
position: absolute;
|
|
||||||
right: 10px;
|
right: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
span.form.mega { background-image: url('img/icon_mega.png'); }
|
#game #flashdex .pokedex span.form.mega { background-image: url('img/icon_mega.png'); }
|
||||||
span.form.giga {
|
#game #flashdex .pokedex span.form.giga {
|
||||||
background-image: url('img/icon_giga.png'); background-color: white;
|
background-image: url('img/icon_giga.png'); background-color: white;
|
||||||
background-position: center; background-size:20px;
|
background-position: center; background-size:20px;
|
||||||
border-radius: 50%; border: 1px solid white;
|
border-radius: 50%; border: 1px solid white;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#game #flashdex .pokedex span.types {
|
||||||
|
display: flex;
|
||||||
|
float: left;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#game #flashdex .pokedex span.types:after {
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
|
||||||
|
#game #flashdex .pokedex span.types span {
|
||||||
|
margin: 0px;
|
||||||
|
margin-right: 5px;
|
||||||
|
padding: 5px;
|
||||||
|
border-radius: 2px;
|
||||||
|
font-family: Sans-Serif;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 0.8rem;
|
||||||
|
text-shadow: 0 0 2px #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
#game #flashdex .pokedex span.types .Grass { background: #78C850; }
|
||||||
|
#game #flashdex .pokedex span.types .Poison { background: #A040A0; }
|
||||||
|
#game #flashdex .pokedex span.types .Fire { background: #F08030; }
|
||||||
|
#game #flashdex .pokedex span.types .Dragon { background: #7038F8; }
|
||||||
|
#game #flashdex .pokedex span.types .Flying { background: #A890F0; }
|
||||||
|
#game #flashdex .pokedex span.types .Water { background: #6890F0; }
|
||||||
|
#game #flashdex .pokedex span.types .Bug { background: #A8B820; }
|
||||||
|
#game #flashdex .pokedex span.types .Normal { background: #A8A878; }
|
||||||
|
#game #flashdex .pokedex span.types .Dark { background: #705848; }
|
||||||
|
#game #flashdex .pokedex span.types .Electric { background: #F8D030; }
|
||||||
|
#game #flashdex .pokedex span.types .Ground { background: #E0C068; }
|
||||||
|
#game #flashdex .pokedex span.types .Psychic { background: #F85888; }
|
||||||
|
#game #flashdex .pokedex span.types .Ice { background: #98D8D8; }
|
||||||
|
#game #flashdex .pokedex span.types .Steel { background: #B8B8D0; }
|
||||||
|
#game #flashdex .pokedex span.types .Fairy { background: #EE99AC; }
|
||||||
|
#game #flashdex .pokedex span.types .Fighting { background: #C03028; }
|
||||||
|
#game #flashdex .pokedex span.types .Rock { background: #B8A038; }
|
||||||
|
#game #flashdex .pokedex span.types .Ghost { background: #705898; }
|
||||||
|
|
||||||
|
|
||||||
/*** MOBILE ***/
|
/*** MOBILE ***/
|
||||||
@ -467,8 +524,8 @@ span.form.giga {
|
|||||||
|
|
||||||
/* poketest */
|
/* poketest */
|
||||||
|
|
||||||
article #container #game #configuration #left_config { float: none; }
|
/*article #container #game #configuration #left_config { float: none; }
|
||||||
article #container #game #configuration #right_config { float: none; }
|
article #container #game #configuration #right_config { float: none; }*/
|
||||||
article #container #game #configuration input[name="gen"], article #container #game #selected_options input,
|
article #container #game #configuration input[name="gen"], article #container #game #selected_options input,
|
||||||
article #container #game #configuration .first { margin-left:15px; margin-bottom:5px; }
|
article #container #game #configuration .first { margin-left:15px; margin-bottom:5px; }
|
||||||
article #container #game .button { padding: 10px; padding-top: 20px; }
|
article #container #game .button { padding: 10px; padding-top: 20px; }
|
||||||
@ -497,8 +554,11 @@ span.form.giga {
|
|||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
article #container #answers input:last-child { margin-right: 0px; }
|
article #container #answers input:last-child { margin-right: 0px; margin-left: 0px; }
|
||||||
article #container.game_active div#answers span { display: block; }
|
article #container.game_active div#answers span { display: block; }
|
||||||
|
|
||||||
|
article #container #answers form input.choice { min-width: 75vw; margin-right:0px; }
|
||||||
|
|
||||||
article #container.diploma #score { background: none; }
|
article #container.diploma #score { background: none; }
|
||||||
article #container #seed input {
|
article #container #seed input {
|
||||||
width: 90%;
|
width: 90%;
|
||||||
@ -512,6 +572,11 @@ span.form.giga {
|
|||||||
margin-top: 1vh;
|
margin-top: 1vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
article #container .pokemon img.input {
|
||||||
|
height: 42vh;
|
||||||
|
margin-top: 1vh;
|
||||||
|
}
|
||||||
|
|
||||||
article #container #top_game .whois { width: 80%; }
|
article #container #top_game .whois { width: 80%; }
|
||||||
article #container #top_game .chrono {
|
article #container #top_game .chrono {
|
||||||
width: 2rem;
|
width: 2rem;
|
||||||
@ -525,10 +590,11 @@ span.form.giga {
|
|||||||
padding: 10px; padding-top: 15px;
|
padding: 10px; padding-top: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
article #container #answers form .button { display: block; }
|
||||||
|
|
||||||
/* flashdex */
|
/* flashdex */
|
||||||
|
|
||||||
#container #game #flashdex .pokedex { width: 230px; height: 260px; }
|
#container #game #flashdex .pokedex { width: 230px; }
|
||||||
#game #flashdex .pokedex img { height: 225px; }
|
|
||||||
|
|
||||||
#game #flashdex_config p { text-align: left; }
|
#game #flashdex_config p { text-align: left; }
|
||||||
|
|
||||||
@ -540,6 +606,10 @@ span.form.giga {
|
|||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#game #flashdex .pokedex img {
|
||||||
|
height: 230px;
|
||||||
|
}
|
||||||
|
|
||||||
#game #flashdex_config .generation .gen {
|
#game #flashdex_config .generation .gen {
|
||||||
display: block;
|
display: block;
|
||||||
position: relative;
|
position: relative;
|
||||||
@ -549,7 +619,7 @@ span.form.giga {
|
|||||||
#game #flashdex_config .gen { padding: 0; margin: 0; display: block; }
|
#game #flashdex_config .gen { padding: 0; margin: 0; display: block; }
|
||||||
#game #flashdex_config .gen label { padding: 2px; margin: 2px; margin-left: 8px; }
|
#game #flashdex_config .gen label { padding: 2px; margin: 2px; margin-left: 8px; }
|
||||||
#game #flashdex_config select.lang { margin-left: 15px; margin-top:5px; }
|
#game #flashdex_config select.lang { margin-left: 15px; margin-top:5px; }
|
||||||
#game #flashdex_config p.button { padding-top: 15px; margin-top: 15px; }
|
#game #flashdex_config p.button { padding-top: 0px; margin-top: 0px; }
|
||||||
|
|
||||||
/* about */
|
/* about */
|
||||||
|
|
||||||
@ -572,6 +642,15 @@ span.form.giga {
|
|||||||
footer { height:6vh; }
|
footer { height:6vh; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width:500px) {
|
||||||
|
article #container #game #configuration #left_config { float: none; text-align: center; }
|
||||||
|
article #container #game #configuration #right_config { float: none; text-align: center; }
|
||||||
|
|
||||||
|
article #container #game #configuration input[name="gen"], article #container #game #selected_options input, article #container #game #configuration .first {
|
||||||
|
margin-left: 0px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@media screen and (max-width:400px) {
|
@media screen and (max-width:400px) {
|
||||||
header img { height: 60px; }
|
header img { height: 60px; }
|
||||||
header nav #hamburger { top: 1.05rem; }
|
header nav #hamburger { top: 1.05rem; }
|
||||||
|