From cb6eebdf05c95f15ad6ce8968838772a2b915755 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Fri, 13 Oct 2017 10:31:45 -0400 Subject: Added sheen to Pokémon contest stats MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/assets/stylesheets/pokeviewer/pokemon.css.scss | 21 +++++++++++++ app/helpers/pokeviewer/pokemon_helper.rb | 34 +++++++++++++++++++++- 2 files changed, 54 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/pokeviewer/pokemon.css.scss b/app/assets/stylesheets/pokeviewer/pokemon.css.scss index 4c1fc2c..9d2db44 100644 --- a/app/assets/stylesheets/pokeviewer/pokemon.css.scss +++ b/app/assets/stylesheets/pokeviewer/pokemon.css.scss @@ -505,6 +505,27 @@ stroke-width: 6; stroke-linejoin: butt; } + + .pkcv-sheen-bg { + fill: #706860; + } + + .pkcv-sheen-data { + fill: #a048c8; + border-top-left-radius: 10px; + border-bottom-left-radius: 10px; + } + + .pkcv-sheen-border { + fill-opacity: 0; + stroke-width: 5; + stroke: gray; + } + + .pkcv-sheen-label { + fill: white; + font-size: 40px; + } } } } diff --git a/app/helpers/pokeviewer/pokemon_helper.rb b/app/helpers/pokeviewer/pokemon_helper.rb index 9524914..e1c7223 100644 --- a/app/helpers/pokeviewer/pokemon_helper.rb +++ b/app/helpers/pokeviewer/pokemon_helper.rb @@ -81,8 +81,40 @@ module Pokeviewer points: points.map { |point| point * "," } * " ", class: "pkcv-data") + svg.rect( + x: -40, + y: 460, + rx: 10, + ry: 10, + width: 490, + height: 60, + class: "pkcv-sheen-bg") + + if revision.sheen > 0 + svg.rect( + x: -37, + y: 460, + width: revision.sheen * 490 / 10 - 6, + height: 60, + class: "pkcv-sheen-data") + end + + svg.rect( + x: -40, + y: 460, + rx: 10, + ry: 10, + width: 490, + height: 60, + class: "pkcv-sheen-border") + + svg.text("SHEEN", + x: -20, + y: 500, + class: "pkcv-sheen-label") + tag.svg(svg.to_s.html_safe, - viewBox: "-80 -30 570 430", + viewBox: "-80 -30 570 560", width: "100%", class: "pokemon-condition") end -- cgit 1.4.1