Info Card With Labels

By Rafi

F6
#
How do I use This?

Cards good for a callout, offer, warning or other info.

HTML
<div class="card-info success">
  <div class="card-info-label">
    <div class="card-info-label-text">
      Win!
    </div>
  </div>
  <div class="card-info-content">
    <h3 class="lead"> Mad Max: Fury Road</h3>
    <p>In a post-apocalyptic world, in which people fight to the death, Max teams up with a mysterious woman, Furiousa, to try and survive.</p>
  </div>
</div>

<div class="card-info primary">
  <div class="card-info-label">
    <div class="card-info-label-text">
      Blue
    </div>
  </div>
  <div class="card-info-content">
    <h3 class="lead">Star Wars: Episode VII - The Force Awakens</h3>
    <p>A continuation of the saga created by George Lucas set thirty years after Star Wars: Episode VI - Return of the Jedi.</p>
  </div>
</div>

<div class="card-info secondary">
  <div class="card-info-label">
    <div class="card-info-label-text">
      Deal
    </div>
  </div>
  <div class="card-info-content">
    <h3 class="lead">Terminator Genisys</h3>
    <p>After finding himself in a new time-line, Kyle Reese teams up with John Connor's mother Sarah and an aging terminator to try and stop the one thing that the future fears, "Judgement Day".</p>
  </div>
</div>

<div class="card-info info">
  <div class="card-info-label">
    <div class="card-info-label-text">
      FYI
    </div>
  </div>
  <div class="card-info-content">
    <h3 class="lead">Chappie</h3>
    <p>In the near future, crime is patrolled by a mechanized police force. When one police droid, Chappie, is stolen and given new programming, he becomes the first robot with the ability to think and feel for himself.</p>
  </div>
</div>

<div class="card-info alert">
  <div class="card-info-label">
    <div class="card-info-label-text">
      Stop
    </div>
  </div>
  <div class="card-info-content">
    <h3 class="lead"> Poltergeist</h3>
    <p>A family's suburban home is invaded by evil forces.
    </p>
  </div>
</div>

<div class="card-info warning">
  <div class="card-info-label">
    <div class="card-info-label-text">
      Hey!
    </div>
  </div>
  <div class="card-info-content">
    <h3 class="lead">Jurassic World</h3>
    <p>Twenty-two years after the events of Jurassic Park, Isla Nublar now features a fully functioning dinosaur theme park, Jurassic World, as originally envisioned by John Hammond. After 10 years of operation and visitor rates declining, in order to fulfill a corporate mandate, a new attraction is created to re-spark visitor's interest, which backfires horribly.
    </p>
  </div>
</div>

<div class="card-info">
  <div class="card-info-label">
    <div class="card-info-label-text">
      Yo!
    </div>
  </div>
  <div class="card-info-content">
    <h3 class="lead"> Avengers: Age of Ultron </h3>
    <p>When Tony Stark tries to jumpstart a dormant peacekeeping program, things go awry and it is up to the Avengers to stop the villainous Ultron from enacting his terrible plans.</p>
  </div>
</div>

<div class="card-info alert">
  <div class="card-info-label">
    <div class="card-info-label-text">
      Sale
    </div>
  </div>
  <div class="card-info-content">
    <h3 class="lead"> Death Star</h3>
    <img src="https://img2.wikia.nocookie.net/__cb20090309234126/starwars/images/e/ee/DeathStar2.jpg" alt="death star" />
    <p>The Death Star was a moon-sized Imperial military battlestation armed with a planet-destroying superlaser.</p>
  </div>
</div>


$card-info-bg: $white;
$card-info-font-color: $body-font-color;
$card-info-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
$card-info-info-color: lighten($primary-color, 15%);
$card-info-border-radius: $global-radius;

.card-info {
  background: $card-info-bg;
  border: 1px solid $dark-gray;
  box-shadow: $card-info-shadow;
  margin: 1rem 0;
  overflow: hidden;
  border-radius: $card-info-border-radius;

  .card-info-label {
    border-color: transparent $dark-gray transparent transparent;
    border-color: rgba(255,255,255,0) $dark-gray rgba(255,255,255,0) rgba(255,255,255,0);
  }

  &.primary {
    border-color: $primary-color;

    .card-info-label {
      border-color: transparent $primary-color transparent transparent;
      border-color: rgba(255,255,255,0) $primary-color rgba(255,255,255,0) rgba(255,255,255,0);
    }
  }

  &.secondary {
    border-color: $secondary-color;

    .card-info-label {
      border-color: transparent $secondary-color transparent transparent;
      border-color: rgba(255,255,255,0) $secondary-color rgba(255,255,255,0) rgba(255,255,255,0);
    }
  }

  &.info {
    border-color: $card-info-info-color;

    .card-info-label {
      border-color: transparent $card-info-info-color transparent transparent;
      border-color: rgba(255,255,255,0) $card-info-info-color rgba(255,255,255,0) rgba(255,255,255,0);
    }
  }

  &.alert {
    border-color: $alert-color;

    .card-info-label {
      border-color: transparent $alert-color transparent transparent;
      border-color: rgba(255,255,255,0) $alert-color rgba(255,255,255,0) rgba(255,255,255,0);
    }
  }

  &.success {
    border-color: $success-color;

    .card-info-label {
      border-color: transparent $success-color transparent transparent;
      border-color: rgba(255,255,255,0) $success-color rgba(255,255,255,0) rgba(255,255,255,0);
    }
  }

  &.warning {
    border-color: $warning-color;

    .card-info-label {
      border-color: transparent $warning-color transparent transparent;
      border-color: rgba(255,255,255,0) $warning-color rgba(255,255,255,0) rgba(255,255,255,0);
    }
  }

  .card-info-label {
    border-style: solid;
    border-width: 0 rem-calc(70) rem-calc(40) 0;
    float: right;
    height: 0px;
    width: 0px;
    transform:rotate(360deg);
  }

  .card-info-content {
    padding: 0.5rem 1.5rem 0.875rem;
  }

  .card-info-label-text {
    color: $white;
    font-size: 0.75rem;
    font-weight: bold;
    position: relative;
    right: rem-calc(-40);
    top: 2px;
    white-space: nowrap;
    transform: rotate(30deg);
  }
}


.card-info {
  background: #fefefe;
  border: 1px solid #8a8a8a;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  margin: 1rem 0;
  overflow: hidden;
  border-radius: 0;
}

.card-info .card-info-label {
  border-color: transparent #8a8a8a transparent transparent;
  border-color: rgba(255, 255, 255, 0) #8a8a8a rgba(255, 255, 255, 0) rgba(255, 255, 255, 0);
}

.card-info.primary {
  border-color: #1779ba;
}

.card-info.primary .card-info-label {
  border-color: transparent #1779ba transparent transparent;
  border-color: rgba(255, 255, 255, 0) #1779ba rgba(255, 255, 255, 0) rgba(255, 255, 255, 0);
}

.card-info.secondary {
  border-color: #767676;
}

.card-info.secondary .card-info-label {
  border-color: transparent #767676 transparent transparent;
  border-color: rgba(255, 255, 255, 0) #767676 rgba(255, 255, 255, 0) rgba(255, 255, 255, 0);
}

.card-info.info {
  border-color: #37a0e6;
}

.card-info.info .card-info-label {
  border-color: transparent #37a0e6 transparent transparent;
  border-color: rgba(255, 255, 255, 0) #37a0e6 rgba(255, 255, 255, 0) rgba(255, 255, 255, 0);
}

.card-info.alert {
  border-color: #cc4b37;
}

.card-info.alert .card-info-label {
  border-color: transparent #cc4b37 transparent transparent;
  border-color: rgba(255, 255, 255, 0) #cc4b37 rgba(255, 255, 255, 0) rgba(255, 255, 255, 0);
}

.card-info.success {
  border-color: #3adb76;
}

.card-info.success .card-info-label {
  border-color: transparent #3adb76 transparent transparent;
  border-color: rgba(255, 255, 255, 0) #3adb76 rgba(255, 255, 255, 0) rgba(255, 255, 255, 0);
}

.card-info.warning {
  border-color: #ffae00;
}

.card-info.warning .card-info-label {
  border-color: transparent #ffae00 transparent transparent;
  border-color: rgba(255, 255, 255, 0) #ffae00 rgba(255, 255, 255, 0) rgba(255, 255, 255, 0);
}

.card-info .card-info-label {
  border-style: solid;
  border-width: 0 4.375rem 2.5rem 0;
  float: right;
  height: 0px;
  width: 0px;
  -webkit-transform: rotate(360deg);
      -ms-transform: rotate(360deg);
          transform: rotate(360deg);
}

.card-info .card-info-content {
  padding: 0.5rem 1.5rem 0.875rem;
}

.card-info .card-info-label-text {
  color: #fefefe;
  font-size: 0.75rem;
  font-weight: bold;
  position: relative;
  right: -2.5rem;
  top: 2px;
  white-space: nowrap;
  -webkit-transform: rotate(30deg);
      -ms-transform: rotate(30deg);
          transform: rotate(30deg);
}

JS