Giter Site home page Giter Site logo

catalinmiron / react-native-jelly-side-menu Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vansonleung/react-native-jelly-side-menu

2.0 2.0 0.0 14 KB

A side menu that animates like a jelly! iOS & Android tested.

License: BSD 2-Clause "Simplified" License

JavaScript 100.00%

react-native-jelly-side-menu's Introduction

react-native-jelly-side-menu

A side menu that animates like a jelly! iOS & Android tested.

npm version NPM

Demo Showcase (Youtube link) The video seems stuck at 2.5s when not using Chrome to watch. I will fix it when I have time.

https://www.youtube.com/watch?v=lvyJX2-l8pM

Demo Showcase

Demo Showcase

Prerequisites

React Native 0.25 or higher

Installation

npm i react-native-svg --save
npm i react-native-jelly-side-menu --save
rnpm link

Usage

import JellySideMenu from 'react-native-jelly-side-menu'

Toggle

toggleSideMenu()

Open

toggleSideMenu(true)

Close

toggleSideMenu(false)

Example

class JellySideMenuPage extends Component {

  constructor(props) {
    super(props);
    this.itemStyle = {padding: 16, backgroundColor: 'transparent'};
    this.itemTextStyle = {color: '#000000', fontWeight: 'bold', fontSize: 20};
    this.renderMenu = this.renderMenu.bind(this);
  }

  renderItem(text, onPress) {
    return (
      <TouchableOpacity onPress={onPress}>
        <View style={this.itemStyle}>
          <Text style={this.itemTextStyle}>{text}</Text>
        </View>
      </TouchableOpacity>
    )
  }

  renderMenu() {
    return (
      <View>
        {this.renderItem("Jelly Side Menu by Vanport", () => {})}
        {this.renderItem("Toggle Side Menu", () => {this.jsm.toggleSideMenu();})}
        {this.renderItem("Close Side Menu", () => {this.jsm.toggleSideMenu(false);})}
      </View>
    )
  }

  render() {
    return (
      <View style={{flex: 1, backgroundColor: '#FF6644'}}>
        <JellySideMenu 
        ref={(view) => {this.jsm = view}}
        fill={"#FFF"} fillOpacity={1.0}
        renderMenu={this.renderMenu}>

          <TouchableOpacity onPress={() => {this.jsm.toggleSideMenu(true)}}>
            <View style={[this.itemStyle, {backgroundColor: '#FF7788'}]}>
              <Text style={this.itemTextStyle}>Open Jelly Menu</Text>
            </View>
          </TouchableOpacity>

        </JellySideMenu>
      </View>
    )
  }
}

Milestones

✔ iOS Support @done (16-07-09 12:07)
✔ Android Support @done (16-07-09 12:07)
☐ Context control toggle support
✔ Remove unnecessary imports
☐ Add Essential control parameters support (enable/disable menu, enable/disable gesture, set default state)
☐ Add Callback support (onWillOpen(state), onDidOpen(state), onWillClose(state), onDidClose(state))
☐ Add Menu State check function (getState() => State)
☐ Add Fine tune control parameters support (thresholds of dragging, menu width, bounce tension & friction)
☐ Add Side menu docking direction support (top, left, right, bottom)
☐ Cater device orientation change
☐ Performance improvement

react-native-jelly-side-menu's People

Contributors

andersonbarutti avatar jhen0409 avatar vansonleung avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.