diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2018-07-04 14:42:21 -0400 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2018-07-04 14:42:21 -0400 |
commit | a70494be4e1767e0cb7ff4218e7f266ece56089c (patch) | |
tree | 9e9c93272e8ed4d55091ba4a61f2787e1229a958 /app/assets | |
parent | 006cf8cebfb4e2d2dcfc537b6d3ccaaa14e28cfc (diff) | |
download | pokeviewer-a70494be4e1767e0cb7ff4218e7f266ece56089c.tar.gz pokeviewer-a70494be4e1767e0cb7ff4218e7f266ece56089c.tar.bz2 pokeviewer-a70494be4e1767e0cb7ff4218e7f266ece56089c.zip |
Made pokemon embeddable
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/pokeviewer/pokemon.js.coffee | 10 | ||||
-rw-r--r-- | app/assets/stylesheets/pokeviewer/pokemon.css.scss | 94 |
2 files changed, 104 insertions, 0 deletions
diff --git a/app/assets/javascripts/pokeviewer/pokemon.js.coffee b/app/assets/javascripts/pokeviewer/pokemon.js.coffee index a6fd326..e80ae77 100644 --- a/app/assets/javascripts/pokeviewer/pokemon.js.coffee +++ b/app/assets/javascripts/pokeviewer/pokemon.js.coffee | |||
@@ -1,3 +1,9 @@ | |||
1 | show_pokemon_tab = (tab) -> | ||
2 | $(".pokemon-tab").hide() | ||
3 | $(".ptabe-button").removeClass("active") | ||
4 | $(".pokemon-" + tab).show() | ||
5 | $(".ptabe-" + tab).addClass("active") | ||
6 | |||
1 | $ -> | 7 | $ -> |
2 | $(".pkv-has-hover").mouseover -> | 8 | $(".pkv-has-hover").mouseover -> |
3 | $(this).children(".pkv-hover").show() | 9 | $(this).children(".pkv-hover").show() |
@@ -7,3 +13,7 @@ $ -> | |||
7 | $(this).children(".pkv-hover").offset({left: event.pageX + 16, top: event.pageY - 16}) | 13 | $(this).children(".pkv-hover").offset({left: event.pageX + 16, top: event.pageY - 16}) |
8 | $(".in-emerald .pokemon-image img").mouseover -> | 14 | $(".in-emerald .pokemon-image img").mouseover -> |
9 | $(this).attr("src", $(this)[0].src) | 15 | $(this).attr("src", $(this)[0].src) |
16 | $(".ptabe-button a").click -> | ||
17 | show_pokemon_tab($(this).data("tab")) | ||
18 | if $("#pokemon-embed").length > 0 | ||
19 | show_pokemon_tab("details") | ||
diff --git a/app/assets/stylesheets/pokeviewer/pokemon.css.scss b/app/assets/stylesheets/pokeviewer/pokemon.css.scss index 1b1ce5d..df2a184 100644 --- a/app/assets/stylesheets/pokeviewer/pokemon.css.scss +++ b/app/assets/stylesheets/pokeviewer/pokemon.css.scss | |||
@@ -200,6 +200,15 @@ | |||
200 | .pokemon-name { | 200 | .pokemon-name { |
201 | font-weight: bold; | 201 | font-weight: bold; |
202 | white-space: pre; | 202 | white-space: pre; |
203 | |||
204 | a { | ||
205 | color: blue; | ||
206 | text-decoration: none; | ||
207 | |||
208 | &:hover { | ||
209 | text-decoration: underline; | ||
210 | } | ||
211 | } | ||
203 | } | 212 | } |
204 | 213 | ||
205 | &.in-emerald { | 214 | &.in-emerald { |
@@ -578,3 +587,88 @@ | |||
578 | .clear { | 587 | .clear { |
579 | clear: both; | 588 | clear: both; |
580 | } | 589 | } |
590 | |||
591 | #pokemon-embed { | ||
592 | width: 350px; | ||
593 | margin: 1em; | ||
594 | |||
595 | #pokemon-embed-tabs { | ||
596 | margin: 0; | ||
597 | padding: 0; | ||
598 | text-align: right; | ||
599 | |||
600 | li { | ||
601 | display: inline-block; | ||
602 | padding: 3px; | ||
603 | border-width: 1px 1px 0 1px; | ||
604 | border-style: solid; | ||
605 | border-color: #888; | ||
606 | border-top-left-radius: 4px; | ||
607 | border-top-right-radius: 4px; | ||
608 | |||
609 | a { | ||
610 | font-family: 'Power Green'; | ||
611 | color: white; | ||
612 | text-decoration: none; | ||
613 | text-transform: uppercase; | ||
614 | } | ||
615 | |||
616 | &.ptabe-details { | ||
617 | background-color: #94c49c; | ||
618 | |||
619 | &.active, &:hover { | ||
620 | background-color: #84ac88; | ||
621 | } | ||
622 | } | ||
623 | |||
624 | &.ptabe-stats { | ||
625 | background-color: #8890f8; | ||
626 | |||
627 | &.active, &:hover { | ||
628 | background-color: #6870d8; | ||
629 | } | ||
630 | } | ||
631 | |||
632 | &.ptabe-moves { | ||
633 | background-color: #f7aca6; | ||
634 | |||
635 | &.active, &:hover { | ||
636 | background-color: #ff847c; | ||
637 | } | ||
638 | } | ||
639 | |||
640 | &.ptabe-contest { | ||
641 | background-color: #b9d7f2; | ||
642 | |||
643 | &.active, &:hover { | ||
644 | background-color: #63aef2; | ||
645 | } | ||
646 | } | ||
647 | |||
648 | &.ptabe-ribbons { | ||
649 | background-color: #f8d8f8; | ||
650 | |||
651 | &.active, &:hover { | ||
652 | background-color: #f8a0f8; | ||
653 | } | ||
654 | } | ||
655 | } | ||
656 | } | ||
657 | |||
658 | .pokemon { | ||
659 | margin: 0; | ||
660 | } | ||
661 | |||
662 | .pokemon-tab { | ||
663 | display: none; | ||
664 | } | ||
665 | } | ||
666 | |||
667 | #pk-embed-code { | ||
668 | width: 50%; | ||
669 | |||
670 | textarea { | ||
671 | width: 100%; | ||
672 | height: 4em; | ||
673 | } | ||
674 | } | ||