diff --git a/Portfolio.WebUI.Server/Components/Component/PokemonCard.razor b/Portfolio.WebUI.Server/Components/Component/PokemonCard.razor new file mode 100644 index 0000000..58b8ef3 --- /dev/null +++ b/Portfolio.WebUI.Server/Components/Component/PokemonCard.razor @@ -0,0 +1,72 @@ +
+ +
+
+ @if (_pokemon.IsVariation) + { +
+

@_pokemon.VariationName @_pokemon.PokemonName

+
+
+

Pokédex #@_pokemon.PokemonId

+
+ } + else + { +
+

@_pokemon.PokemonName

+
+
+

Pokédex #@_pokemon.PokemonId

+
+ } +
+
+ + +
+
+ + +
+
+ +
+
+
+

@_pokemon.SleepType

+

@_pokemon.Speciality

+
+
+
+ +
+ +@code { + + [Parameter] + public Pokemon Pokemon { get; set; } + + private Pokemon _pokemon { get; set; } + + private bool isShiny = false; + + protected override void OnParametersSet() + { + if(Pokemon != null) + { + _pokemon = Pokemon; + + } + } + + private void ToggleImage() + { + isShiny = !isShiny; + StateHasChanged(); + } + + + + +} diff --git a/Portfolio.WebUI.Server/Components/Component/PokemonCard.razor.css b/Portfolio.WebUI.Server/Components/Component/PokemonCard.razor.css new file mode 100644 index 0000000..5f40610 --- /dev/null +++ b/Portfolio.WebUI.Server/Components/Component/PokemonCard.razor.css @@ -0,0 +1,73 @@ + +.flip-container { + perspective: 1000px; + display: inline-block; + width: 100%; + height: 100%; + cursor: pointer; +} + +.flipper { + transition: transform 0.6s; + transform-style: preserve-3d; + width: 100%; + height: 100%; + position: relative; +} + +.flipped { + transform: rotateY(180deg); +} + +.front, .back { + width: 100%; + height: 100%; + position: absolute; + top: 0; + left: 0; + backface-visibility: hidden; +} + +.back { + transform: rotateY(180deg); +} + +.badge { + width: 90px; + height: 30px; + color: white; + padding: 4px 8px; + border-radius: 30px; +} + +.statText { + position: relative; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + font-size: 13px; +} + +.dozing { + background-color: #fcdc5e; +} + +.snoozing { + background-color: #4ce8ed; +} + +.slumbering { + background-color: #4588fb; +} + +.berries { + background-color: #24d86b; +} + +.ingredients { + background-color: #fdbe4d; +} + +.skills { + background-color: #47a0fc; +} diff --git a/Portfolio.WebUI.Server/Components/Pages/PokemonRate.razor b/Portfolio.WebUI.Server/Components/Pages/PokemonRate.razor index e34315e..3c4541e 100644 --- a/Portfolio.WebUI.Server/Components/Pages/PokemonRate.razor +++ b/Portfolio.WebUI.Server/Components/Pages/PokemonRate.razor @@ -18,26 +18,27 @@ } else { -
+
-
+

Pokémon Rater

-
+
-
-
-
+
+
+
+ @oninput="OnSearchTextChanged" + style="max-width:50%; min-width:50%;" /> @if (FilteredPokemonList.Any() && !string.IsNullOrWhiteSpace(PokemonSearchTerm)) { @@ -58,141 +59,104 @@ else }
+ @if(SelectedPokemon != null) + { + + } +
+ @if(SelectedPokemon != null) + { +
+

Select Nature & Subskills

+ + +
+
+ + +
+
+ +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+
+
+ +
+ + +
+ +
+ + +
+
+ +
+ } + +
+ @if(SelectedPokemon != null) + { +
+
+ +

Final Score: @FinalScore

- - - @if (SelectedPokemon != null) - { -
-
- - -
- -
-
- - -
-
-
-
-
- @if (SelectedPokemon.IsVariation) - { -

@SelectedPokemon.VariationName @SelectedPokemon.PokemonName

- } - else - { -

@SelectedPokemon.PokemonName

- } -
-
-

Pokédex #@SelectedPokemon.PokemonId

-
-
- -
-
-

@SelectedPokemon.SleepType

-

@SelectedPokemon.Speciality

-
-
-
- -
- - -
-

Select Nature & Subskills

- - -
-
- - -
-
- - -
- -
- - -
- -
- - -
- -
- - -
-
-
- -
- - -
- -
- - -
-
- -
- -
- - -
- -

Final Score: @FinalScore

-
-
} +
} diff --git a/Portfolio.WebUI.Server/Components/Pages/PokemonRate.razor.cs b/Portfolio.WebUI.Server/Components/Pages/PokemonRate.razor.cs index 77dcc14..cc7c22b 100644 --- a/Portfolio.WebUI.Server/Components/Pages/PokemonRate.razor.cs +++ b/Portfolio.WebUI.Server/Components/Pages/PokemonRate.razor.cs @@ -39,9 +39,6 @@ namespace Portfolio.WebUI.Server.Components.Pages private string ScoreBackgroundColor; private string ScoreColor; - private string PokemonImageUrl => SelectedPokemon != null - ? $"https://www.serebii.net/pokemonsleep/pokemon/{SelectedPokemon.Id}.png" - : string.Empty; private string PokemonSearchTerm = string.Empty; @@ -54,6 +51,7 @@ namespace Portfolio.WebUI.Server.Components.Pages { // Trigger filtering as the user types PokemonSearchTerm = e.Value.ToString(); + } private async Task SelectPokemon(Pokemon pokemon) diff --git a/Portfolio.WebUI.Server/Components/Pages/PokemonRate.razor.css b/Portfolio.WebUI.Server/Components/Pages/PokemonRate.razor.css index 174cbb9..bc759f1 100644 --- a/Portfolio.WebUI.Server/Components/Pages/PokemonRate.razor.css +++ b/Portfolio.WebUI.Server/Components/Pages/PokemonRate.razor.css @@ -3,6 +3,7 @@ box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(255,255, 255, 0.19); border-radius: 15px; + } .flip-container {