0.5.0 • Published 4 years ago

@dank-inc/react-sketchy v0.5.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

React Sketchy!

A dank wrapper for Sketchy!.

Simply input your sketch into the react component prop and call'er a day, bud!

Usage

<App>
  <h1>A dank sketch!</h1>
  <ReactSketchy
    animate
    dimensions={[600, 600]}
    sketch={({ context, width, height }) => {
      context.clearRect(0, 0, width, height);

      return ({ context, width, height, t, setFillStyle }) => {
        context.clearRect(0, 0, width, height);

        const qw = width / 4;
        const qh = height / 4;
        setFillStyle(hsl(t(), 0.5, 0.5));

        context.save();
        context.translate(width / 2, height / 2);
        context.rotate(t(1));

        context.fillRect(-qw, -qh, width / 2, height / 2);
        context.restore();
      };
    }}
  />
</App>

et voila!

0.5.0

4 years ago

0.4.1

4 years ago

0.4.0

4 years ago

0.4.2

4 years ago

0.3.1

4 years ago

0.3.0

4 years ago

0.2.0

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago