Home

Awesome

choo-animate

add handi animations to choo native events

Usage

There are many ways to use this module.

var { fadeIn, fadeOut } = require('animation-toolbox')

var app = choo()
app.use(require('choo-animate')({
  animations: {'fadein': fadeIn, 'fadeout': fadeOut},
  before: 'fadeout',
  after: 'fadein'
}))

app.route('/', require('./views/main'))
app.route('/*', require('./views/404'))

app.mount('body')

Or through data tags

var { fadeIn, fadeOut } = require('animation-toolbox')

var app = choo()
app.use(require('choo-animate')({
  animations: {'fadein': fadeIn, 'fadeout': fadeOut}
}))

app.route('/', require('./views/main'))
app.route('/*', require('./views/404'))

app.mount('body')

// in your view
module.exports = function view (state, emit) {
  return html`<body data-before-transition="fadeout" data-after-transition="fadein">
  </body>`
}

API

var store = animate(opts)

You can pass two options to the store function:

See also

LICENSE

MIT