(function () { var unit = 100, canvas, context, canvas2, context2, height, width, xAxis, yAxis, draw; /** * Init function. * * Initialize variables and begin the animation. */ function init() { canvas = document.getElementById("sineCanvas"); canvas.width = document.documentElement.clientWidth; //Canvasのwidthをウィンドウの幅に合わせる canvas.height = 300; context = canvas.getContext("2d"); height = canvas.heigh
![Canvasで波のアニメーションを描画する | スターフィールド株式会社](https://cdn-ak-scissors.b.st-hatena.com/image/square/9dee3e8f1192ed3f1a29a532570cb9413a661072/height=288;version=1;width=512/https%3A%2F%2Fsterfield.co.jp%2Fadmin%2Fwp-content%2Fuploads%2F2016%2F05%2Fnino-eye.jpg)