<div class="box">
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%">
<line class="top" x1="0" y1="0" x2="900" y2="0"/>
<line class="left" x1="0" y1="460" x2="0" y2="-920"/>
<line class="bottom" x1="300" y1="460" x2="-600" y2="460"/>
<line class="right" x1="300" y1="0" x2="300" y2="1380"/>
</svg>
<h3>D</h3>
<span>2012</span>
<span>Broccoli, Asparagus, Curry</span>
</div>
@import url(//fonts.googleapis.com/css?family=Lato:300,400,700|Ruthie);
body {
display: flex;
width: 100vw;
height: 100vh;
justify-content: center;
align-items: center;
background: #2c3e50;
color: #ecf0f1;
font-size: 100%;
line-height: 1.25;
font-family: 'Lato', Arial, sans-serif;
}
.box {
width: 300px;
height: 460px;
position: relative;
background: rgba(255,255,255,1);
cursor: pointer;
color: #2c3e50;
box-shadow: inset 0 0 0 3px #2c3e50;
transition: background 0.4s 0.5s;
text-align: center;
}
.box:hover {
background: rgba(255,255,255,0);
transition-delay: 0s;
}
.box h3 {
font-family: "Ruthie", cursive;
font-size: 180px;
line-height: 370px;
margin: 0;
font-weight: 400;
width: 100%;
}
.box span {
display: block;
font-weight: 400;
text-transform: uppercase;
letter-spacing: 1px;
font-size: 13px;
padding: 5px;
}
.box h3,
.box span {
transition: color 0.4s 0.5s;
}
.box:hover h3,
.box:hover span {
color: #fff;
transition-delay: 0s;
}
.box svg {
position: absolute;
top: 0;
left: 0;
}
.box svg line {
stroke-width: 3;
stroke: #ecf0f1;
fill: none;
transition: all .8s ease-in-out;
}
.box:hover svg line {
transition-delay: 0.1s;
}
.box svg line.top,
.box svg line.bottom {
stroke-dasharray: 330 240;
}
.box svg line.left,
.box svg line.right {
stroke-dasharray: 490 400;
}
.box:hover svg line.top {
transform: translateX(-600px);
}
.box:hover svg line.bottom {
transform: translateX(600px);
}
.box:hover svg line.left {
transform: translateY(920px);
}
.box:hover svg line.right {
transform: translateY(-920px);
}
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.