css3实例好代码教程 一款纯css3如何实现的发光屏幕旋转特效

纽扣扣错了可以重扣,但人生不行,除非你选对了人生道路。早上起床你一句早安,晚上睡觉一句晚安。对我来说这就是极有意义的一天。

  今天给大家带来一款纯css3实现的发光屏幕旋转特效。该屏幕由纯css3实现带发光旋转特效,效果图如下:

  实现的代码。

  html代码:

XML/HTML Code复制内容到剪贴板
  1. <divclass="screen">
  2. </div>

  css3代码:

CSS Code复制内容到剪贴板
  1. *{
  2. margin:0;
  3. padding:0;
  4. }
  5. *,
  6. *:before,
  7. *:after{
  8. -webkit-box-sizing:border-box;
  9. -moz-box-sizing:border-box;
  10. box-sizing:border-box;
  11. }
  12. html,body{
  13. height:100%;
  14. }
  15. html{
  16. background-color:#1d1d1d;
  17. }
  18. body{
  19. position:relative;
  20. margin:0;
  21. padding:0;
  22. transform-style:preserve-3d;
  23. -webkit-perspective:500px;
  24. perspective:500px;
  25. }
  26. /*Screen*/
  27. .screen{
  28. position:absolute;
  29. top:50%;
  30. left:50%;
  31. width:320px;
  32. height:210px;
  33. margin-top:-105px;
  34. margin-left:-160px;
  35. border-radius:8px;
  36. box-shadow:0080px#0caba8;
  37. overflow:hidden;
  38. z-index:100000;
  39. -webkit-animation:screenMove012s,
  40. boxShine2.5s2sinfinitealternate,
  41. screenMove025sinfinitealternatelinear;
  42. -moz-animation:screenMove012s,
  43. boxShine2.5s2sinfinitealternate,
  44. screenMove025sinfinitealternatelinear;
  45. -o-animation:screenMove012s,
  46. boxShine2.5s2sinfinitealternate,
  47. screenMove025sinfinitealternatelinear;
  48. animation:screenMove012s,
  49. boxShine2.5s2sinfinitealternate,
  50. screenMove025sinfinitealternatelinear;
  51. }
  52. .screen::before{
  53. display:block;
  54. content:"";
  55. position:absolute;
  56. top:0;
  57. left:0;
  58. width:320px;
  59. height:210px;
  60. border-width:5px;
  61. border-style:solid;
  62. border-image:-webkit-linear-gradient(tobottombottom,rgba(29,186,180,1)0%,rgba(126,252,247,1)26%,rgba(227,253,252,1)30%,rgba(126,252,247,1)36%,rgba(29,186,180,1)52%,rgba(29,186,180,1)74%,rgba(164,247,244,1)91%,rgba(29,186,180,1)100%)1;
  63. border-image:-moz-linear-gradient(tobottombottom,rgba(29,186,180,1)0%,rgba(126,252,247,1)26%,rgba(227,253,252,1)30%,rgba(126,252,247,1)36%,rgba(29,186,180,1)52%,rgba(29,186,180,1)74%,rgba(164,247,244,1)91%,rgba(29,186,180,1)100%)1;
  64. border-image:-o-linear-gradient(tobottombottom,rgba(29,186,180,1)0%,rgba(126,252,247,1)26%,rgba(227,253,252,1)30%,rgba(126,252,247,1)36%,rgba(29,186,180,1)52%,rgba(29,186,180,1)74%,rgba(164,247,244,1)91%,rgba(29,186,180,1)100%)1;
  65. border-image:linear-gradient(tobottombottom,rgba(29,186,180,1)0%,rgba(126,252,247,1)26%,rgba(227,253,252,1)30%,rgba(126,252,247,1)36%,rgba(29,186,180,1)52%,rgba(29,186,180,1)74%,rgba(164,247,244,1)91%,rgba(29,186,180,1)100%)1;
  66. }
  67. .screen::after{
  68. display:block;
  69. content:"";
  70. position:absolute;
  71. top:3px;
  72. left:3px;
  73. width:314px;
  74. height:204px;
  75. border:3pxsolid#1d1d1d;
  76. border-color:rgba(29,29,29,0.9);
  77. border-radius:5px;
  78. background:-webkit-linear-gradient(135deg,rgba(29,186,180,1)0%,rgba(227,253,252,1)17%,rgba(227,253,252,1)25%,rgba(42,197,191,1)48%,rgba(126,252,247,1)93%,rgba(29,186,180,1)100%);
  79. background:-moz-linear-gradient(135deg,rgba(29,186,180,1)0%,rgba(227,253,252,1)17%,rgba(227,253,252,1)25%,rgba(42,197,191,1)48%,rgba(126,252,247,1)93%,rgba(29,186,180,1)100%);
  80. background:-o-linear-gradient(135deg,rgba(29,186,180,1)0%,rgba(227,253,252,1)17%,rgba(227,253,252,1)25%,rgba(42,197,191,1)48%,rgba(126,252,247,1)93%,rgba(29,186,180,1)100%);
  81. background:linear-gradient(135deg,rgba(29,186,180,1)0%,rgba(227,253,252,1)17%,rgba(227,253,252,1)25%,rgba(42,197,191,1)48%,rgba(126,252,247,1)93%,rgba(29,186,180,1)100%);
  82. -webkit-background-size:300%300%;
  83. -moz-background-size:300%300%;
  84. -o-background-size:300%300%;
  85. -ms-background-size:300%300%;
  86. background-size:300%300%;
  87. -webkit-animation:bgShine5sinfinitealternatelinear;
  88. -moz-animation:bgShine5sinfinitealternatelinear;
  89. -o-animation:bgShine5sinfinitealternatelinear;
  90. animation:bgShine5sinfinitealternatelinear;
  91. }
  92. /**/
  93. /*Animation*/
  94. /*screenMove01*/
  95. @-webkit-keyframesscreenMove01{
  96. 0%{opacity:0;top:100%;transform:rotateY(0deg);}
  97. 100%{opacity:1;top:50%;transform:rotateY(-30deg);}
  98. }
  99. @-moz-keyframesscreenMove01{
  100. 0%{opacity:0;top:100%;transform:rotateY(0deg);}
  101. 100%{opacity:1;top:50%;transform:rotateY(-30deg);}
  102. }
  103. @-o-keyframesscreenMove01{
  104. 0%{opacity:0;top:100%;transform:rotateY(0deg);}
  105. 100%{opacity:1;top:50%;transform:rotateY(-30deg);}
  106. }
  107. @keyframesscreenMove01{
  108. 0%{opacity:0;top:100%;transform:rotateY(0deg);}
  109. 100%{opacity:1;top:50%;transform:rotateY(-30deg);}
  110. }
  111. /**/
  112. /*screenMove02*/
  113. @-webkit-keyframesscreenMove02{
  114. 0%{transform:rotateY(-30deg);}
  115. 100%{transform:rotateY(30deg);}
  116. }
  117. @-moz-keyframesscreenMove02{
  118. 0%{transform:rotateY(-30deg);}
  119. 100%{transform:rotateY(30deg);}
  120. }
  121. @-o-keyframesscreenMove02{
  122. 0%{transform:rotateY(-30deg);}
  123. 100%{transform:rotateY(30deg);}
  124. }
  125. @keyframesscreenMove02{
  126. 0%{transform:rotateY(-30deg);}
  127. 100%{transform:rotateY(30deg);}
  128. }
  129. /**/
  130. /*boxshine*/
  131. @-webkit-keyframesboxShine{
  132. 0%{box-shadow:0050px#0caba8;}
  133. 100%{box-shadow:00200px#0caba8;}
  134. }
  135. @-moz-keyframesboxShine{
  136. 0%{box-shadow:0050px#0caba8;}
  137. 100%{box-shadow:00200px#0caba8;}
  138. }
  139. @-o-keyframesboxShine{
  140. 0%{box-shadow:0050px#0caba8;}
  141. 100%{box-shadow:00200px#0caba8;}
  142. }
  143. @keyframesboxShine{
  144. 0%{box-shadow:0050px#0caba8;}
  145. 100%{box-shadow:00200px#0caba8;}
  146. }
  147. /**/
  148. /*bgshine*/
  149. @-webkit-keyframesbgShine{
  150. 0%{-webkit-background-size:300%300%;}
  151. 100%{-webkit-background-size:100%100%;}
  152. }
  153. @-moz-keyframesbgShine{
  154. 0%{-moz-background-size:300%300%;}
  155. 100%{-moz-background-size:100%100%;}
  156. }
  157. @-o-keyframesbgShine{
  158. 0%{-o-background-size:300%300%;}
  159. 100%{-o-background-size:100%100%;}
  160. }
  161. @keyframesbgShine{
  162. 0%{background-size:300%300%;}
  163. 100%{background-size:100%100%;}
  164. }
  165.  

到此这篇关于css3实例好代码教程 一款纯css3如何实现的发光屏幕旋转特效就介绍到这了。害怕失败的人将一事无成。过去所有名人都经受了一个又一个的失败。但是,他们在失败的时候不是沮丧气馁,而是不屈的拼搏,最后取得了胜利。青春时代的真正失败,毋宁说是逃避艰苦的斗争,没有目标,懦弱潦倒。艰苦奋斗后的失败,是人生的宝贵财富。期望你们不好害怕失败,勇敢地度过青春。更多相关css3实例好代码教程 一款纯css3如何实现的发光屏幕旋转特效内容请查看相关栏目,小编编辑不易,再次感谢大家的支持!

您可能有感兴趣的文章
css让页脚保持在底部位置的四种方案

CSS如何使用Flex和Grid布局如何实现3D骰子

Flex布局史上最简单使用语法教程

新的CSS 伪类函数 :is() 和 :where()示例详解

纯CSS打字动画的如何实现示例