How to use the react-motion.spring function in react-motion

To help you get started, weā€™ve selected a few react-motion examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github molefrog / stateful-animations / src / slides / transistor.js View on Github external
const pointsList = points.map((p, i) => {
    if (withMotion) {
      return (
        
          {value => (
            <div style="{{">
          )}
        
      )
    }

    const pointTransform = `translate(${p.x}px, ${p.y}px)`
    return (</div>
github adambbecker / site-selection-concept / src / components / sidebar / demo.js View on Github external
.forEach(key => {
        let keyStyle = {
          key: key,
          style: {
            height: spring( 0, springConfig ),
            opacity: spring( 0, springConfig ),
            z: spring( -100, springConfig )
          },
          data: sites[key]
        };

        if (sitesListVisible && selectedKey !== key && sites[key].visible) {
          keyStyle.style.height = spring( 67, springConfig );
          keyStyle.style.opacity = spring( 1, springConfig );
          keyStyle.style.z = spring( 0, springConfig );
        }

        styles.push( keyStyle );
      });
github plotly / spectacle-editor / app / components / slide-list / index.js View on Github external
styles={slideList.map(slide => ({
            key: `${slide.id}key`,
            style: {
              left: spring(0, springSetting2),
              height: spring(slideHeight, springSetting2),
              padding: spring(20, springSetting2)
            },
            data: slide
          }))}
        >
github plouc / nivo / packages / radar / src / RadarGridLabels.js View on Github external
styles={labels.map(label => ({
                key: label.id,
                data: label,
                style: {
                    x: spring(label.x, springConfig),
                    y: spring(label.y, springConfig),
                },
            }))}
        >
github therewillbecode / react-poker / src / CardContainer.js View on Github external
const getSprings = (x, y) => ({
  x: spring(x, springConfig),
  y: spring(y, springConfig)
});
github tesseralis / polyhedra-viewer / src / components / viewer / ConfigMenu.jsx View on Github external
const configFormWidth = 270

    return (
      <div>
        
          {({ theta }) =&gt; (
            <div style="{{">
               this.toggle()} name="cog" /&gt;
            </div>
          )}
        
         ({ x: configFormWidth, opacity: 0 })}
          willLeave={() =&gt; ({ x: spring(configFormWidth), opacity: spring(0) })}
          style={{ x: spring(0), opacity: spring(1) }}
        &gt;
          {({ x, opacity }) =&gt; (
            <div opacity="" style="{{">
              
            </div>
          )}
        
      </div>
    )
  }
}
github aholachek / react-animation-comparison / src / react-motion-example.js View on Github external
prevInterpolatedStyles.map((_, i) => {
          return i === 0
            ? { opacity: spring(1), translateY: spring(0) }
            : {
              opacity: prevInterpolatedStyles[i - 1].opacity,
              translateY: spring(prevInterpolatedStyles[i - 1].translateY)
            }
        })
      }
github nordnet / nordnet-ui-kit / src / components / collapsible / collapsible.jsx View on Github external
renderBody() {
    const springConfig = presets.noWobble;
    const defaultStyle = {
      height: this.state.hasContent ? 100 : 0,
    };
    const style = {
      height: this.state.collapsed ? spring(0, springConfig) : spring(this.state.height, springConfig),
    };

    return (
      
        { ({ height }) =&gt;
          <div style="{">
            { this.renderContent() }
          </div>
        }
      
    );
  }
github plouc / flambo / old / webapp / src / modules / core / components / ContentLoading.js View on Github external
render() {
        const { loading, hasItem, children } = this.props

        const finalHeight = !hasItem ? 100 : this.state.height
        const style = {
            height:  spring(finalHeight),
            opacity: spring(loading ? 0 : 1),
        }

        return (
            <div>
                
                
                    {({ height, opacity }) =&gt; (
                        <div style="{{">
                            </div></div>