Usage guide

Demo page

Instalation

*Using Fontawesome
Put in document`s head this:

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css"
        crossorigin="anonymous" referrerpolicy="no-referrer" />
<script src="https://raw.githubusercontent.com/MuffinKing-jpeg/js-slider/master/muffin-slider/slider.js" defer></script>

In case if you want to use touch or keyboard controls add few more rows:

Keyboard control:

<script src="https://raw.githubusercontent.com/MuffinKing-jpeg/js-slider/master/muffin-slider/slider-key-controls.js" defer></script>

Touch controls:

<script src="https://raw.githubusercontent.com/MuffinKing-jpeg/js-slider/master/muffin-slider/slider-touch-controls.js" defer></script>

I can’t figure out how to make it working just with adding two files , so…

<script src="https://raw.githubusercontent.com/MuffinKing-jpeg/js-slider/master/muffin-slider/slider-all-controls.js" defer></script>

Or you can install it localy by downloading folder muffin-slider.
Now make parrent container for your slider with id #slider.

<div id="slider"></div>

Initialization

Drop you images to ./assets/img/ (Path can be chaged)
Put in you JavaScript file

initSlider({
    slides: [
        'array.gif',
        'of.webp',
        'image.png',
        'names.jpeg',
        
    ]
})

You can specify more parametrs

Example:

initSlider({
    imgPath: './assets/slider/img/',
    absolutePath: false, 
    parentSelector: '.container', 
    controls: true,
    indicators: true,
    localStyle: false,
    stylePath: './assets/slider/css/slider.css',
    firstSlide: 0,
    interval: 5000,
    isPlaying: true,
    inverse: false,
    slides: [
        'img_car_in_chinatown.png',
        'img_car.png',
  ],
});

Style

You can use custom colors by changing CSS variables.

:root {
    --dark-slider-10: rgba(0, 0, 0, 0.1);
    --color-slider-primary: #ffffff;
    --bg-color-slider-primary: #252525;
    --accent-slider: #dc143c;
}

How to edit?

Fork or clone repository. After that use in work directory npm install command. For live updating use gulp watch. For build with babel polyfils use gulp build