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

https://github.com/nju33/suwa

📖 Like a carousel element
https://github.com/nju33/suwa

carousel element library pure-javascript ui

Last synced: 10 months ago
JSON representation

📖 Like a carousel element

Awesome Lists containing this project

README

          

# Suwa

📖 Like a carousel element

![screenshot](https://github.com/nju33/suwa/raw/master/images/screenshot.gif?raw=true)

## Install or Download

```sh
yarn add suwa
npm i -S suwa
```

Or access to [releases page](https://github.com/nju33/suwa/releases).
Then, download the latest version.

## Usage

First, if you read as a separate file

```html

```

```html


...

...

...

...

...

...

...



```

```js
import Suwa from 'suwa';

window.addEventListener('load', () => {
new Suwa({
target: getElementById('target'),
data: {
style: {
// defaults
height: '50vh',
width: '100vw',
baseColor: '#fff',
subColor: '#222',
accentColor: '#cb1b45'
},

// Whether to display progressbar on top (default: false)
progress: true,

// Whether or not to loop a page (default: false)
pagerLoop: {
// Whether it will go automatically to the next page when it is left // alone, how many milliseconds it will go to the next page
autoScroll: 3000,
},

// To operate with the keyboard Set
// default: false
keyMaps: {
prevPage: 37,
nextPage: 39
},

// Whether to move the page with the side-wheel (horizontal swipe on smart-device)
// (default: false)
wheel: true

// Whether to display pager
// defaults
pager: {
inset: true // If false Pager display outside the page
},
}
});
})
```

### Example

- `test/fixtures/index.js`
- `example/webpack/index.js`

## LICENSE

The MIT License (MIT)

Copyright (c) 2017 nju33