omi-touch

Smooth scrolling, rotation, pull to refresh and any motion for the web.

Usage no npm install needed!

<script type="module">
  import omiTouch from 'https://cdn.skypack.dev/omi-touch';
</script>

README

omi-touch

Smooth scrolling, rotation, pull to refresh and any motion for the web.

→ touch the mobile demo

Usage

import { render, define, WeElement } from 'omi'
import 'omi-touch'

define('my-app', class extends WeElement {
  onChange = value => {
    console.log(value)
  }

  render() {
    return (
      <div class="main">
        <omi-touch min={-1750} max={0} change={this.onChange}>
          <div class="touchArea">
            <ul>
              <li>Hello, Omi-Touch!</li>
              <li>AlloyTouch</li>
              <li>Omi</li>
              ...
              ...
              ...
              <li> row 20</li>
              <li> row 21</li>
              <li> row 22</li>
              <li> row 23</li>
              <li> row 24</li>
              <li style="border-bottom: none;"> row 25</li>
            </ul>
          </div>
        </omi-touch>
      </div>
    )
  }
})

render(<my-app />, 'body')

License

MIT © dntzhang