久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

一款帶有發(fā)光動畫的HTML5表單

今天給大家秀一款帶有發(fā)光動畫的HTML5表單,挺酷的,效果圖如下: 當(dāng)表單獲取焦點時,表單四周就會呈現(xiàn)出發(fā)光動畫的效果,并不斷地進(jìn)行顏色漸變;當(dāng)表單失去焦點時,停止發(fā)光。
       今天給大家秀一款帶有發(fā)光動畫的HTML5表單,挺酷的,效果圖如下:

20120130194719_3455.jpg



       當(dāng)表單獲取焦點時,表單四周就會呈現(xiàn)出發(fā)光動畫的效果,并不斷地進(jìn)行顏色漸變;當(dāng)表單失去焦點時,停止發(fā)光。其中顏色漸變的動畫只有基于webkit的瀏覽器才有效果,比如chrome和safari。下面簡單貼一下實現(xiàn)這個發(fā)光HTML5表單的CSS代碼和HTML代碼,如果你喜歡可以將它分享給你的朋友。

       HTML代碼如下:

  1. <div class="rain">
  2.     <div class="border start">
  3.         <form>
  4.             <label for="email">Email</label>
  5.             <input name="email" type="text" placeholder="Email"/>
  6.             <label for="pass">Password</label>
  7.             <input name="pass" type="password" placeholder="Password"/>
  8.                         <input type="submit" value="LOG IN"/>
  9.         </form>
  10.     </div>
  11. </div>
復(fù)制代碼

       CSS代碼如下:

  1. <style>
  2.     body{
  3.         background: #000;
  4.         color: #DDD;
  5.         font-family: 'Helvetica', 'Lucida Grande', 'Arial', sans-serif;
  6.     }
  7.     .border,
  8.     .rain{
  9.         height: 170px;
  10.         width: 320px;
  11.     }
  12.     /* Layout with mask */
  13.     .rain{
  14.          padding: 10px 12px 12px 10px;
  15.          -moz-box-shadow: 10px 10px 10px rgba(0,0,0,1) inset, -9px -9px 8px rgba(0,0,0,1) inset;
  16.          -webkit-box-shadow: 8px 8px 8px rgba(0,0,0,1) inset, -9px -9px 8px rgba(0,0,0,1) inset;
  17.          box-shadow: 8px 8px 8px rgba(0,0,0,1) inset, -9px -9px 8px rgba(0,0,0,1) inset;
  18.          margin: 100px auto;
  19.     }
  20.     /* Artifical "border" to clear border to bypass mask */
  21.     .border{
  22.         padding: 1px;
  23.         -moz-border-radius: 5px;
  24.         -webkit-border-radius: 5px;
  25.         border-radius: 5px;
  26.     }

  27.     .border,
  28.     .rain,
  29.     .border.start,
  30.     .rain.start{
  31.         background-repeat: repeat-x, repeat-x, repeat-x, repeat-x;
  32.         background-position: 0 0, 0 0, 0 0, 0 0;
  33.         /* Blue-ish Green Fallback for Mozilla */
  34.         background-image: -moz-linear-gradient(left, #09BA5E 0%, #00C7CE 15%, #3472CF 26%, #00C7CE 48%, #0CCF91 91%, #09BA5E 100%);
  35.         /* Add "Highlight" Texture to the Animation */
  36.         background-image: -webkit-gradient(linear, left top, right top, color-stop(1%,rgba(0,0,0,.3)), color-stop(23%,rgba(0,0,0,.1)), color-stop(40%,rgba(255,231,87,.1)), color-stop(61%,rgba(255,231,87,.2)), color-stop(70%,rgba(255,231,87,.1)), color-stop(80%,rgba(0,0,0,.1)), color-stop(100%,rgba(0,0,0,.25)));
  37.         /* Starting Color */
  38.         background-color: #39f;
  39.         /* Just do something for IE-suck */
  40.         filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00BA1B', endColorstr='#00BA1B',GradientType=1 );
  41.     }
  42.      
  43.     /* Non-keyframe fallback animation */
  44.     .border.end,
  45.     .rain.end{
  46.         -moz-transition-property: background-position;  
  47.         -moz-transition-duration: 30s;
  48.         -moz-transition-timing-function: linear;
  49.         -webkit-transition-property: background-position;  
  50.         -webkit-transition-duration: 30s;  
  51.         -webkit-transition-timing-function: linear;
  52.         -o-transition-property: background-position;  
  53.         -o-transition-duration: 30s;  
  54.         -o-transition-timing-function: linear;
  55.         transition-property: background-position;  
  56.         transition-duration: 30s;  
  57.         transition-timing-function: linear;
  58.         background-position: -5400px 0, -4600px 0, -3800px 0, -3000px 0;   
  59.     }
  60.      
  61.     /* Keyfram-licious animation */
  62.     @-webkit-keyframes colors {
  63.         0% {background-color: #39f;}
  64.         15% {background-color: #F246C9;}
  65.         30% {background-color: #4453F2;}
  66.         45% {background-color: #44F262;}
  67.         60% {background-color: #F257D4;}
  68.         75% {background-color: #EDF255;}
  69.         90% {background-color: #F20006;}
  70.         100% {background-color: #39f;}
  71.     }
  72.     .border,.rain{
  73.         -webkit-animation-direction: normal;
  74.         -webkit-animation-duration: 20s;
  75.         -webkit-animation-iteration-count: infinite;
  76.         -webkit-animation-name: colors;
  77.         -webkit-animation-timing-function: ease;
  78.     }
  79.      
  80.     /* In-Active State Style */
  81.     .border.unfocus{
  82.         background: #333 !important;   
  83.          -moz-box-shadow: 0px 0px 15px rgba(255,255,255,.2);
  84.          -webkit-box-shadow: 0px 0px 15px rgba(255,255,255,.2);
  85.          box-shadow: 0px 0px 15px rgba(255,255,255,.2);
  86.          -webkit-animation-name: none;
  87.     }
  88.     .rain.unfocus{
  89.         background: #000 !important;   
  90.         -webkit-animation-name: none;
  91.     }
  92.      
  93.     /* Regular Form Styles */
  94.     form{
  95.         background: #212121;
  96.         -moz-border-radius: 5px;
  97.         -webkit-border-radius: 5px;
  98.         border-radius: 5px;
  99.         height: 100%;
  100.         width: 100%;
  101.         background: -moz-radial-gradient(50% 46% 90deg,circle closest-corner, #242424, #090909);
  102.         background: -webkit-gradient(radial, 50% 50%, 0, 50% 50%, 150, from(#242424), to(#090909));
  103.     }
  104.     form label{
  105.         display: block;
  106.         padding: 10px 10px 5px 15px;
  107.         font-size: 11px;
  108.         color: #777;
  109.     }
  110.     form input{
  111.         display: block;
  112.         margin: 5px 10px 10px 15px;
  113.         width: 85%;
  114.         background: #111;
  115.         -moz-box-shadow: 0px 0px 4px #000 inset;
  116.         -webkit-box-shadow: 0px 0px 4px #000 inset;
  117.         box-shadow: 0px 0px 4px #000 inset;
  118.         outline: 1px solid #333;
  119.         border: 1px solid #000;
  120.         padding: 5px;
  121.         color: #444;
  122.         font-size: 16px;
  123.     }
  124.     form input:focus{
  125.         outline: 1px solid #555;
  126.         color: #FFF;
  127.     }
  128.     input[type="submit"]{
  129.         color: #999;
  130.         padding: 5px 10px;
  131.         float: right;
  132.         margin: 40px 0;
  133.         border: 1px solid #000;
  134.         font-weight: lighter;
  135.         -moz-border-radius: 15px;
  136.         -webkit-border-radius: 15px;
  137.         border-radius: 15px;
  138.         background: #45484d;
  139.         background: -moz-linear-gradient(top, #222 0%, #111 100%);
  140.         background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#222), color-stop(100%,#111));
  141.         filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#22222', endColorstr='#11111',GradientType=0 );
  142.         -moz-box-shadow: 0px 1px 1px #000, 0px 1px 0px rgba(255,255,255,.3) inset;
  143.         -webkit-box-shadow: 0px 1px 1px #000, 0px 1px 0px rgba(255,255,255,.3) inset;
  144.         box-shadow: 0px 1px 1px #000,0px 1px 0px rgba(255,255,255,.3) inset;
  145.         text-shadow: 0 1px 1px #000;
  146.         outline: none;
  147.         width:80px;
  148.     }
  149. </style>
復(fù)制代碼

       其中,表單焦點切換需要jquery支持,js代碼如下:

  1. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
  2. <script>
  3.     $(function(){
  4.       var $form_inputs =   $('form input');
  5.       var $rainbow_and_border = $('.rain, .border');
  6.       /* Used to provide loping animations in fallback mode */
  7.       $form_inputs.bind('focus', function(){
  8.         $rainbow_and_border.addClass('end').removeClass('unfocus start');
  9.       });
  10.       $form_inputs.bind('blur', function(){
  11.         $rainbow_and_border.addClass('unfocus start').removeClass('end');
  12.       });
  13.       $form_inputs.first().delay(800).queue(function() {
  14.         $(this).focus();
  15.       });
  16.     });
  17. </script>
復(fù)制代碼


查看效果: http://bbs.html5cn.org/thread-8044-1-1.html 


源代碼下載: 發(fā)光表單.rar
【網(wǎng)站聲明】本站除付費源碼經(jīng)過測試外,其他素材未做測試,不保證完整性,網(wǎng)站上部分源碼僅限學(xué)習(xí)交流,請勿用于商業(yè)用途。如損害你的權(quán)益請聯(lián)系客服QQ:2655101040 給予處理,謝謝支持。

相關(guān)文檔推薦

由于實際運行環(huán)境是在瀏覽器中,因此性能還取決于JavaScript解釋器的效率,指定的FPS幀速在低性能解釋器中可能不會達(dá)到,所以這部分不是開發(fā)者能夠決定的,開發(fā)者能作的是盡可能通
本文將使用HTML5提供的VideoAPI做一個自定義的視頻播放器,需要用到HTML5提供的video標(biāo)簽、以及HTML5提供的對JavascriptAPI的擴(kuò)展。,HTML5中國,中國最大的HTML5中文門戶。
隨著 Hybrid 應(yīng)用的豐富,HTML5 工程師們已經(jīng)不滿足于把桌面端體驗簡單移植到移動端,他們覬覦移動原生應(yīng)用人性化的操作體驗,特別是原生應(yīng)用與生俱來的豐富的手勢系統(tǒng)。HTML5 沒有提
你想要在自己網(wǎng)站上分享一個產(chǎn)品,或者是一個作品集,又或者僅僅只是一個靈感。在你發(fā)布到網(wǎng)上之前,你想讓它看起來有吸引力,專業(yè),或者至少得看起來像那么回事。那么你接下
H5廣告,包括H5廣告的設(shè)計流程,究竟有什么講究,和階段。為了能幫助更多的人了解H5廣告,我專門做了一個講義。同時,也讓我意外的收到了非常好反饋和認(rèn)!這是對我的極大鼓勵!我的
本文主要內(nèi)容有:框架與組件、構(gòu)建生態(tài)、開發(fā)技巧與調(diào)試、html、css與重構(gòu)、native/hybrid/桌面開發(fā)、前端/H5優(yōu)化、全棧/全端開發(fā)、研究實驗、數(shù)據(jù)分析與監(jiān)控、其它軟技能、前端技術(shù)網(wǎng)
主站蜘蛛池模板: 国产一区二区三区四区三区四 | 精品一区二区三区在线观看国产 | 久久com | 欧美二级| 国产激情在线 | 黄色片免费看 | 日韩高清成人 | 一级黄色片毛片 | 亚洲高清在线播放 | 波多野结衣一区二区 | 中文字幕精品一区 | 日本三级网址 | 亚洲精品日韩综合观看成人91 | 国产成人精品999在线观看 | 成人午夜在线 | 午夜精品在线 | 亚洲第一视频网 | 日韩欧美在线免费观看 | 日日操夜夜操天天操 | 亚洲视频中文 | 91在线视频免费观看 | 精品视频在线免费观看 | 盗摄精品av一区二区三区 | 一区二区精品 | 99精品久久99久久久久 | 一区二区三区国产视频 | 特黄毛片 | 在线欧美激情 | 99免费视频| 国产精品久久九九 | 久久久久久久国产精品 | 亚洲成人激情在线观看 | 欧美性生活一区二区三区 | 日韩精品1区2区3区 爱爱综合网 | 日韩欧美天堂 | 久久久成人精品 | 精品久久久久久中文字幕 | 国产亚洲成av人在线观看导航 | 午夜精品一区二区三区在线视频 | 国产二区在线播放 | 99精品国产一区二区三区 |