0.4.1 • Published 4 years ago

@robust-tools/fader v0.4.1

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

Fader

Fader is a component that works like a slider by fading slides above one another. It's minimal abd lightweight.

Usage

Install it

npm install @robust-tools/fader

Add the HTML

<ul class="slider">
	<li class="slider__slide">
		<img
			class="slider__img"
			src="http://lorempixel.com/800/600/abstract/1"
			alt=""
			role="presentation"
		/>
		<p class="slider__title">Genuine</p>
	</li>
	<li class="slider__slide">
		<img
			class="slider__img"
			src="http://lorempixel.com/800/600/abstract/2"
			alt=""
			role="presentation"
		/>
		<p class="slider__title">Journey</p>
	</li>
	<li class="slider__slide">
		<img
			class="slider__img"
			src="http://lorempixel.com/800/600/abstract/3"
			alt=""
			role="presentation"
		/>
		<p class="slider__title">Glocal</p>
	</li>
	<li class="slider__slide">
		<img
			class="slider__img"
			src="http://lorempixel.com/800/600/abstract/4"
			alt=""
			role="presentation"
		/>
		<p class="slider__title">Inspire</p>
	</li>
</ul>

Add the CSS. According to your build process this can be imported directly into your files or you can copy it from the @robust-tools/fader/lib/css/ directory

@import '@robust-tools/fader/lib/css/fader.css';
@import '@robust-tools/fader/lib/css/animation.css';

Import it

import Fader from '@robust-tools/fader';

const myFader = new Fader(selector, options);

Options

OptionTypeDefaultDetails
wrapperClassesstring[]['slider']List of the classes will be used to create the wrapper element around the slider
titleAnimationstring''The type of animation to be used on the slide title. Available animations are: focus-in-contract-bck, text-focus-in
transitionnumber5000Transition between every slide in milliseconds
autoplaybooleantrueStart the slider automatically
bulletsbooleantrueGenerate and display the navigation bullets
arrowsbooleantrueGenerate and display the next and previous buttons
prevArrowstring'Prev'The inner HTML of the previous button
nextArrowstring'Next'The inner HTML of the next button
paginationInfobooleanfalseDisplay the number of the active slide out of the total slides
paginationInfoSeparatorstringout ofThe text that separates the numbers of the active slide from the total slides
0.4.1

4 years ago

0.4.0

4 years ago

0.3.0

4 years ago

0.2.6

4 years ago

0.2.5

4 years ago

0.2.4

4 years ago

0.2.3

4 years ago