HTML
<div class="flex">
<div class="block">
<a href="#" class="toggle"></a>
<div class="small-box">
<h1>Rogie King</h1>
</div>
<div class="content">
<h2>Rogie King</h2>
<p>Rogie King is an illustrator, designer, and programmer who lives and works in the big sky state of Montana. He is the founder of Komodo Media and shares his love of illustration and all things Disney on his blog. Rogie is keen on hot sauce, trance music, and Star Wars. He is hopelessly in love with his wife, Toni, and their two young boys. In their spare time, they like to laugh, go on outdoor adventures, and take road trips.</p>
<img src="https://d13yacurqjgara.cloudfront.net/users/255/screenshots/683315/attachments/61523/rogie.png">
</div>
</div>
</div>
SCSS
* {
box-sizing: border-box;
&::before, &::after {
box-sizing: border-box;
}
}
@-webkit-keyframes fadein {
from { opacity: 0; }
to { opacity: 1; }
}
@keyframes fadein {
from { opacity: 0; }
to { opacity: 1; }
}
html {
height: 100%;
width: 100%;
}
body {
height: 100%;
width: 100%;
padding: 0px;
margin: 0;
font-family: "Source Sans Pro", sans-serif;
background: -webkit-linear-gradient(left, #aeffd5 0%, #b8faf2 100%);
background: linear-gradient(to right, #aeffd5 0%, #b8faf2 100%);
}
h2 {
margin-top: 0;
font-weight: 400;
}
.flex {
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
.block {
height: 200px;
width: 200px;
color: #FFF;
border-top: 1px solid rgba(255, 255, 255, 0.1);
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
text-align: center;
line-height: 200px;
font-size: 18px;
position: relative;
background: linear-gradient(to right, #644cad 0%, #4426a8 100%);
box-shadow: 0px 7px 28px -1px rgba(0,0,0,0.75);
transition: 0.3s all ease;
.small-box {
opacity: 0;
animation: fadein 2s forwards;
animation-delay: 0.5s;
display: flexx;
justify-content: center;
align-items: center;
font-family: "Kaushan Script", cursive;
h1 {
margin: 0;
}
}
&.expanded {
transition: 0.3s all ease;
width: 800px;
height: 400px;
padding: 40px;
line-height: normal;
background: #24252A;
background: -webkit-linear-gradient(left, #644cad 0%, #4426a8 100%);
background: linear-gradient(to right, #644cad 0%, #4426a8 100%);
.small-box {
display: none;
}
}
.content {
text-align: left;
display: none;
opacity: 0;
h2 {
font-family: "Kaushan Script", cursive;
}
p {
line-height: 35px;
}
img {
width: 300px;
position: absolute;
right: 0;
}
&.display {
animation: fadein 2s forwards;
animation-delay: 0.5s;
display: block;
}
}
a {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
z-index: 2;
}
}
@media (max-width: 578px) {
.block.expanded {
height: 100%;
}
.block .content img {
top: 0;
right: 25px;
width: 110px;
}
}