运行代码 缩小
十度
HTML代码
复制 格式化 注释 注释 清空
放大
x
 
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="ja">
3
    <head>
4
        <meta name="viewport" content="width=480, user-scalable=no" /> 
5
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
        <meta http-equiv="Content-Style-Type" content="text/css" />
7
        <script src="//ku.shouce.ren/files/js/1457852197.js" type="text/javascript">
8
        </script>
9
        <title>新7款HTML5/CSS3特效之3D衣服摆动
10
        </title>
11
    </head>
12
    <body>
13
        <div style="width:500px;margin:10px auto">
14
            <canvas id="cv" width="480" height="300">
15
            </canvas>
16
            <p>"3D on 2D Canvas" demo
17
            </p>
18
            <p>move cursor to pan / click to swing
19
            </p>
20
        </div>
21
    </body>
22
</html>
23
CSS代码
复制 格式化 注释 注释 颜色 清空
放大
xxxxxxxxxx
46
 
1
body {
2
  margin: 0;
3
  padding: 0;
4
  background-color: #333;
5
  color: #fff;
6
  -moz-user-select: none;
7
  -webkit-user-select: none;
8
}
9
#cv {
10
  background: #000;
11
  margin: 0;
12
  display: block;
13
}
14
p {
15
  padding-left: 1em;
JS代码
复制 格式化 注释 注释 清空
放大
xxxxxxxxxx
410
 
1
function ClothApp()
2
{
3
  this.canvas = document.getElementById("cv");
4
  P3D.g = this.canvas.getContext("2d");
5
  var tex = new Image();
6
  this.texture1 = tex;
7
  tex.onload = function(){
8
    _this.start();
9
  };
10
  tex.src = "//ku.shouce.ren/files/images/201603/56e5100521fc6.gif";
11
  tex = new Image();
12
  this.texture2 = tex;
13
  tex.onload = function(){
14
    _this.start();
15
  };
名称
新7款HTML5/CSS3特效之3D衣服摆动
分类
HTML5代码
描述
今天我再向大家分享一款HTML5 3D衣服摆动动画特效,动画也是在HTML5 Canvas上完成,它模拟衣服晾在绳子上,点击鼠标可以让衣服摆动起来,就行风吹动它一样,非常逼真炫酷。
收藏