about summary refs log tree commit diff stats
path: root/app
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2017-10-13 10:31:45 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2017-10-13 10:31:45 -0400
commitcb6eebdf05c95f15ad6ce8968838772a2b915755 (patch)
tree608fddb105ea5787cdbd7ccaa2d690f5846d74ef /app
parenta1a5cb52277d45be323528159addab7971e585a5 (diff)
downloadpokeviewer-cb6eebdf05c95f15ad6ce8968838772a2b915755.tar.gz
pokeviewer-cb6eebdf05c95f15ad6ce8968838772a2b915755.tar.bz2
pokeviewer-cb6eebdf05c95f15ad6ce8968838772a2b915755.zip
Added sheen to Pokémon contest stats
Diffstat (limited to 'app')
-rw-r--r--app/assets/stylesheets/pokeviewer/pokemon.css.scss21
-rw-r--r--app/helpers/pokeviewer/pokemon_helper.rb34
2 files changed, 54 insertions, 1 deletions
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 @@
505 stroke-width: 6; 505 stroke-width: 6;
506 stroke-linejoin: butt; 506 stroke-linejoin: butt;
507 } 507 }
508
509 .pkcv-sheen-bg {
510 fill: #706860;
511 }
512
513 .pkcv-sheen-data {
514 fill: #a048c8;
515 border-top-left-radius: 10px;
516 border-bottom-left-radius: 10px;
517 }
518
519 .pkcv-sheen-border {
520 fill-opacity: 0;
521 stroke-width: 5;
522 stroke: gray;
523 }
524
525 .pkcv-sheen-label {
526 fill: white;
527 font-size: 40px;
528 }
508 } 529 }
509 } 530 }
510} 531}
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
81 points: points.map { |point| point * "," } * " ", 81 points: points.map { |point| point * "," } * " ",
82 class: "pkcv-data") 82 class: "pkcv-data")
83 83
84 svg.rect(
85 x: -40,
86 y: 460,
87 rx: 10,
88 ry: 10,
89 width: 490,
90 height: 60,
91 class: "pkcv-sheen-bg")
92
93 if revision.sheen > 0
94 svg.rect(
95 x: -37,
96 y: 460,
97 width: revision.sheen * 490 / 10 - 6,
98 height: 60,
99 class: "pkcv-sheen-data")
100 end
101
102 svg.rect(
103 x: -40,
104 y: 460,
105 rx: 10,
106 ry: 10,
107 width: 490,
108 height: 60,
109 class: "pkcv-sheen-border")
110
111 svg.text("SHEEN",
112 x: -20,
113 y: 500,
114 class: "pkcv-sheen-label")
115
84 tag.svg(svg.to_s.html_safe, 116 tag.svg(svg.to_s.html_safe,
85 viewBox: "-80 -30 570 430", 117 viewBox: "-80 -30 570 560",
86 width: "100%", 118 width: "100%",
87 class: "pokemon-condition") 119 class: "pokemon-condition")
88 end 120 end