<script src="https://assets.codepen.io/3560077/CanvasAnimater.js"></script>
<canvas id="myCanvas"></canvas>
<script src="./script.js"></script>
// create a CanvasAnimater object that targets a canvas element with id='myCanvas'
let canvasAnimater = new CanvasAnimater('myCanvas');
// set Dwitter code string
canvasAnimater.dwitter_code = 'for(i=0;i<9;i++)x.fillRect(400+i*100+S(t)*300,400,50,200)';
// flex the canvas to fill the entire window
canvasAnimater.flex(true);
// enable Dwitter mode with dwitter_scale = true and dwitter_res = true
canvasAnimater.dwitterMode(true, true, true);
// render the animation
canvasAnimater.animate();
This Pen doesn't use any external CSS resources.