Original: http://www.cnphp6.com/archives/63838
The main idea of this effect is to add a gradient background to the text, and then crop the background, cut by the text (currently only the WebKit kernel browser supports this property), and finally add animation to the background, that is, change the background of the position, background animation effect is as follows (GIF recording when the lag, code implementation without card):
Final effect:
The full code is as follows:
<!DOCTYPE HTML><HTML><Head> <style>P{width:50%;margin:0 Auto;Line-height:50px;font-size:50px;text-align:Center;-webkit-background-clip:text; /*Crop by text*/-webkit-text-fill-color:Transparent; /*color of text using background color*/Background-color:#19385c; /*set a background color*/Background-image:-webkit-linear-gradient ( -45deg, rgba (0, 0, 0, 0.6) 30%, #aff0ff 50%, rgba (0, 0, 0, 0.6) 70%); /*set the background of the gradient, gradient by diagonal*/Background-blend-mode:Hard-light; /*set the background to strong light mode in mixed mode*/background-size:200%;-webkit-animation:Shine 4s infinite; /*animate background to change location*/ }@-webkit-keyframes Shine{From {background-position:100%;} to{background-position:0;} } </style></Head><Body><P>> Slide to Unlock</P></Body></HTML>
It is necessary to note that this effect is currently not compatible with other kernel browsers because it is currently only available in the WebKit kernel as text clipping.
CSS3 realize iphone swipe to unlock