<div class="container">
<div class="container__elements">
<img class="instructions" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/3522775/ClickCard.png" alt="click here">
<div class="card__container">
<div class="card__container-body">
<div class="card__container-body-content">
<css-doodle>
:doodle {
@grid: 25 / 75vmax;
}
background: #CAA97C;
clip-path: ellipse(100% 100% at @pick('0 0', '0 100%', '100% 0', '100% 100%'));
</css-doodle>
</div>
</div>
</div>
</div>
<!-- Social Connections -->
<div class="social-icons">
<a class="social-icon social-icon--codepen" href="https://codepen.io/braydoncoyer" target="_blank">
<i class="fa fa-codepen"></i>
<div class="tooltip">Codepen</div>
</a>
<a class="social-icon social-icon--twitter" href="https://twitter.com/BraydonCoyer" target="_blank">
<i class="fa fa-twitter"></i>
<div class="tooltip">Twitter</div>
</a>
</div>
</div>
$background: #5A5245;
$card-body-bg: #C24435;
$card-outer: #FCF9F4;
$card-decorations: #CAA97C;
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
.container {
display: flex;
justify-content: center;
align-items: center;
min-height:100vh;
background: $background;
&__elements {
position: relative;
}
}
.card__container {
width: 300px;
height: 425px;
background-color: $card-outer;
border-radius: 15px;
padding: 20px;
&-body {
width: 100%;
height: 100%;
background-color: $card-body-bg;
border-radius: 5px;
padding: 8px;
&-content {
height: 100%;
width: 100%;
border: 2px solid $card-decorations;
border-radius: 2px;
overflow: hidden;
}
}
}
.instructions {
width: 150px;
position: absolute;
left: -175px;
top: 150px;
animation: fade 5s infinite;
}
@keyframes fade {
0%,100% { opacity: 0 }
50% { opacity: 1 }
}
/* --------Social Icons-------- */
/* Color Variables */
$color-codepen: #000;
$color-twitter: #2b97f1;
/* Social Icon Mixin */
@mixin social-icon($color) {
background: $color;
color: #fff;
.tooltip {
background: $color;
color: currentColor;
&:after {
border-top-color: $color;
}
}
}
.social-icons {
display: flex;
position: absolute;
bottom: 25px;
right: 25px;
}
.social-icon {
display: flex;
align-items: center;
justify-content: center;
position: relative;
width: 40px;
height: 40px;
margin: 0 0.7rem;
border-radius: 50%;
cursor: pointer;
font-family: "Helvetica Neue", "Helvetica", "Arial", sans-serif;
font-size: 1.5rem;
text-decoration: none;
transition: all 0.15s ease;
&:hover {
color: #fff;
.tooltip {
visibility: visible;
opacity: 1;
transform: translate(-50%, -150%);
}
}
&:active {
box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.5) inset;
}
&--twitter { @include social-icon($color-twitter); }
&--codepen { @include social-icon($color-codepen); }
i {
position: relative;
top: 1px;
}
}
/* Tooltips */
.tooltip {
display: block;
position: absolute;
top: 0;
left: 50%;
padding: 0.4rem 0.6rem;
border-radius: 40px;
font-size: 0.4rem;
font-weight: bold;
opacity: 0;
pointer-events: none;
text-transform: uppercase;
transform: translate(-50%, -100%);
transition: all 0.3s ease;
z-index: 1;
&:after {
display: block;
position: absolute;
bottom: 1px;
left: 50%;
width: 0;
height: 0;
content: "";
border: solid;
border-width: 10px 10px 0 10px;
border-color: transparent;
transform: translate(-50%, 100%);
}
}
View Compiled
const doodle = document.querySelector("css-doodle");
window.addEventListener("click", () => doodle.update());
View Compiled
This Pen doesn't use any external CSS resources.