How to use the react-motion.presets.stiff 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 hanford / react-drag-drawer / src / index.js View on Github external
} = this.props;

    const open = this.state.open && this.props.open;

    // If drawer isn't open or in the process of opening/closing, then remove it from the DOM
    // also, if we're not client side we need to return early because createPortal is only
    // a clientside method
    if ((!this.state.open && !this.props.open) || !isClientSide()) {
      return null;
    }

    const { touching } = this.state;

    const animationSpring = touching
      ? { damping: 20, stiffness: 300 }
      : presets.stiff;

    const hiddenPosition = this.getElementSize();

    const position = this.getPosition(hiddenPosition);

    // Style object for the container element
    let containerStyle = {
      backgroundColor: `rgba(55, 56, 56, ${open ? containerOpacity : 0})`
    };

    // If direction is right, we set the overflowX property to 'hidden' to hide the x scrollbar during
    // the sliding animation
    if (isDirectionRight(direction)) {
      containerStyle = {
        ...containerStyle,
        overflowX: "hidden"
github xtabbas / react-portal-example / src / Modal.js View on Github external
render() {
    const { show } = this.props;

    return ReactDOM.createPortal(
      <div>
        {show ? (
          
            {things =&gt; (
              <div tabindex="{0}" role="button"> { this.node = node; }} style={{ opacity: things.x }} className="modal-backdrop" /&gt;
            )}
          
        ) : null}

        
          { stuff =&gt; (
            </div></div>
github MacKentoch / react-bootstrap-webpack-starter / src / front / components / backToTop / BackToTop.js View on Github external
render() {
    const { showBackButton } = this.state;
    return (
      
        {({ x }) =&gt; (
          
        )}
      
    );
  }
  // #endregion
github Pocket / extension-save-to-pocket / src / containers / save / recommendations / list / list.js View on Github external
return this.props.list.map(rec => {
      const recHeight = rec.isSpoc ? 140 : 110
      return {
        ...rec,
        data: rec,
        key: 'id' + rec.id,
        style: {
          height: spring(recHeight, { stiffness: 150, damping: 14 }),
          opacity: spring(1, presets.stiff)
        }
      }
    })
  }
github vitalybe / radio-stream / web / app / components / sidebar / sidebar.js View on Github external
render() {
    let logger = loggerCreator("render", moduleLogger);
    logger.info(`start`);

    let [sidebarLeftStart, sidebarLeftEnd] = this.getSidebarLeft();

    return (
      <div>
        <img src="{sidebarImage}">
        
          { value =&gt;  }
        
      </div>
    )
  }
}
github nkbt / react-motion-loop / src / example / App / Pulse.js View on Github external
export const Pulse = () =&gt;
  
    {style =&gt; <div style="{style}">}
  ;
</div>
github apache / couchdb-fauxton / app / addons / fauxton / notifications / notifications.js View on Github external
.map(notification => {
        let item = prevItems.find(style => style.key === (notification.notificationId.toString()));
        let style = !item ? {opacity: 0, height: 0} : false;

        if (!style && (notification.type === this.props.filter || this.props.filter === 'all')) {
          style = {
            opacity: spring(1, presets.stiff),
            height: spring(61, presets.stiff)
          };
        } else if (notification.type !== this.props.filter) {
          style = {
            opacity: spring(0, presets.stiff),
            height: spring(0, presets.stiff)
          };
        }

        return {
          key: notification.notificationId.toString(),
          style,
          data: notification
        };
      });
  };
github andrewngu / sound-redux / scripts / components / MobileNav.js View on Github external
renderUserMenu(isUserMenuOpen, playlist, getPlaylistDetails) {
    const playlistNames = getPlaylistDetails.playlistNames;
    const tabs = ['stream', 'likes', ...playlistNames];

    return (
      
        {({ height }) =&gt;
          <div height="" style="{{">
            {this.renderUserTabs(tabs)}
          </div>
        }
      
    );
  }
github MacKentoch / react-redux-graphql-apollo-bootstrap-webpack-starter / src / front / components / alert / WarningAlert.js View on Github external
render() {
    const { showAlert, warningTitle, warningMessage, onClose } = this.props;

    return (
      
        {({ interpolatedScale }) =&gt; (
          <div style="{{">
            <button type="button">
              Ɨ
            </button>
            {warningTitle &amp;&amp;
              warningTitle.length &gt; 0 &amp;&amp; <strong>{warningTitle}</strong>}
            {<p>{warningMessage}</p>}</div>
github andrewngu / sound-redux / scripts / components / MobileNav.js View on Github external
renderGenreMenu(isGenreMenuOpen, playlist) {
    return (
      
        {({ height }) =&gt;
          <div height="" style="{{">
            {this.renderGenresTabs(playlist)}
          </div>
        }
      
    );
  }