<h1>CREDIT CARD</h1>
<div class="cards">
<div class="card front">
<span class="number">1234 5678 9012 3456</span>
<span class="name">PINK FLOYD</span>
<span class="expiration">06/30/2112</span>
<img class="logo" src="https://upload.wikimedia.org/wikipedia/commons/thumb/b/b7/MasterCard_Logo.svg/2000px-MasterCard_Logo.svg.png">
</div>
<div class="card back">
<div class="mag-stripe"></div>
<div class="signature front">See ID <span class="security_code">123</span></div>
<img class="logo back" src="https://upload.wikimedia.org/wikipedia/commons/thumb/b/b7/MasterCard_Logo.svg/2000px-MasterCard_Logo.svg.png">
<span class="front_part">
<span class="number">1234 5678 9012 3456</span>
<span class="name">PINK FLOYD </span>
<span class="expiration">06/30/2112</span></span>
</div>
</div>
<div class="buttons"><h2>Highlight:</h2><button id="Number" data-title="number">Number</button><button id="Exp" data-title="expiration">Expiration Date</button><button id="Name" data-title="name">Name</button><button id="Sec" data-title="security_code">Security Code</button></div>
@import url('https://fonts.googleapis.com/css?family=Gloria+Hallelujah');
$inch: 110px;
$color: #003876;
body {
background: #333;
display: flex; align-items: center;
justify-content: center;
min-height: 100vh;
flex-direction: column;
}
.cards {position:relative; width:2*(4*$inch);
display:block;
display: flex;
margin:15px auto;
}
h1 {
color: #bababa;
font-size: 5em;
letter-spacing: 4px;
margin: 0;
text-align: center;
text-shadow: 2px 2px 2px #000, -2px -2px 1px #fff;
width: 100%;
}
h2{@extend h1; font-size:3em;}
.card {display:inline-block; margin:10px;
background: linear-gradient(135deg, $color 0%,darken(rgba(37,141,200,0.8),15%) 100%);
border-radius: 10px;
font-family: sans-serif;
height: 2.125*$inch;
min-height: 2.125*$inch;
min-width: 3.375*$inch;
position: relative;
width: 3.375*$inch;
&.front {
background: url("https://s3-us-west-2.amazonaws.com/s.cdpn.io/237800/dsotm_copy.jpg") center center / cover;
padding: 20px;
}
&.back {
padding: 20px 20px;
}
box-shadow: 2px 2px 5px #000;
}
.number {
bottom: 30%;
color: #bababa;
font-size: 1.5em;
letter-spacing: 4px;
position: absolute;
text-align: center;
text-shadow: 1px 1px 2px #000, -1px -1px 1px #fff;
width: calc(100% - 40px);
}
.name {
bottom: 10%;
color: #bababa;
letter-spacing: 3px;
position: absolute;
text-shadow: 1px 1px 2px #000, -1px -1px 1px #fff;
}
.expiration {
bottom: 18%;
color: #bababa;
letter-spacing: 4px;
position: absolute;
right: 35%;
text-shadow: 1px 1px 2px #000, -1px -1px 1px #fff;
&:before {
color: transparentize(#fff,0.6);
content: "VALID THRU";
display: inline-block;
font-size: 0.01em;
letter-spacing: 1px;
line-height: 1em;
text-shadow: none;
vertical-align: middle;
width: 35px;
}
}
.mag-stripe {
background: #000;
height: 15%;
left: 0;
position: absolute;
top: 25px;
width: calc(100%);
}
.card.back {
}
.front_part {
display: block;
height: calc(100% - 20px);
left: 0;
padding: 0;
position: absolute;
top: 20px;
transform: rotateY(180deg);
width: calc(100% - 20px);
}
.back .number {
bottom: 30%;
color: $color;
font-size: 1.5em;
letter-spacing: 4px;
position: absolute;
text-align: center;
text-shadow: -1px 1px 2px #333, -1px 1px 1px #000;
width: calc(100% - 40px);
}
.back .name {
bottom: 10%;
color: $color;
fill: transparent;
letter-spacing: 3px;
position: absolute;
text-shadow: -1px 1px 2px #333, -1px 1px 1px #000;
}
.back .expiration {
bottom: 18%;
color: $color;
letter-spacing: 4px;
mix-blend-mode: screen;
position: absolute;
right: 35%;
text-shadow: -1px 1px 2px #333, -1px 1px 1px #000;
&:before {
content: '';
}
}
.signature {
background: #aaa;
font-family: 'Gloria Hallelujah', cursive;
font-size: 40px;
height: 15%;
line-height: 40px;
padding-left: 10px;
position: absolute;
right: 20px;
top: 35%;
vertical-align: middle;
width: 65%;
& .security_code {
background: #fff;
content: "123";
font-family: sans-serif;
font-size: 0.4em;
font-style: italic;
height: 100%;
padding: 0 5px;
position: absolute;
right: 0px;
}
}
.logo {
bottom: 10px;
height: 20%;
position: absolute;
right: 10px;
}
.logo.back {
background: #eee;
border-radius: 50% / 100%;
filter: grayscale(100%);
left: 5px;
opacity: 0.4;
padding: 5px;
top: 40%;
}
.highlight{ &:after{content:''; position:absolute; border:3px solid red; width:100%; height:100%; right:50%; padding:10px; bottom:50%; transform:translatex(50%) translatey(50%); border-radius:100%; transition:all 300ms;}}
.buttons{text-align:center;}
button{background:none; border:2px solid #aaa; color:#fff; font-size:1.2em; padding:0.5em; margin:5px; text-align:center; box-shadow:1px 1px 5px #000;}
View Compiled
$("button").click(function(){var select = $(this).attr("data-title"); $(".highlight").removeClass("highlight"); $(".front ." + select).addClass("highlight");})
jackHarnerSig("light")
This Pen doesn't use any external CSS resources.