1.0.2 • Published 4 years ago

react-native-reanimated-slideshow v1.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

Motivation

Gallery/Slideshow timer component for react native using react-native-reanimated library

Original author

https://github.com/dalisalvador/react-native-animated-timer

react-native-animated-timer ⏰

A simple animated timer implementing react-native-reanimated and react-native-svg libraries.

Examples

Installation

npm install react-native-reanimated-slideshow

Usage

import {Timer} from  'react-native-reanimated-slideshow';

<Timer
    radius={350}
    time={10000}
    checkPoints={[{time: 1210.23, callback: () => alert('First Check Point')},
    	        {time: 5310, callback: () => alert('Second Check Point')}]}
    backgrounds={['http://myimage.com/img1.png']}
    showTime={true}
    onTimeFinished={() => alert('AnimatedTimer has finished')}
    loop={true}
    pause={pauseFlag}
    textStyle={{
    	color:  'red',
    	fontWeight:  'bold',
    }}
    showMilli={2}
/>

Properties

PropTypeDefaultRequiredDescription
radiusnumber100trueradius of the circle
timenumber5000truetime of one lap in milliseconds
backgroundsarraynonefalsearray of images that will appear in sequence (left-right). Example: backgrounds={['blue',require('./img/image1'), 'red','https://myimage.com/img2.png']}
checkPointsarraynonefalsearray of objects containing a callback to be executed at a particular time (precision ~65ms). Example:checkPoints={[{ time: 1120, callback: () => myfunc1()}, { time: 5120, callback: () => myfunc2()}]}
onTimeFinishedfunctionnonefalseExecutes function when the timer finishes.
pausebooleanfalsefalseStops the timer
showTimebooleanfalsefalseShows the elapsed time
showMillinumberfalsefalseShows number of milliseconds after the comma.
loopbooleantruefalseAn endless loop of timer.
textStyleobjectnonefalsestyle the text showed showTime={true}