1.14.0 • Published 4 years ago

react-webgl-metaballs v1.14.0

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

react-webgl-metaballs

Metaballs example

animated metaballs using webgl

NPM JavaScript Style Guide

Install

npm install --save react-webgl-metaballs

Usage

import React from 'react'

import MetaBalls from 'react-webgl-metaballs'

class Example extends React.Component {
  /* Metaballs is going to fill its parentcontainer so use the parentcontainer to set its size */
  render () {
    return (
      <div>
        <MetaBalls/>
      </div>
    )
  }
}

Props

  orbData={[{},{},{}]}  
  OPTIONAL. Array of objects that can be used to cofigure the orbs or just use empty objects to configure the amount of orbs.
  If orbData is not set 2-10 random orbs will be created.

  Possible options to configure your orbs are:

  OrbConfig {
    size?: number;
    
    posX?: number;
    posY?: number;

    colorR?: number;
    colorG?: number;
    colorB?: number;

    moveX?: number;
    moveY?: number;
  }
  All fields are optional

  shiftColor={{min: x, max: y}}
  if set orbs will shift color after they collided with something

  deflectMovement={{min: x, max: y}}
  if set orbs will change their movement vector after colliding with something. both values need to be positive and should be rather low <10 for example 

  childContainerFlex={"row"}
  can be used to dynamically position your content next to innerContainer.
  If not set your content will fill the entire container.
  childContainerFlex?: "row" | "row-reverse" | "column" | "column-reverse";

  innerContainer={<div></div>} 
  OPTIONAL. Needs to a ReactElement! can be used to further contain the orbs so they dont interfere with your other content

  <MetaBalls>child</MetaBalls> 
  OPTIONAL. you can wrap your content inside Metaballs. type is any

License

MIT © https://github.com/kantimam

1.14.0

4 years ago

1.13.0

4 years ago

1.12.0

4 years ago

1.11.0

4 years ago

1.10.0

4 years ago

1.9.0

4 years ago

1.8.0

4 years ago

1.7.0

4 years ago

1.6.0

4 years ago

1.5.0

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago

0.9.6

5 years ago

0.9.5

5 years ago

0.9.4

5 years ago

0.9.2

5 years ago

0.9.1

5 years ago

0.9.0

5 years ago