p5js/10000.测试用.html
2022-12-14 11:35:37 +08:00

34 lines
984 B
HTML

<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" href="/css/style.css" />
<title>测试</title>
<script src="/p5/p5.min.js"></script>
<script src="/p5/addons/p5.sound.min.js"></script>
<script src="/lib/utils.js"></script>
<script>
let h;
function setup() {
createCanvas(600, 400);
background(200);
drawGrid(32);
noLoop();
h = height;
for (let x = 0; x < width; x += 10) {
rect(x, height, 10, -h);
h = lerp(h, 0, 0.1);
}
}
function draw() {}
</script>
</head>
<body>
<main></main>
</body>
</html>