-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from happy-func/bugfix_control_click
Bugfix control click #2
- Loading branch information
Showing
15 changed files
with
222 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Document | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} # runs a test on Ubuntu, Windows and macOS | ||
|
||
strategy: | ||
matrix: | ||
node: [12] | ||
os: [ubuntu-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Use Node.js 16.x | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 16.x | ||
|
||
- name: yarn install, build | ||
run: | | ||
yarn | ||
yarn docs:build | ||
- name: Deploy | ||
uses: JamesIves/[email protected] | ||
with: | ||
ACCESS_TOKEN: ${{ secrets.DEPLOY_KEY }} | ||
BRANCH: gh-pages | ||
FOLDER: docs-dist | ||
REPOSITORY_NAME: happy-func/react-nivo-slider | ||
TARGET_FOLDER: ./ | ||
|
||
env: | ||
CI: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
build: | ||
name: Build Package | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node: [ 12 ] | ||
os: [ ubuntu-latest ] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Use Node.js 16.x | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 16.x | ||
|
||
- name: yarn install, build | ||
run: | | ||
yarn | ||
yarn build | ||
tar -zcvf release.tar.gz es src .fatherrc.ts .prettierignore .prettierrc.js .umirc.ts package.json tsconfig.json typings.d.ts | ||
- name: Create Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: "release.tar.gz" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.DEPLOY_KEY }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# controlNav | ||
|
||
`controlNav` default it's `true`, `controlNavThumbs` default it's `false` | ||
|
||
set `controlNavThumbs` `true` to show custom thumbs | ||
|
||
<code | ||
src="./demo/control-nav.tsx" | ||
title="control nav" | ||
/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import React from 'react'; | ||
import { Image, Link, Swiper } from 'react-nivo-slider'; | ||
import 'react-nivo-slider/es/style'; | ||
import 'react-nivo-slider/es/style/default'; | ||
import { NemoJpg, ToyStoryJpg, UpJpg, WalleJpg } from './img'; | ||
|
||
export default function Default() { | ||
return ( | ||
<Swiper controlNavThumbs> | ||
<Link href="https://baidu.com"> | ||
<Image src={NemoJpg} alt="图片1" thumb={NemoJpg} /> | ||
</Link> | ||
<Image src={ToyStoryJpg} alt="图片2" title="图片2" thumb={ToyStoryJpg} /> | ||
<Image src={WalleJpg} alt="图片3" thumb={WalleJpg} /> | ||
<Image src={UpJpg} alt="图片4" thumb={UpJpg} /> | ||
</Swiper> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Effect | ||
|
||
set effect on swiper config | ||
|
||
<code | ||
src="./demo/effect.tsx" | ||
title="effect" | ||
/> | ||
|
||
set effect on custom slide | ||
|
||
<code | ||
src="./demo/custom-effect.tsx" | ||
title="custom effect" | ||
/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,100 +1,8 @@ | ||
# react-nivo-slider | ||
# Basic | ||
|
||
## Introduce | ||
|
||
### Basic | ||
the default swiper settings | ||
|
||
<code | ||
src="./demo/Default.tsx" | ||
title="basic" | ||
/> | ||
|
||
### Theme | ||
|
||
<code | ||
src="./demo/theme.tsx" | ||
title="theme" | ||
/> | ||
|
||
### Effect | ||
|
||
<code | ||
src="./demo/effect.tsx" | ||
title="effect" | ||
/> | ||
|
||
### Custom Effect | ||
|
||
<code | ||
src="./demo/custom-effect.tsx" | ||
title="custom effect" | ||
/> | ||
|
||
## API | ||
|
||
### Swiper props | ||
|
||
| props | description | type | default | | ||
| :-- | :-- | :-- | :-- | | ||
| className | - | string | - | | ||
| style | - | CSSProperties | - | | ||
| theme | theme | `default` \| `light` \| `dark` \| `bar` | default | | ||
| effect | transition effect | [EffectType](./#effecttype) | random | | ||
| slices | swiper slice | number | 15 | | ||
| boxCols | box col num | number | 8 | | ||
| boxRows | - | number | 4 | | ||
| animSpeed | animation duration(ms) | number | 500 | | ||
| pauseTime | - | number | 3000 | | ||
| startSlide | - | number | 0 | | ||
| directionNav | show directionNav | boolean | true | | ||
| controlNav | show controlNav | boolean | true | | ||
| controlNavThumbs | show controlNavThumbs | boolean | false | | ||
| pauseOnHover | - | boolean | true | | ||
| manualAdvance | - | boolean | false | | ||
| prevText | prev button text | string | Prev | | ||
| nextText | next button text | string | nextText | | ||
| randomStart | - | boolean | false | | ||
| beforeChange | before slide change | function | - | | ||
| afterChange | after slide change | function | - | | ||
| afterLoad | after swiper init | function | - | | ||
| lastSlide | before last slide start animation | function | - | | ||
| slideshowEnd | on last slide show | function | - | | ||
|
||
### Link | ||
|
||
same as a tag | ||
|
||
### Image | ||
|
||
| props | description | type | default | | ||
| :--------- | :------------------------- | :-------------------------- | :------ | | ||
| className | - | string | - | | ||
| style | - | CSSProperties | - | | ||
| alt | - | string | - | | ||
| title | caption inner text or node | string \| node | - | | ||
| transition | - | [EffectType](./#effecttype) | - | | ||
|
||
### EffectType | ||
|
||
``` | ||
type EffectType = | ||
| 'random' | ||
| `fade` | ||
| `fold` | ||
| `sliceDown` | ||
| `sliceDownRight` | ||
| `sliceDownLeft` | ||
| `sliceUp` | ||
| `sliceUpRight` | ||
| `sliceUpLeft` | ||
| `sliceUpDown` | ||
| `sliceUpDownLeft` | ||
| `sliceUpDownRight` | ||
| `slideInRight` | ||
| `slideInLeft` | ||
| `boxRandom` | ||
| `boxRain` | ||
| `boxRainReverse` | ||
| `boxRainGrow` | ||
| `boxRainGrowReverse`; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Theme | ||
|
||
theme includes **`'bar' 'dark' 'light' 'default'`** | ||
|
||
set theme on swiper config, default it's `'default'` | ||
|
||
<code | ||
src="./demo/theme.tsx" | ||
title="theme" | ||
/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.