Skip to content

Instantly share code, notes, and snippets.

@duhoang
Created September 10, 2012 21:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save duhoang/3694081 to your computer and use it in GitHub Desktop.
Save duhoang/3694081 to your computer and use it in GitHub Desktop.
Light streak on hover button
.streak {
position:relative;
*{
position:relative;
z-index:1;
}
&:hover {
&:before {
background: -moz-linear-gradient(-45deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0) 25%, rgba(255,255,255,0.9) 38%, rgba(255,255,255,0.9) 49%, rgba(255,255,255,0) 50%, rgba(255,255,255,0) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, right bottom, color-stop(0%,rgba(255,255,255,0)), color-stop(25%,rgba(255,255,255,0)), color-stop(38%,rgba(255,255,255,0.9)), color-stop(49%,rgba(255,255,255,0.9)), color-stop(50%,rgba(255,255,255,0)), color-stop(100%,rgba(255,255,255,0))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(-45deg, rgba(255,255,255,0) 0%,rgba(255,255,255,0) 25%,rgba(255,255,255,0.9) 38%,rgba(255,255,255,0.9) 49%,rgba(255,255,255,0) 50%,rgba(255,255,255,0) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(-45deg, rgba(255,255,255,0) 0%,rgba(255,255,255,0) 25%,rgba(255,255,255,0.9) 38%,rgba(255,255,255,0.9) 49%,rgba(255,255,255,0) 50%,rgba(255,255,255,0) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(-45deg, rgba(255,255,255,0) 0%,rgba(255,255,255,0) 25%,rgba(255,255,255,0.9) 38%,rgba(255,255,255,0.9) 49%,rgba(255,255,255,0) 50%,rgba(255,255,255,0) 100%); /* IE10+ */
background: linear-gradient(135deg, rgba(255,255,255,0) 0%,rgba(255,255,255,0) 25%,rgba(255,255,255,0.9) 38%,rgba(255,255,255,0.9) 49%,rgba(255,255,255,0) 50%,rgba(255,255,255,0) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ffffff', endColorstr='#00ffffff',GradientType=1 ); /* IE6-8 fallback on horizontal gradient */
background-size:200px 200px;
background-repeat: no-repeat;
background-position:200% 0;
-moz-animation-name: streak;
-moz-animation-iteration-count: 1;
-moz-animation-timing-function: linear;
-moz-animation-duration: .5s;
}
}
&:before {
width:100%;
height:100%;
content:"";
position:absolute;
}
}
@-moz-keyframes streak {
from {
background-position:0 0;
}
to {
background-position:200% 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment