-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
79 lines (79 loc) · 1.64 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<html>
<head>
<title>RGB Bitmap 图形绘制</title>
<style>
div, h3 {
padding: 0px;
margin: 0px;
}
#my-canvas {
background: #f6f6f6;
float:left;
margin-right: 10px;
border: 1px solid #ccc;
}
#code {
float:left;
width: 400px;
position: relative;
}
#code .store {
position: absolute;
bottom: 0px;
right: 0px;
}
#code .tips {
font-size: 12px;
margin-bottom: 10px;
background: #f6f6f6;
border-radius: 2px;
border: 1px solid #eee;
padding: 10px;
}
#code .box {
border-radius: 2px;
border: 1px solid #eee;
margin-bottom: 10px;
display: block;
width: 100%;
height: 300px;
}
#code .box h3 {
padding: 0 10px;
background: #f6f6f6;
border-bottom: 1px solid #eee;
display: block;
line-height: 26px;
height: 26px;
}
#code .box textarea {
padding: 5px;
width: 100%;
border: 0px;
height: 272px;
}
</style>
</head>
<body>
<canvas id="my-canvas" width="600" height="600">
您的浏览器太老了,不支持canvas,请用最新版chrome打开此页
</canvas>
<div id="code">
<div class="tips">参数有 x, y, f 分别代表x坐标,y坐标,帧计数, 画布大小 600px * 600 px, 指标坐标系,正中央坐标(0, 0)</div>
<div class="box">
<h3>Code</h3>
<textarea id="fn" rows="20">return (x, y, f) => [Math.random() * 256, Math.random() * 256, Math.random() * 256]</textarea>
</div>
<div class="operate">
<button id="draw">绘制</button>
<button id="play">播放</button>
<button id="stop">停止</button>
</div>
<div class="store">
<button id="save">存储</button>
<!-- <button id="load">加载</button> -->
</div>
</div>
<script src="./demo.js"></script>
</body>
</html>