HTML5+Canvas+CSS3实现齐天大圣孙悟空腾云驾雾效果_html5教程技巧
程序员文章站
2022-03-11 10:01:10
...
使用HTML5的canvas画的孙悟空,CSS3画的白云飘飘。
效果图:
<!doctype html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>HTML5+CSS3实现齐天大圣腾云驾雾</title> <style type="text/css"> * { margin: 0; padding: 0; border: 0; } html, body { margin: 0; } @-webkit-keyframes STAR-MOVE { from { background-position: 0% 0%; } to { background-position: 600% 0%; } } @keyframes STAR-MOVE { from { background-position: 0% 0%; } to { background-position: 600% 0%; } } .wall { position: absolute; top: 0; left: 0; bottombottom: 0; rightright: 0; } div#background { background: black url('http://hovertree.com/texiao/html5/30/img/background.png') repeat-x 5% 0%; background-size: cover; -webkit-animation: STAR-MOVE 200s linear infinite; -moz-animation: STAR-MOVE 200s linear infinite; -ms-animation: STAR-MOVE 200s linear infinite; animation: STAR-MOVE 200s linear infinite; } div#midground { background: url('http://hovertree.com/texiao/html5/30/img/midground.png')repeat 20% 0%; z-index: 1; -webkit-animation: STAR-MOVE 100s linear infinite; -moz-animation: STAR-MOVE 100s linear infinite; -ms-animation: STAR-MOVE 100s linear infinite; animation: STAR-MOVE 100s linear infinite; } div#foreground { background: url('http://hovertree.com/texiao/html5/30/img/foreground.png')repeat 35% 0%; z-index: 2; -webkit-animation: STAR-MOVE 50s linear infinite; -moz-animation: STAR-MOVE 50s linear infinite; -ms-animation: STAR-MOVE 50s linear infinite; animation: STAR-MOVE 50s linear infinite; }#hovertreewk{position:absolute;z-index:9999;top:0px;bottombottom:0px;left:0px;rightright:0px;margin:auto;} </style> </head> <body> <div style="text-align:center;position:absolute;z-index:9;color:white"><h1>齐天大圣腾云驾雾</h1></div> <div id="background" class="wall"></div> <div id="midground" class="wall"></div> <div id="foreground" class="wall"></div> <canvas width="650" height="478" id="hovertreewk"></canvas> <script src="http://hovertree.com/texiao/html5/30/js/hovertreewk.js"></script> </body> </html>
以上就是HTML5+Canvas+CSS3实现齐天大圣孙悟空腾云驾雾效果_html5教程技巧的内容,更多相关内容请关注PHP中文网(www.php.cn)!
上一篇: 使用html5+canvas+Jquery实现的纯代码连线题Demo
下一篇: HTML5 history新特性pushState、replaceState及两者的区别 _html5教程技巧
推荐阅读
-
HTML5+Canvas+CSS3实现齐天大圣孙悟空腾云驾雾效果
-
字中字效果的实现【html5实例】_html5教程技巧
-
html5 touch事件实现页面上下滑动效果【附代码】_html5教程技巧
-
HTML5+Canvas+CSS3实现齐天大圣孙悟空腾云驾雾效果_html5教程技巧
-
HTML5 canvas实现移动端上传头像拖拽裁剪效果_html5教程技巧
-
html5 touch事件实现页面上下滑动效果【附代码】_html5教程技巧
-
移动web模拟客户端实现多方框输入密码效果【附代码】_html5教程技巧
-
网页中的电话号码如何实现一键直呼效果_附示例_html5教程技巧
-
HTML5中实现拖放效果无须借助javascript_html5教程技巧
-
HTML5 transform三维立方体实现360无死角三维旋转效果_html5教程技巧