SGV hover Shape warp Effects
http://tympanus.net/codrops/2014/01/07/shape-hover-effect-with-svg/
HTML
<script src="http://www.sdelgado.com/scripts/snap.svg-min.js"></script>
<section id="grid" class="grid clearfix">
<a href="#" data-path-hover="m 180,34.57627 -180,0 L 0,0 180,0 z">
<figure>
<img src="http://lorempixel.com/200/400/" />
<svg viewBox="0 0 180 320" preserveAspectRatio="none"><path d="M 180,130 0,218 0,0 180,0 z"/></svg>
<figcaption>
<h2>Crystalline</h2>
<p>Soko radicchio bunya nuts gram dulse.</p>
</figcaption>
</figure>
</a>
<a href="#" data-path-hover="m 0,0 0,47.7775 c 24.580441,3.12569 55.897012,-8.199417 90,-8.199417 34.10299,0 65.41956,11.325107 90,8.199417 L 180,0 z">
<figure>
<img src="http://lorempixel.com/200/400/" />
<svg viewBox="0 0 180 320" preserveAspectRatio="none"><path d="m 0,0 0,171.14385 c 24.580441,15.47138 55.897012,24.75772 90,24.75772 34.10299,0 65.41956,-9.28634 90,-24.75772 L 180,0 0,0 z"/></svg>
<figcaption>
<h2>Crystalline</h2>
<p>Soko radicchio bunya nuts gram dulse.</p>
</figcaption>
</figure>
</a>
<a href="#" data-path-hover="M 0,0 0,38 90,58 180.5,38 180,0 z">
<figure>
<img src="http://lorempixel.com/200/400/" />
<svg viewBox="0 0 180 320" preserveAspectRatio="none"><path d="M 0 0 L 0 182 L 90 126.5 L 180 182 L 180 0 L 0 0 z "/></svg>
<figcaption>
<h2>Cacophony</h2>
<p>Two greens tigernut soybean radish.</p>
</figcaption>
</figure>
</a>
</section>
</div>
<!-- /container -->
CSS
body {
background: #eee;
color: #fff;
font-weight: 400;
font-size: 1em;
}
/* Common style */
.grid a {
float: left;
max-width: 250px;
width: 25%;
color: #333;
}
.grid figure {
position: relative;
overflow: hidden;
margin: 5px;
background: #333;
}
.grid figure img {
position: relative;
display: block;
width: 100%;
opacity: 0.7;
-webkit-transition: opacity 0.3s;
transition: opacity 0.3s;
}
.grid figcaption {
position: absolute;
top: 0;
z-index: 11;
padding: 10px;
width: 100%;
height: 100%;
text-align: center;
}
.grid figcaption h2 {
margin: 0 0 20px 0;
color: #3498db;
text-transform: uppercase;
letter-spacing: 1px;
font-weight: 300;
font-size: 130%;
-webkit-transition: -webkit-transform 0.3s;
transition: transform 0.3s;
}
.grid figcaption p {
padding: 0 20px;
color: #aaa;
font-weight: 300;
-webkit-transition: opacity 0.3s, -webkit-transform 0.3s;
transition: opacity 0.3s, transform 0.3s;
}
.grid figcaption h2, .grid figcaption p {
-webkit-transform: translateY(50px);
transform: translateY(50px);
}
.grid figure button {
position: absolute;
padding: 4px 20px;
border: none;
text-transform: uppercase;
letter-spacing: 1px;
font-weight: bold;
-webkit-transition: opacity 0.3s, -webkit-transform 0.3s;
transition: opacity 0.3s, transform 0.3s;
}
.grid figcaption, .grid figcaption h2, .grid figcaption p, .grid figure button {
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
}
/* Style for SVG */
.grid svg {
position: absolute;
top: -1px;
/* fixes rendering issue in FF */
z-index: 10;
width: 100%;
height: 100%;
}
.grid svg path {
fill: #fff;
}
/* Hover effects */
.grid a:hover figure img {
opacity: 1;
}
.grid a:hover figcaption h2, .grid a:hover figcaption p {
-webkit-transform: translateY(0);
transform:...
JavaScript
c(function () {
function init() {
var speed = 250,
easing = mina.easeinout;
[].slice.call(document.querySelectorAll('#grid > a')).forEach(function (el) {
var s = Snap(el.querySelector('svg')),
path = s.select('path'),
pathConfig = {
from: path.attr('d'),
to: el.getAttribute('data-path-hover')
};
el.addEventListener('mouseenter', function () {
path.animate({
'path': pathConfig.to
}, speed, easing);
});
el.addEventListener('mouseleave', function () {
path.animate({
'path': pathConfig.from
}, speed, easing);
});
});
}
init();
})();