Skip to content

Instantly share code, notes, and snippets.

@qHack
Created November 10, 2016 04:21
Show Gist options
  • Save qHack/6314a54a29069a4ece2fd3c5a98789e8 to your computer and use it in GitHub Desktop.
Save qHack/6314a54a29069a4ece2fd3c5a98789e8 to your computer and use it in GitHub Desktop.
img {
border: 0;
}
#dock-container {
position: fixed;
bottom: 0;
text-align: center;
width: 100%;
}
#dock {
position: relative;
display: inline-block;
-webkit-perspective: 400;
-moz-perspective: 400;
}
#dock ul {
font-size: 14px;
padding: 0 30px;
margin: 0;
}
#dock li {
list-style-type: none;
display: inline-block;
position: relative;
}
#dock li span {
display: none;
position: absolute;
bottom: 140px;
left: 0;
width: 100%;
background-color: rgba(0,0,0,.75);
padding: 4px 0;
border-radius: 12px; /* webkit nightly */
-webkit-border-radius: 12px; /* for safari */
-moz-border-radius: 12px;
}
#dock li:hover span {
display: block;
}
#dock li img {
width: 64px;
height: 64px;
margin-bottom: 10px;
-webkit-box-reflect: below 2px
-webkit-gradient(linear, left top, left bottom, from(transparent),
color-stop(0.7, transparent), to(rgba(255,255,255,.5)));
-webkit-box-reflect: below 2px -webkit-linear-gradient(top, transparent, rgba(255,255,255,.3));
-webkit-transition: all 0.3s;
-webkit-transform-origin: 50% 100%;
-moz-transition: all 0.4s;
-moz-transform-origin: 50% 100%;
-o-transition: all 0.3s;
-o-transform-origin: 50% 100%;
}
#dock li:hover img {
-webkit-transform: scale(2);
-moz-transform: scale(2);
-o-transform: scale(2);
margin: 0 2em 10px;
}
/* one element after and element before (with JS)*/
#dock li:hover + li img,
#dock li.prev img {
-webkit-transform: scale(1.4);
-moz-transform: scale(1.4);
-o-transform: scale(1.4);
margin: 0 1.4em 10px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment