2.4.5 • Published 5 years ago

rc-banner-anim v2.4.5

Weekly downloads
1,198
License
-
Repository
github
Last release
5 years ago

rc-banner-anim


React BannerAnim Component

NPM version build status Test coverage node version npm download

Browser Support

IEChromeFirefoxOperaSafari
IE 10+ ✔Chrome 31.0+ ✔Firefox 31.0+ ✔Opera 30.0+ ✔Safari 7.0+ ✔

Development

npm install
npm start

Example

http://localhost:8012/examples/

online example: http://react-component.github.io/banner-anim/

install

rc-banner-anim

Usage

var BannerAnim = require('rc-banner-anim');
var React = require('react');
const { Element } = BannerAnim;
const BgElement = Element.BgElement;
React.render(<BannerAnim>
  <Element key="a">
    <BGElement key="bg" style={{ background: 'url(img)' }}/>
    <TweenOne key='0'>test text</TweenOne>
  </Element>
  <Element key="b">
    <BGElement key="bg" style={{ background: 'url(img)' }}/>
    <TweenOne key='0'>test text</TweenOne>
  </Element>
</BannerAnim>, container);

API

BannerAnim

`ref` control jump: <BannerAnim ref={(c) => { this.banner = c; }}/>

prev: this.banner.prev();

next: this.banner.next();

jump: this.banner.slickGoTo(number); number from 0;
nametypedefaultdescription
typestring / arrayAll animTypeProvide across, vertical, acrossOverlay, verticalOverlay, (gridBar, grid) => duration is a single block of animation time, video bg no use
durationnumber450Single switch time.
delaynumber0switch delay.
easestringeaseInOutQuadeasing.
initShownumber0start show
arrowbooleantrueArrow is children, this is null and void. else is default arrow
thumbbooleantrue^
autoPlaybooleanfalseauto play
autoPlaySpeednumber5000auto play delay
autoPlayEffectbooleantrueauto play when mouse leave
onChangefunc-onChange(before or after, currentShowInt)
prefixClsstring-user class
childrenreact.component-Element(must), Arrow, Thumb
syncbooleanfalseElement the children and Element the same time animation
dragPlaybooleantruedrag play next or prev
componentstring'div'component tag

Element

children is TweenOne, animation type must from;

nametypedefaultdescription
leaveChildHidebooleanfalsechildren leave switch animation. Replace the hideProps.
syncbooleanfalsechildren and Element the same time animation
prefixClsstring-user class
followParallaxobjectnullfollow mouse anim
componentstring'div'component tag
componentPropsobjectnullcomponent is React.Element, component tag props, not add style

followParallax is object

nametypedefaultdescription
delaynumbernullopen followParallax delay
dataarraynullcontent: { key: string, value: number, type: array or string, bgPosition: string }; key: children key; value: animation interval value, example: value is 20 => left: -20, center: 0 , right: 20 ; type: style or x y, bgPosition: if type is backgroundPosition, this is bg default position, else is invalid.
easestringeaseOutQuadanimate ease. refer
minMovenumbernullease.easeInOutQuad(start, minMove, 1, end); The mouse to move once, the minimum point of moving graphics, a second to reach the position of the mouse.

Element.BgElement

nametypedefaultdescription
classNamestring-className
scrollParallaxobjectnull{ y: 100 }, from bottom to top of browser, element leave display area y is 100
videoResizebooleantruechildren is video, video follow window resize
componentstring'div'component tag
componentPropsobjectnullcomponent is React.Element, component tag props, not add style

Arrow

nametypedefaultdescription
arrowType'prev' | 'next'-arrow type
prefixClsstring-user class
componentstring / React.Elementdivcomponent tag
componentPropsobjectnullcomponent is React.Element, component tag props, not add style

Thumb

nametypedefaultdescription
childrenReact.Element-must
prefixClsstring-user class
componentstring / React.Elementdivcomponent tag
componentPropsobjectnullcomponent is React.Element, component tag props, not add style
2.4.5

5 years ago

2.4.4

6 years ago

2.4.3

6 years ago

2.4.2

6 years ago

2.4.1

6 years ago

2.4.0

6 years ago

2.3.0

6 years ago

2.2.9

6 years ago

2.2.8

7 years ago

2.2.7

7 years ago

2.2.6

7 years ago

2.2.5

7 years ago

2.2.4

7 years ago

2.2.3

7 years ago

2.2.2

7 years ago

2.2.1

7 years ago

2.2.0

7 years ago

2.1.2

7 years ago

2.1.1

7 years ago

2.1.0

7 years ago

2.0.8

7 years ago

2.0.7

7 years ago

2.0.6

7 years ago

2.0.5

7 years ago

2.0.4

7 years ago

2.0.3

7 years ago

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago

0.5.16

8 years ago

0.5.14

8 years ago

0.5.13

9 years ago

0.5.12

9 years ago

0.5.11

9 years ago

0.5.10

9 years ago

0.5.9

9 years ago

0.5.8

9 years ago

0.5.7

9 years ago

0.5.6

9 years ago

0.5.5

9 years ago

0.5.4

9 years ago

0.5.3

9 years ago

0.5.2

9 years ago

0.5.1

9 years ago

0.5.0

9 years ago

0.4.1

9 years ago

0.4.0

9 years ago

0.3.1

9 years ago

0.3.0

9 years ago

0.2.14

9 years ago

0.2.13

9 years ago

0.2.12

9 years ago

0.2.11

9 years ago

0.2.10

9 years ago

0.2.9

9 years ago

0.2.8

9 years ago

0.2.7

10 years ago

0.2.6

10 years ago

0.2.5

10 years ago

0.2.4

10 years ago

0.2.3

10 years ago

0.2.2

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.0

10 years ago