Skip to content

Instantly share code, notes, and snippets.

@akella
Created October 27, 2019 16:42
Show Gist options
  • Select an option

  • Save akella/576f5219d59af9f825feb5392cd22702 to your computer and use it in GitHub Desktop.

Select an option

Save akella/576f5219d59af9f825feb5392cd22702 to your computer and use it in GitHub Desktop.
basic
const canvasSketch = require("canvas-sketch");
const { fract, lerp, clamp, mapRange,clamp01,sign } = require('canvas-sketch-util/math');
const settings = {
// Enable an animation loop
animate: true,
// Set loop duration to 3 seconds
duration: 10,
// Use a small size for our GIF output
dimensions: [1080, 1920],
// Optionally specify an export frame rate, defaults to 30
fps: 36
};
// Start the sketch
const sketch = ({ width, height }) => {
const render = ({ context, width, height, playhead }) => {
context.fillStyle = "#080";
context.clearRect(0, 0, width, height);
context.fillRect(0, 0, width, height);
context.restore();
};
return render;
};
canvasSketch(sketch, settings);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment