1.0.9 • Published 4 years ago

@martsis/canvas-slider v1.0.9

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

Canvas slider

The slider is adaptive.

Examples of basic library settings

Importing Javascript

import CanvasSlider from '@martsis/canvas-slider';

Minimal config

<div id="slideshow">
    <img src='http://placekitten.com/800/480'>
    <img src='http://placekitten.com/800/800'>
    <img src='http://placekitten.com/480/800'>
</div>
const sliderParams = {
    container: '#slideshow',    // main container
    width: 800,                 // width slide
    height: 640,                // height slide
}
const slider = new CanvasSlider(sliderParams);
slider.next(); // slide next
slider.prev(); // slide prev

The most popular configuration

<div id="slideshow">
    <img src='http://placekitten.com/800/480'>
    <img src='http://placekitten.com/800/800'>
    <img src='http://placekitten.com/480/800'>
</div>
<div>
    <button id="#prev'">prev</button>
    <button id="#next">next</button>
</div>
// params
const sliderParams = {
    container: '#slideshow',
    nextBtn: '#next',
    prevBtn: '#prev',
    width: 800,                 
    height: 640,
    pattern: {
        width: 320,
        height: 320,
        blur: 30
    },
    onNext: function() {
        console.log('next');
    },
    onPrev: function() {
        console.log('prev');
    }
}
new CanvasSlider(sliderParams);

Configuration with links to images

<div id="slideshow"></div>
const sliderParams = {
    container: '#slideshow',    // main container
    width: 800,                 // width slide
    height: 640,                // height slide
    slides: [
        'http://placekitten.com/680/880',
        'http://placekitten.com/681/881',
        'http://placekitten.com/680/881',
    ],
}
new CanvasSlider(sliderParams);
1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.7-beta.1

4 years ago

1.0.7-beta.2

4 years ago

1.0.6

4 years ago

1.0.6-beta.1

4 years ago

1.0.5

4 years ago

1.0.5-beta.7

4 years ago

1.0.5-beta.6

4 years ago

1.0.5-beta.5

4 years ago

1.0.5-beta.4

4 years ago

1.0.5-beta.3

4 years ago

1.0.5-beta.2

4 years ago

1.0.5-beta.1

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0-beta.11

4 years ago

1.0.0-beta.10

4 years ago

1.0.0-beta.8

4 years ago

1.0.0-beta.9

4 years ago

1.0.0-beta.7

4 years ago

1.0.0-beta.6

4 years ago

1.0.0-beta.3

4 years ago

1.0.0-beta.4

4 years ago

1.0.0-beta.2

4 years ago

1.0.0-beta.1

4 years ago

1.0.0

4 years ago