Skip to content

Instantly share code, notes, and snippets.

@davidmerrique
Created January 25, 2012 16:49
Show Gist options
  • Save davidmerrique/1677225 to your computer and use it in GitHub Desktop.
Save davidmerrique/1677225 to your computer and use it in GitHub Desktop.
Path Icon Hover - Thanks to Dan Eden
/**
* Path Icon Hover - Thanks to Dan Eden
* Original here: http://dabblet.com/gist/1670215
*
* Dan did a great job emulating the Path icon, so I tried to emulate it without peeking at his code too much.
*/
body {
background: #636864;
height: 100%;
font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
font-size: 14px;
font-weight: 600;
}
.icon {
position: absolute;
top: 50%;
left: 50%;
margin-top: -50px;
margin-left: -50px;
width: 100px;
height: 200px;
text-align: center;
}
.avatar {
position: relative;
width: 100px;
height: 100px;
margin: 0 auto;
border-radius: 100%;
box-shadow: 0 1px 5px 1px rgba(0,0,0,0.6);
overflow: hidden;
cursor: pointer;
}
.icon:hover span.name {
animation: slideIn .6s ease;
animation-fill-mode: both;
}
.avatar img {
width: 100px;
height: 100px;
border-radius: 100%;
display: block;
}
.avatar:after {
content: '';
display: block;
position: absolute;
pointer-events: none;
width: 100%;
height: 100%;
top: 0;
box-shadow: inset 0 0 0 1px rgba(255,255,255,.2);
border-radius: 100%;
}
.icon span {
display: block;
box-sizing: border-box;
background-color: #404040;
background: linear-gradient(top, #404040, #1f1f1e);
color: #fff;
width: 150px;
padding: 10px 15px;
border-radius: 5px;
position: absolute;
top: -60px;
left: 50%;
margin-left: -75px;
border: 1px solid #000;
box-shadow: 0 3px 5px rgba(0,0,0,0.2);
animation: slideOut .6s ease;
animation-fill-mode: both;
}
.icon span:after {
content: '';
display: block;
background: #000;
width: 20px;
height: 20px;
position: absolute;
bottom: -10px;
left: 50%;
margin-left: -10px;
transform: rotate(-45deg);
mask-image: linear-gradient(45deg, #000 50%, transparent 50%);
}
@keyframes slideOut {
to { opacity: 0; transform: translateY(-30px); }
}
@keyframes slideIn {
from { opacity: 0; transform: translateY(20px); }
to { opacity: 1; transform: translateY(0); }
}
<!-- content to be placed inside <body>…</body> -->
<div class="icon">
<span class="name">David Merrique</span>
<div class="avatar">
<img src="http://f.cl.ly/items/0P3U2D2J0w0x3R1d0F1f/sq_pro.jpg" />
</div>
</div>
{"view":"split","prefixfree":"1","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment