1import ProcessingWrap from './ProcessingWrap';
2
3// See: https://github.com/expo/expo/pull/10229#discussion_r490961694
4// eslint-disable-next-line @typescript-eslint/ban-types
5export default ProcessingWrap<{}>('Draw without clearing screen with processing.js', (p) => {
6  let t = 0;
7
8  p.setup = () => {
9    p.background(0);
10    p.noStroke();
11  };
12
13  p.draw = () => {
14    t += 12;
15    p.translate(p.width * 0.5, p.height * 0.5);
16    p.fill(
17      128 * (1 + p.sin(0.004 * t)),
18      128 * (1 + p.sin(0.005 * t)),
19      128 * (1 + p.sin(0.007 * t))
20    );
21    p.ellipse(
22      0.25 * p.width * p.cos(0.002 * t),
23      0.25 * p.height * p.sin(0.002 * t),
24      0.1 * p.width * (1 + p.sin(0.003 * t)),
25      0.1 * p.width * (1 + p.sin(0.003 * t))
26    );
27  };
28});
29