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
- Host: GitHub
- URL: https://github.com/nju33/suwa
- Owner: nju33
- License: mit
- Created: 2017-03-20T20:00:55.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-22T03:14:24.000Z (almost 9 years ago)
- Last Synced: 2025-01-23T00:14:34.328Z (about 1 year ago)
- Topics: carousel, element, library, pure-javascript, ui
- Language: HTML
- Homepage: https://www.npmjs.com/package/suwa
- Size: 7.4 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Suwa
📖 Like a carousel element

## 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