dphuang2 / PoGoBag

Analyze and share your Pokémon through a locally run server! Official Site access has been stopped as of 12/23/2016
146 stars 49 forks source link

Show Icon on Pokémon Card Only if Pokémon is Favorited #65

Open Soilydude opened 8 years ago

Soilydude commented 8 years ago

I'm not particularly well-versed in coding, I've just been tinkering around with some files as a learning experience. I've managed to implement a Favorite sort, and now I'm attempting to show an icon on the Pokémon card if the Pokémon is favorited.

So far, I've implemented this in pokemon.scss with the following addition:

.favorite{
   @include metadata;
    width: 10%;
    right: 7px;
    top: 7.3rem;
    span {
      font-size: 1.8rem;
    }
    .fa-2x{
      font-size: 1.4rem;
    }  
  }

However, this displays an icon on every Pokémon card as well as a binary integer denoting whether the Pokémon is favorited or not. I need to implemenet an IF statement somewhere which will display the favorite icon only if the Pokémon is favorited (e.g. 'if favorite != 0') but I'm not familiar enough with the syntax to know how to implement this.