Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
g-harel committed Sep 15, 2023
1 parent 7f166b7 commit def9efd
Showing 1 changed file with 27 additions and 18 deletions.
45 changes: 27 additions & 18 deletions demo/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -862,22 +862,27 @@ addCanvas(1.8, (ctx, width, height, animate) => {

const animation = statefulAnimationGenerator(
canvasPointGenerator,
(points: Point[]) => points as any ,
(points: Point[]) => points as any,
() => {},
)(Date.now);

wigglePreset(animation, {
extraPoints: 2,
randomness: 2,
seed: Math.random(),
size,
}, {}, {
speed: 2,
});
wigglePreset(
animation,
{
extraPoints: 2,
randomness: 2,
seed: Math.random(),
size,
},
{},
{
speed: 2,
},
);

const pointHistory: Point[][] = [];
let renderCount = 0;
animate((frameTime) => {
animate(() => {
renderCount++;
const points = animation.renderPoints();

Expand All @@ -889,14 +894,18 @@ addCanvas(1.8, (ctx, width, height, animate) => {
}

for (let i = 0; i < pointHistory.length; i++) {
tempStyles(ctx, () => {
ctx.fillStyle = colors.secondary;
ctx.globalAlpha = i / pointHistory.length;
}, () => {
forPoints(pointHistory[i], ({curr}) => {
drawPoint(ctx, curr, i / pointHistory.length);
});
})
tempStyles(
ctx,
() => {
ctx.fillStyle = colors.secondary;
ctx.globalAlpha = i / pointHistory.length;
},
() => {
forPoints(pointHistory[i], ({curr}) => {
drawPoint(ctx, curr, i / pointHistory.length);
});
},
);
}

drawClosed(ctx, points, true);
Expand Down

0 comments on commit def9efd

Please sign in to comment.