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

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -