Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/blackgard/instslider

Simple and fast Instagram style slider
https://github.com/blackgard/instslider

carousel html instagram instagram-slider javascript js-native slide slider slideshow

Last synced: 3 days ago
JSON representation

Simple and fast Instagram style slider

Awesome Lists containing this project

README

        

InstSlider

[![Status](https://img.shields.io/badge/status-active-success.svg)]()
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](/LICENSE)


[Live demo](https://blackgard.github.io/InstSlider/)
---

## πŸ“ Table of Contents

- [About](#about)
- [Installing](#getting_started)
- [Usage](#usage)
- [How work](#how_work)
- [Built Using](#built_using)
- [Authors](#authors)

## 🧐 About

InstSlider is an easy and fast Instagram style slider.

[Live demo](https://blackgard.github.io/InstSlider/)

## 🏁 Installing

To start working with a project, you need to do:

```
git clone https://github.com/Blackgard/InstSlider.git
```

## 🎈 Usage

You will find the files necessary for work in the [dist](/dist) folder.

STEP 1: In header site include:

```html

...

```

STEP 2: before closing the tag body include:

```html

...

```

STEP 3: init slider:

```html

document.addEventListener("DOMContentLoaded", () => {
var slider_1 = new InstSlider({
sliders: ['slider-inst-1', 'slider-inst-2', 'slider-inst-3', 'slider-inst-4']
});
});

```

πŸ”₯ Success, your slider is work!

## πŸ“– How work

### How to declare a slider container ?

```html







AD


Alexandr Drachenin (text)


```

The most important thing is to specify the "data-slider-history-id-on-click" attribute for the container with the slider id value.

Also for digital display of styles, you need to specify tags with "data-slide-img", "data-slide-title" and "data-slide-border".

1. data-slide-img: Indicates the image that will appear on the slider under the views bar. If you want a picture, then instead of the "div" tag put "img".
2. data-slide-title: Indicates the text that will appear on the slider under the views bar. To the right of the picture.
3. data-slide-border: It is used to indicate the viewed users of the sliders.

### How to declare a slider ?

```html






Slide 1-1


Slide 1-2


Slide 1-3








```

If you want to create many sliders, then all of them need to be placed in a container with the "slider-container" class.

To tell the slider where the slides will be located, you need to set the date attribute "data-slide-items-container" to it.

Next, for each slide, you need to specify the date attribute "data-slide-item". It will point the slider to a specific slide.
You can also specify the type of slide for each slide, by default it is "data-slide-item-type='text'".

Other type slider:

1. Text (text): use only text without tags.
2. Video (video): use html tag video.
3. Image (image): use html tag img.
4. Html (html): use any tags.

### How init slider ?

```html

document.addEventListener("DOMContentLoaded", () => {
var slider_1 = new InstSlider({
loop: false,
debug: false,
sliders: ['slider-inst-1', 'slider-inst-2', 'slider-inst-3', 'slider-inst-4']
});
});

```

When initializing the slider, you can transfer some settings to it, for now there are not so many of them.

Slider settings:

- loop: is If true, then the slider will be looped.
- debug: If true, then the slider will display additional information about the work. Needed to debug the slider.
- sliders: Accepts an array with string values ​​or objects. Indicates which slides will work in conjunction with the created slider.

## ⛏️ Built Using

- [NodeJs](https://nodejs.org/en/) - Server Environment

## ✍️ Authors

- [@Blackgard](https://github.com/Blackgard) - Idea & Initial work