CSS3绘画:一个安卓机器人!

开发 前端
主要是径向渐变,和线性渐变调出高光的效果,其他的没什么难的!头,身体,四肢,一步步来画!所有的形状都是div的圆角弄出来的,其次注意颜色的细微变化就好了!

你也许在网上看过这样的图片,我也是照着样子画的!

主要是径向渐变,和线性渐变调出高光的效果,其他的没什么难的!

头,身体,四肢,一步步来画!所有的形状都是div的圆角弄出来的,其次注意颜色的细微变化就好了!

[[80205]] 

我写的比较冗余,大家随便看看吧!

  1. <!DOCTYPE html> 
  2. <html> 
  3. <head> 
  4. <title>纯css打造安卓机器人</title> 
  5. <style type="text/css"> 
  6. body { font-family:"Lucida Sans Unicode"; font-size:14px; color:#4b4b4b; text-align:center; }  
  7. * { padding:0px; margin:0px; }  
  8. #container { position:relative; margin-left:auto; margin-right:auto; margin-top:50px;   
  9. width:700px; height:320px; text-align:left; vertical-align:top; }  
  10. #az,#az_head,#az_body,#az_lhand,#az_rhand,#az_lfoot,#az_rfoot,#az_line,#sword { position:absolute; }  
  11. #az { margin-left:300px; }  
  12. #az:before { content:''; position:absolute; top:350px; left:-270px; width:500px; height:50px; z-index:-10;  
  13. background:rgba(0,0,0,0.7);  
  14. border-radius:200px 200px 200px 200px / 25px 25px 25px 25px;  
  15. box-shadow:0 0 10px 10px rgba(0,0,0,0.5); }  
  16. #az_head { height:110px; width:220px; overflow:hidden; z-index:5;  
  17. border-radius:110px 110px 110px 110px / 100px 100px 10px 10px;  
  18. background:-moz-radial-gradient(74% 32%, ellipse, rgba(159,189,68,1) 0%, rgba(129,169,14,1) 12%, rgba(44,62,0,1) 100%);  
  19. background:-o-radial-gradient(74% 32%, ellipse, rgba(159,189,68,1) 0%, rgba(129,169,14,1) 12%, rgba(44,62,0,1) 100%);  
  20. background:-webkit-gradient(radial, 166 36, 0, 156 36, 160, from(rgba(159,189,68,1)), to(rgba(44,62,0,1)), color-stop(12%, rgba(129,169,14,1)));  
  21. }  
  22. #az_head:before { content:''; position:absolute; width:18px; height:22px; background:#fffa64;  
  23. top:50px; left:30px;  
  24. border-radius:9px / 11px;  
  25. box-shadow:inset 1px 1px 3px #000, 0 0 15px #fffa64;   
  26. transform:rotate(20deg);  
  27. -moz-transform:rotate(20deg);  
  28. -o-transform:rotate(20deg);  
  29. -webkit-transform:rotate(20deg);  
  30. }  
  31. #az_head:after { content:''; position:absolute; width:18px; height:22px; background:#fffa64;  
  32. top:50px; left:136px;  
  33. border-radius:9px / 11px;  
  34. box-shadow:inset 1px 1px 3px #000, 0 0 15px #fffa64;   
  35. transform:rotate(-2deg);  
  36. -moz-transform:rotate(-2deg);  
  37. -o-transform:rotate(-2deg);  
  38. -webkit-transform:rotate(-2deg); }  
  39. #az_body { width:220px; height:200px; background:red; top:103px;  
  40. border-radius:110px 110px 110px 110px / 10px 10px 40px 40px;  
  41. background:-moz-linear-gradient(center left, rgba(44,62,0,1), rgba(109,149,4,1) 66%, rgba(109,149,4,1) 70%, rgba(64,82,20,1));  
  42. background:-webkit-gradient(linear, left center, right center, from(rgba(44,62,0,1)), color-stop(66%,rgba(109,149,4,1)), color-stop(70%,rgba(109,149,4,1)), to(rgba(64,82,20,1)));  
  43. background:-o-linear-gradient(left, rgba(44,62,0,1), rgba(109,149,4,1) 66%, rgba(109,149,4,1) 70%, rgba(64,82,20,1)); }  
  44. #az_body:before { content:''; position:absolute; width:100%; height:16px; background:#1f3204;  
  45. border-radius:110px 110px 110px 110px / 10px 10px 10px 10px; }  
  46. #az_body:after { content:''; position:absolute; width:100%; height:80px; background:#1f3204; top:120px;  
  47. border-radius:0 0 110px 110px / 0 0 40px 40px;  
  48. background:-moz-linear-gradient(center top, transparent, transparent 50%, rgba(64,82,20,1));  
  49. background:-webkit-gradient(linear, center top, center bottom, from(transparent), color-stop(60%, transparent), to(rgba(64,82,20,1)));  
  50. background:-o-linear-gradient(top, transparent, transparent 50%, rgba(44,62,0,1)); }  
  51. #az_lhand { z-index:-1; width:136px; height:46px; left:-88px; top:148px;  
  52. border-radius:23px;  
  53. transform:rotate(-30deg);  
  54. -moz-transform:rotate(-30deg);  
  55. -o-transform:rotate(-30deg);  
  56. -webkit-transform:rotate(-30deg);  
  57. background:-moz-linear-gradient(top, rgba(44,62,0,1), rgba(109,149,4,1) 55%, rgba(109,149,4,1) 60%, rgba(64,82,20,1));  
  58. background:-webkit-gradient(linear, center top, center bottom, from(rgba(44,62,0,1)), color-stop(55%,rgba(109,149,4,1)), color-stop(60%,rgba(109,149,4,1)), to(rgba(64,82,20,1)));  
  59. background:-o-linear-gradient(top, rgba(44,62,0,1), rgba(109,149,4,1) 55%, rgba(109,149,4,1) 60%, rgba(64,82,20,1)); }  
  60. #az_lhand:before { position:absolute; height:100%; width:50px; content:'';  
  61. border-radius:23px;  
  62. background:-moz-linear-gradient(center left, rgba(44,62,0,1), transparent 50%, transparent);  
  63. background:-webkit-gradient(linear, left center,right center, from(rgba(44,62,0,1)), color-stop(50%, transparent), to(transparent));  
  64. background:-o-linear-gradient(left, rgba(44,62,0,1), transparent 50%, transparent); }  
  65. #az_rhand { width:50px; height:136px; left:188px; top:130px;  
  66. border-radius:25px;  
  67. background:-moz-linear-gradient(left, rgba(70,88,26,1), rgba(139,179,24,1) 70%, rgba(109,149,4,1) 100%);  
  68. background:-webkit-gradient(linear, left center, right center, from(rgba(70,88,26,1)), color-stop(70%,rgba(139,179,24,1)), to(rgba(109,149,4,1)));  
  69. background:-o-linear-gradient(left, rgba(70,88,26,1), rgba(109,149,4,1) 70%, rgba(64,82,20,1));  
  70. box-shadow:-10px 6px 12px rgba(0,0,0,0.5); }  
  71. #az_rhand:before { position:absolute; height:46px; width:100%; content:''; top:90px;  
  72. border-radius:50px;  
  73. background:-moz-linear-gradient(top, transparent, transparent 65%, rgba(64,82,20,1));  
  74. background:-webkit-gradient(linear, center top,center bottom, from(transparent), color-stop(65%, transparent), to(rgba(64,82,20,1)));  
  75. background:-o-linear-gradient(top, transparent, transparent 50%, rgba(64,82,20,1)); }  
  76. #az_rfoot { width:50px; height:110px; left:140px; top:270px; z-index:-1;  
  77. border-radius:25px;  
  78. background:-moz-linear-gradient(left, rgba(40,58,0,1), rgba(110,150,0,1) 70%, rgba(109,149,4,1) 100%);  
  79. background:-webkit-gradient(linear, left center, right center, from(rgba(40,58,0,1)), color-stop(70%,rgba(110,150,0,1)), to(rgba(109,149,4,1)));  
  80. background:-o-linear-gradient(left, rgba(40,58,0,1), rgba(110,150,0,1) 70%, rgba(64,82,20,1)); }  
  81. #az_rfoot:before { position:absolute; height:46px; width:100%; content:''; top:64px;  
  82. border-radius:50px;  
  83. background:-moz-linear-gradient(top, transparent, transparent 65%, rgba(64,82,20,1));  
  84. background:-webkit-gradient(linear, center top,center bottom, from(transparent), color-stop(65%, transparent), to(rgba(64,82,20,1)));  
  85. background:-o-linear-gradient(top, transparent, transparent 50%, rgba(64,82,20,1));  
  86. }  
  87. #az_lfoot { width:50px; height:110px; left:30px; top:270px; z-index:-1;  
  88. border-radius:25px;  
  89. background:-moz-linear-gradient(left, rgba(40,58,0,1), rgba(110,150,0,1) 70%, rgba(109,149,4,1) 100%);  
  90. background:-webkit-gradient(linear, left center, right center, from(rgba(40,58,0,1)), color-stop(70%,rgba(110,150,0,1)), to(rgba(109,149,4,1)));  
  91. background:-o-linear-gradient(left, rgba(40,58,0,1), rgba(110,150,0,1) 70%, rgba(64,82,20,1));  
  92. }  
  93. #az_lfoot:before { position:absolute; height:46px; width:100%; content:''; top:64px;  
  94. border-radius:50px;  
  95. background:-moz-linear-gradient(top, transparent, transparent 65%, rgba(64,82,20,1));  
  96. background:-webkit-gradient(linear, center top,center bottom, from(transparent), color-stop(65%, transparent), to(rgba(64,82,20,1)));  
  97. background:-o-linear-gradient(top, transparent, transparent 50%, rgba(64,82,20,1));  
  98. }  
  99. #az_line { width:6px; height:50px; left:170px; z-index:5; top:-20px;  
  100. border-radius:5px;  
  101. background:-moz-linear-gradient(center left, rgba(44,62,0,1), rgba(109,149,4,1) 66%, rgba(109,149,4,1) 70%, rgba(64,82,20,1));  
  102. background:-webkit-gradient(linear, left center, right center, from(rgba(44,62,0,1)), color-stop(66%,rgba(109,149,4,1)), color-stop(70%,rgba(109,149,4,1)), to(rgba(64,82,20,1)));  
  103. background:-o-linear-gradient(left, rgba(44,62,0,1), rgba(109,149,4,1) 66%, rgba(109,149,4,1) 70%, rgba(64,82,20,1));  
  104. transform:rotate(30deg);  
  105. -moz-transform:rotate(30deg);  
  106. -o-transform:rotate(30deg);  
  107. -webkit-transform:rotate(30deg);  
  108. }  
  109. #az_line:before { content:''; width:100%; height:5px; z-index:6; background:rgba(0,0,0,0.2); top:50px;  
  110. box-shadow:-1px -2px 2px 2px rgba(0,0,0,0.5); position:absolute; border-radius:5px;  
  111. }  
  112. #az_line:after { content:''; width:6px; height:40px; z-index:-15; top:73px; position:absolute; left:-120px;  
  113. border-radius:5px;  
  114. background:-moz-linear-gradient(center left, rgba(44,62,0,1), rgba(109,149,4,1) 66%, rgba(109,149,4,1) 70%, rgba(64,82,20,1));  
  115. background:-webkit-gradient(linear, left center, right center, from(rgba(44,62,0,1)), color-stop(66%,rgba(109,149,4,1)), color-stop(70%,rgba(109,149,4,1)), to(rgba(64,82,20,1)));  
  116. background:-o-linear-gradient(left, rgba(44,62,0,1), rgba(109,149,4,1) 66%, rgba(109,149,4,1) 70%, rgba(64,82,20,1));  
  117. transform:rotate(-60deg);  
  118. -moz-transform:rotate(-60deg);  
  119. -o-transform:rotate(-60deg);  
  120. -webkit-transform:rotate(-60deg);  
  121. }  
  122. #sword { width:6px; height:220px; top:-5px; left:-130px;  
  123. box-shadow:0 -10px 8px 5px red;  
  124. background:-moz-linear-gradient(center left, rgba(44,62,0,1), rgba(109,149,4,1) 66%, rgba(109,149,4,1) 70%, rgba(64,82,20,1));  
  125. background:-webkit-gradient(linear, left center, right center, from(rgba(44,62,0,1)), color-stop(66%,rgba(109,149,4,1)), color-stop(70%,rgba(109,149,4,1)), to(rgba(64,82,20,1)));  
  126. background:-o-linear-gradient(left, rgba(44,62,0,1), rgba(109,149,4,1) 66%, rgba(109,149,4,1) 70%, rgba(64,82,20,1));  
  127. transform:rotate(-32deg);  
  128. -moz-transform:rotate(-32deg);  
  129. -o-transform:rotate(-32deg);  
  130. -webkit-transform:rotate(-32deg);  
  131. -moz-animation:light 3s linear infinite backwards;  
  132. -webkit-animation:light 3s linear infinite backwards;  
  133. }  
  134. @-moz-keyframes light {   
  135. 50% { box-shadow:0 -10px 8px 5px skyblue; }   
  136. }  
  137. @-webkit-keyframes light {   
  138. 50% { box-shadow:0 -10px 2px 2px skyblue; }   
  139. }  
  140. </style> 
  141. </head> 
  142. <body> 
  143. <div id="container"> 
  144. <div id="az"> 
  145.   <div id="az_head"></div> 
  146.   <div id="az_body"></div> 
  147.   <div id="az_lhand"></div> 
  148.   <div id="az_rhand"></div> 
  149.   <div id="az_lfoot"></div> 
  150.   <div id="az_rfoot"></div> 
  151.   <div id="az_line"></div> 
  152.   <div id="sword"></div> 
  153. </div> 
  154. </div> 
  155. </body> 
  156. </html> 

【编辑推荐】

  1. JavaScript+CSS3写的Web版纸牌
  2. HTML 5和CSS3快速制作便签特效
  3. HTML 5、CSS3、JS开发播放器完全指南
  4. CSS3制作Windows7开始菜单
  5. 别怕!我们还有HTML 5和CSS3
责任编辑:张伟 来源: 前端开发网
相关推荐

2017-05-11 15:20:52

CSS3动画前端

2020-02-18 10:26:58

机器人人工智能系统

2021-05-24 15:29:24

人工智能机器人聊天

2020-09-15 13:56:08

公众号机器人图灵机器人

2021-11-30 10:56:43

ChatterBot机器人人工智能

2021-04-01 10:51:44

机器人人工智能编程

2015-05-27 07:44:34

日历控件 jQueryCSS3

2015-04-23 15:40:59

CSS3叮当猫

2015-05-22 11:40:00

希捷

2023-02-26 11:53:20

2020-12-02 13:00:17

Recast.AI聊天机器人人工智能

2022-07-28 22:00:47

核酸采样机器人机器人

2022-09-30 13:55:46

Python机器人

2013-07-26 16:50:25

2020-10-15 15:42:00

人工智能

2018-06-08 16:48:09

PythonQQ机器人

2018-11-13 09:19:48

机器人人工智能系统

2023-02-09 07:34:52

ChatGPT机器人人工智障

2023-07-27 14:38:58

人工智能机器人开发

2015-07-28 09:36:11

机器人
点赞
收藏

51CTO技术栈公众号