All Projects β†’ baptistebriel β†’ slider-manager

baptistebriel / slider-manager

Licence: MIT license
simple wrapper to create sliders focused on animations

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to slider-manager

React Native Swiper Flatlist
πŸ‘† Swiper component implemented with FlatList using Hooks & Typescript + strict automation tests with Detox
Stars: ✭ 217 (+675%)
Mutual labels:  slider, swipe, scroll
Splide
Splide is a lightweight, powerful and flexible slider and carousel, written in pure JavaScript without any dependencies.
Stars: ✭ 786 (+2707.14%)
Mutual labels:  slider, swipe
Gravityslider
πŸ”„ GravitySlider is a beautiful alternative to the standard UICollectionView flow layout.
Stars: ✭ 784 (+2700%)
Mutual labels:  slider, scroll
Vuetify Swipeout
πŸ‘† A swipe out example built with Vue CLI 3 + Vuetify + Swiper.
Stars: ✭ 117 (+317.86%)
Mutual labels:  slider, swipe
React Soft Slider
Simple, fast and impartial slider
Stars: ✭ 54 (+92.86%)
Mutual labels:  slider, swipe
Swiper
Most modern mobile touch slider with hardware accelerated transitions
Stars: ✭ 29,519 (+105325%)
Mutual labels:  slider, swipe
Vue Swipe Mobile
πŸ˜ƒ A siwpe (touch slider) component for Vue2
Stars: ✭ 97 (+246.43%)
Mutual labels:  slider, swipe
Vue Easy Slider
Slider Component of Vue.js.
Stars: ✭ 313 (+1017.86%)
Mutual labels:  slider, swipe
React Responsive Carousel
React.js Responsive Carousel (with Swipe)
Stars: ✭ 1,962 (+6907.14%)
Mutual labels:  slider, swipe
Vue Awesome Swiper
πŸ† Swiper component for @vuejs
Stars: ✭ 12,072 (+43014.29%)
Mutual labels:  slider, swipe
Slider
Touch swipe image slider/slideshow/gallery/carousel/banner mobile responsive bootstrap
Stars: ✭ 2,046 (+7207.14%)
Mutual labels:  slider, swipe
React Native Web Swiper
Swiper-Slider for React-Native and React-Native-Web
Stars: ✭ 125 (+346.43%)
Mutual labels:  slider, swipe
React Swipes
πŸ”₯ 基于Reactηš„η§»εŠ¨η«―ε‘η‰‡ζ»‘εŠ¨η»„δ»Ά
Stars: ✭ 177 (+532.14%)
Mutual labels:  slider, swipe
skeleton-carousel
Carousel component. Horizontal and vertical swipe navigation
Stars: ✭ 31 (+10.71%)
Mutual labels:  slider, swipe
T System
the moving objects tracking system via two axis camera motion (and as optionally n joint robotic arm) for raspberry pi distributions
Stars: ✭ 17 (-39.29%)
Mutual labels:  slider
gpkg
🌎 A global Node binary manager written in Rust
Stars: ✭ 53 (+89.29%)
Mutual labels:  manager
range-slider
Customizable slider (range) component for JavaScript with no dependencies
Stars: ✭ 26 (-7.14%)
Mutual labels:  slider
really-smooth-scroll
A script that smoothen scrolling in the browser
Stars: ✭ 21 (-25%)
Mutual labels:  scroll
EasyScrollDots
Single page scroll JavaScript plugin that allows for vertical navigation of page sections
Stars: ✭ 38 (+35.71%)
Mutual labels:  scroll
roundy
Simple react round slider. Supports touch events.
Stars: ✭ 29 (+3.57%)
Mutual labels:  slider

slider-manager

stable

Usage

NPM

npm install slider-manager --save

import Manager from 'slider-manager'
import gsap from 'gsap'

const slides = [].slice.call(document.querySelectorAll('.slides'))

const slider = new Manager({
    length: slides.length,
    loop: true,
    callback: (event) => {
        
        const index = event.current
        const previous = event.previous
        const down = event.direction === 'downwards'

        slider.animating = true

        this.videos[index].play()

        const windowheight = window.innerHeight
        const tl = new TimelineMax({ paused: true, onComplete: () => {

            this.videos[previous].pause()
            slider.animating = false
        }})

        tl.staggerTo(slides, 1, { cycle: {
            y: (loop) => index === loop ? 0 : loop < index ? -windowheight : windowheight
        }, ease: Expo.easeInOut}, 0, 0)

        tl.restart()
    }
})

slider.init()

options

  • el: HTMLElement to listen for scroll/touch events - defaults to document.body
  • direction: 'x' or 'y' - defaults to 'y'
  • loop: true of false - defaults to false
  • delta: delta limiter for scroll/touch events - defaults to 1
  • limitInertia: if set to true, leverage the limitInertia option of virtual-scroll to distinguish between user-initiated and inertial scrolling. Prevents callback from firing multiple times per scroll - defaults to false.
  • callback: function called when user has swiped or scrolled

methods

  • init: add event listeners
  • goTo(index): goes to the slide index
  • destroy: remove event listeners

changelog

  • 1.0.6: added direction to options, so it listens to either deltaX or deltaY depending on the desired option
  • 1.1.6: added limitInertia to options, that when set to true fixes a behavior where multiple callbacks are fired for a single user-initiated scroll due to inertial scrolling.

License

MIT, see LICENSE.md for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].