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/helpers/pokeviewer/pokemon_helper.rb | 34 +++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) (limited to 'app/helpers') 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