0.2.16 • Published 11 months ago

reactive-frames v0.2.16

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

Reactive

Reactive is a flexible React wrapper for creative coding libraries, enabling easy setup and interoperability between a diverse array of packages.

Currently, Reactive includes frames for the following libraries:

Visual

  • Canvas (WebGL)
  • Canvas (2D)
  • SVG
  • p5.js (Processing)
  • Framer Motion
  • twgl.js
  • Regl
  • SnapSVG
  • Hydra

Audio

  • Web Audio
  • Elementary Audio

Installation

npm install reactive-frames

Usage

  • Enclose everything within the main frame, <Reactive>.
  • Each library is a Frame component which can be passed any number of appropriate Children components. Here is a hierarchy of allowed components:
<Reactive>
    <Call /> // a generic component for creating/updating props

    <Processing /> // The p5.js library, in its own canvas
    <CanvasGL> // a canvasGL instance that can adapt to window size
        <Mesh /> // A WebGL draw call using twgl.js 
        <Plane /> // A WebGL draw occupying the whole canvas
        <Framebuffer /> // A WebGL framebuffer
        <Texture /> // A WebGL texture
        <ProcessingGL /> // p5.js with a WebGL canvas you create
    </CanvasGL>
    <Canvas2D> // a canvas2D instance that can adapt to window size
        <Processing2D /> // p5.js with a 2D canvas you create
    </Canvas2D>
    <Regl /> // a regl.js instance in its own canvas
    <Hydra /> // a Hydra instance in its own canvas
    <Snap> // a Snap.svg instance
    <SVG> // a native SVG element

    <AudioCtx> // an audio Context (initialize with a button)
        <Elementary /> // Elementary audio
    </AudioCtx>
</Reactive>

Each component must be provided a name, and then can call a setup and a draw function. Setup is executed on page load, while draw is executed every frame.

0.2.16

11 months ago

0.2.15

1 year ago

0.2.14

1 year ago

0.2.13

1 year ago

0.2.12

1 year ago

0.2.11

1 year ago

0.2.10

1 year ago

0.2.9

1 year ago

0.2.8

1 year ago

0.2.7

1 year ago

0.2.6

1 year ago

0.2.5

1 year ago

0.2.4

1 year ago

0.2.3

1 year ago

0.2.2

1 year ago

0.2.1

1 year ago

0.2.0

1 year ago

0.1.0

1 year ago