From 5e3fd8096624fc06f70da2218949590d4b1bb045 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Fri, 13 Oct 2017 11:19:40 -0400 Subject: Added shiny star --- app/assets/images/pokeviewer/ShinyIVStar.png | Bin 0 -> 226 bytes app/assets/stylesheets/pokeviewer/pokemon.css.scss | 9 ++++++++- app/views/pokeviewer/pokemon/show.html.haml | 5 ++++- lib/pokeviewer/engine.rb | 3 ++- 4 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 app/assets/images/pokeviewer/ShinyIVStar.png diff --git a/app/assets/images/pokeviewer/ShinyIVStar.png b/app/assets/images/pokeviewer/ShinyIVStar.png new file mode 100644 index 0000000..ecd3b58 Binary files /dev/null and b/app/assets/images/pokeviewer/ShinyIVStar.png differ diff --git a/app/assets/stylesheets/pokeviewer/pokemon.css.scss b/app/assets/stylesheets/pokeviewer/pokemon.css.scss index b7f9358..cd919e7 100644 --- a/app/assets/stylesheets/pokeviewer/pokemon.css.scss +++ b/app/assets/stylesheets/pokeviewer/pokemon.css.scss @@ -191,7 +191,7 @@ &.in-emerald { .pokemon-image { - img { + .pokemon-sprite { margin: -14px; } } @@ -249,6 +249,13 @@ border-radius: 10px; display: inline-block; padding: 4px; + position: relative; + + .pkv-shiny-star { + position: absolute; + top: 0; + right: -1.5em; + } } } diff --git a/app/views/pokeviewer/pokemon/show.html.haml b/app/views/pokeviewer/pokemon/show.html.haml index f3568fb..0daabb0 100644 --- a/app/views/pokeviewer/pokemon/show.html.haml +++ b/app/views/pokeviewer/pokemon/show.html.haml @@ -6,7 +6,10 @@ %span.pokemon-gender{ class: @pokemon.gender }= @pokemon.gender_symbol .pokemon-level= "Lv. #{@pokemon.revisions.last.level}" .pokemon-image - .pokemon-image-wrap= image_tag @pokemon.sprite_path + .pokemon-image-wrap + = image_tag @pokemon.sprite_path, class: "pokemon-sprite" + - if @pokemon.shiny? + = image_tag "pokeviewer/ShinyIVStar.png", class: "pkv-shiny-star" - if @pokemon.revisions.last.item.nil? .pokemon-item-label Item .pokemon-item None diff --git a/lib/pokeviewer/engine.rb b/lib/pokeviewer/engine.rb index 247654f..052fb62 100644 --- a/lib/pokeviewer/engine.rb +++ b/lib/pokeviewer/engine.rb @@ -22,7 +22,8 @@ module Pokeviewer pokeviewer/boxes/*.png pokeviewer/ribbons/*.png pokeviewer/items/*.png - pokeviewer/items/**/*.png) + pokeviewer/items/**/*.png + pokeviewer/*.png) end end end -- cgit 1.4.1