CSS3 realize iphone swipe to unlock

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.