Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hadichahine/pageswitcher

Page switcher for websites.
https://github.com/hadichahine/pageswitcher

animation frontend javascript javascript-library pages switch

Last synced: 18 days ago
JSON representation

Page switcher for websites.

Awesome Lists containing this project

README

        

# page-switcher

page-switcher provides a state machine for dealing with switching pages on a website. The interface is abstract making it usable almost on everything that runs Javascript.
# Usage

```javascript
const { createCardSwitcher } = require('page-switcher')

const switcher = createCardSwitcher([
{
show(){
console.log('page one shown')
},
hide(){
console.log('page one hidden')
}
},
{
show(){
console.log('page two shown')
},
hide(){
console.log('page two hidden')
}
},
])

switcher.next()
switcher.backwards()
```
# License

MIT