Skip to content

Instantly share code, notes, and snippets.

@kejun
Last active August 29, 2015 14:08
Show Gist options
  • Save kejun/8b8b50346311db57078a to your computer and use it in GitHub Desktop.
Save kejun/8b8b50346311db57078a to your computer and use it in GitHub Desktop.
Untitled
.pagination {
position: relative;
padding: 10em;
background: #fff;
-webkit-filter: contrast(10);
}
.dot {
position: absolute;
line-height: 10em;
margin-left: 10px;
width: 2em;
height: 2em;
border-radius: 50%;
background: #000;
-webkit-filter: blur(5px);
opacity: 0;
top: 10em;
left: 10em;
cursor: pointer;
-webkit-transition: all .5s ease-in-out;
}
.pagination a {
display: inline-block;
line-height: 10em;
margin-left: 1em;
width: 2em;
height: 2em;
border-radius: 50%;
overflow: hidden;
background: #000;
-webkit-filter: blur(5px);
}
<div class="pagination">
<a href="#">1</a>
<a href="#">2</a>
<a href="#">3</a>
<a href="#">4</a>
<a href="#">5</a>
<span class="dot"></span>
</div>
<p>via: <a href="http://css-tricks.com/shape-blobbing-css/" target="_blank">http://css-tricks.com/shape-blobbing-css</a>
var dot = document.querySelector('.dot');
Array.prototype.slice.call(document.querySelectorAll('a')).forEach(function(a, i) {
a.addEventListener('mouseover', (function(i) {
return function() {
dot.style.opacity = 1;
var x = i == 0 ? 0 : (i - 1)*3 + 4;
dot.style.webkitTransform = 'translate3d(' + x + 'em, 0, 0)';
}
})(i), false);
});
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"result"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment