十字エフェクト
by ethertank
HTML
<a class="effect_target" href="http://placekitten.com/g/200/300">
<img src="http://placekitten.com/g/200/300" />
<span class="effect"></span>
</a>
CSS
.effect_target {
position: relative;
display: inline-block;
}
.effect_target > .effect {
position: absolute;
display: block;
top: 0;
left: 0;
height: 100%;
width: 100%;
background-size: 100% 100%;
background-repeat: no-repeat;
background-image:
-webkit-linear-gradient(
top,
rgba(255,255,0,0.3),
rgba(255,255,0,0.3)
),
-webkit-linear-gradient(
top,
rgba(0,0,0,0.3),
rgba(0,0,0,0.3)
),
-webkit-linear-gradient(
top,
rgba(0,0,0,0.3),
rgba(0,0,0,0.3)
),
-webkit-linear-gradient(
top,
rgba(0,255,255,0.3),
rgba(0,255,255,0.3)
);
background-position:
left top, right top,
left bottom, right bottom;
-webkit-transition: background-size 0.5s ease-in-out;
}
.effect_target:hover > .effect { background-size: 0 0; }