<div class="container">
  <h1>Nubank</h1>
  <p>Just a quick project to recreat Nubank credit card in CSS.</p>
  <div class="cc">
    <span class="chip"></span>
    <span class="nubank-logo"></span>
    <span class="mastercard">MasterCard</span>
    <span class="cc-number">5032 9334 3764 9846</span>
    <span class="cc-date expedition">01/14</span>
    <span class="cc-date expiry">01/99</span>
    <span class="cc-name">Cassio Cardoso</span>
  </div> <!-- /.cc -->
</div>
// TODO
// 1) Create back
// 2) Flip

/*
 * General o>
 *
 * ==================== */
* {
  box-sizing: border-box;
  font-family: 'Consolas', monospace;
  font-size: 14px;
}
.container {
  background: linear-gradient(to bottom, #245e69, #85aeaa);
  bottom: 0;
  color: #e3e3e3;
  display: block;
  left: 0;
  padding-top: 40px;
  position: absolute;
  right: 0;
  text-align: center;
  top: 0;
}

h1 {
  font-size: 60px;
  font-weight: normal;
}

/*
 * The Card
 *
 * ==================== */
.cc,
.cc-back {
  //background: linear-gradient(to left, #70257b, #8a2c94);
  background-color: #6e2b77;
  border-radius: 10px;
  display: block;
  height: 195px;
  letter-spacing: .1rem;
  margin: 60px auto;
  position: relative;
  text-align: left;
  text-transform: uppercase;
  width: 325px;
}

.chip {
  background: #efb77f;
  border-radius: 5px;
  display: block;
  height: 30px;
  left: 30px;
  position: absolute;
  top: 50px;
  width: 40px;
}

.nubank-logo {
  background-image: url('https://www.nubank.com.br/images/eeb5478f.header_logo.png');
  background-position: 50% 50%;
  background-repeat: no-repeat;
  background-size: 80px;
  display: block;
  filter: grayscale(100%);
}
.nubank-logo:after {
  background: linear-gradient(#eee, #999);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  content: 'Platinum';
  display: block;
  text-align: center;
  padding-top: 60px;
}

.cc-number {
  background: linear-gradient(#eee, #999);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  bottom: 75px;
  font-size: 20px;
  left: 30px;
  position: absolute;
}

.cc-date {
  background: linear-gradient(#eee, #999);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  bottom: 40px;
  left: 30px;
  position: absolute;
}

.cc-date.expiry {
  left: 125px;
}
.cc-date.expiry:after {
  -webkit-text-fill-color: #52185b;
  content: 'Valid thru';
  font-size: 8px;
  left: -30px;
  position: absolute;
  text-transform: none;
  top: -10px;
}

.cc-name {
  background: linear-gradient(#eee, #999);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  bottom: 15px;
  left: 30px;
  position: absolute;
}

/*
 * Card back
 */
.cc-magnet {
  background-color: #c0c0c0;
  display: block;
  height: 30px;
  position: absolute;
  top: 15%;
  width: 100%;
}

/*
 * MasterCard logo in pure CSS in just ONE element
 * by Jaime Caballero (jaicab.com)
 */

@import url(https://fonts.googleapis.com/css?family=Droid+Sans:700);

$mcd-red: #cd0001;
$mcd-orange: #fe9900;
$cirrus-dark-blue: #345399;
$cirrus-light-blue: #0085c6;

$mcd-width: 5rem;
$mcd-height: $mcd-width * 3/5;

.mastercard{
  font-family: "Droid Sans", Helvetica, sans-serif;
  position: absolute;
  width: $mcd-width;
  
  font-size: 12px;
  line-height: $mcd-height;
  letter-spacing: -$mcd-width/75;
  text-align: center;
  font-weight: bold;
  font-style: italic;
  color: white;
  text-shadow: -$mcd-height/75 $mcd-height/75 0 #16226a;
  text-transform: none;
  top: -45px;
  right: 30px;
  margin: 20vh auto;
  z-index: 2;
  
  //Circles here
  &::before{
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    display: inline-block;
    border-radius: 50%;
    width: $mcd-height;
    height: $mcd-height;
    z-index: -1;
    
    //Gradient
    background: linear-gradient($mcd-orange 50%, $mcd-red 50%);
    background-size: $mcd-height/8 $mcd-height/8;
    
    //A shadow for the red one (inset) and another for the orange one
    box-shadow: ($mcd-width - $mcd-height) 0 0 0 $mcd-orange,
       ($mcd-width - $mcd-height) 0 0 0 $mcd-red inset;
  }
  
  //Registered trademark
  &::after{
    content: '\00ae';
    padding-left: .5em;
    
    font: .25em Helvetica,sans-serif lighter normal;
    text-shadow: none;
  }
}

.cirrus{
  font-family: "Droid Sans", Helvetica, sans-serif;
  position: absolute;
  width: 4em;
  
  font-size: 12px;
  line-height: $mcd-height/1.5;
  letter-spacing: -$mcd-width/75;
  text-align: center;
  font-weight: bold;
  font-style: italic;
  color: white;
  text-shadow: -$mcd-height/75 $mcd-height/75 0 #16226a;
  text-transform: none;
  top: -20px;
  left: 15px;
  margin: 20vh auto;
  z-index: 2;
  
  //Circles here
  &::before{
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: inline-block;
    border-radius: 50%;
    width: $mcd-height/1.5;
    height: $mcd-height/1.5;
    z-index: -1;
    
    //Gradient
    background: linear-gradient($cirrus-light-blue 50%, $cirrus-dark-blue 50%);
    background-size: $mcd-height/8 $mcd-height/8;
    
    //A shadow for the red one (inset) and another for the orange one
    box-shadow: (($mcd-width - $mcd-height)/1.5) 0 0 0 $cirrus-light-blue,
       (($mcd-width - $mcd-height)/1.5) 0 0 0 $cirrus-dark-blue inset;
  }
  
  //Registered trademark
  &::after{
    content: '\00ae';
    font: .25em Helvetica,sans-serif lighter normal;
    padding-left: .5em;
    text-shadow: none;
  }
}
View Compiled

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.