css3 - Is there a way to make CSS animation work diagonally? -
i have made css animation animate text give shine effect it. effect works horizontal. wondering there way change direction of animation make realistic diagonal shine?
here current code:
h1 { font-family: 'bebasregular', sans-serif; font-size: 150px; padding-bottom: 100px; padding-top: 50px; background: #e9ab17 -webkit-gradient(linear, left top, right top, from(#e8a917), to(#f4b011), color-stop(0.5, #fff)) 0 0 no-repeat; -webkit-background-size: 155px; color: rgba(255, 255, 255, 0.1); -webkit-background-clip: text; -webkit-animation-name: shine; -webkit-animation-duration: 5s; -webkit-animation-iteration-count: infinite; } @-webkit-keyframes shine { 0% { background-position: top left; } 28%,100% { background-position: top right; } }
you can change top bottom in ending position:
@-webkit-keyframes shine { 0% { background-position: top left; } 28%,100% { background-position: bottom right; } }
however, effect little noticeable. reason block element, , extends right far beyond end of text. so, diagonal quite flat. can check removing
-webkit-background-clip: text;
property; see h1 , background movement.
to make more "diagonal", need make less "wider"; easier way specify width.
also, if want make shine effect, choose radial gradient instead of linear one. if don't know it, check colorzilla , in orientation choose radial
by way, question sounds familiar me :-)
Comments
Post a Comment