GithubHelp home page GithubHelp logo

skozer / react-instagram-zoom-slider Goto Github PK

View Code? Open in Web Editor NEW
77.0 77.0 26.0 3.52 MB

๐ŸŒ„โ†”๏ธ A slider component with pinch to zoom capabilities inspired by Instagram

Home Page: https://skozer.github.io/react-instagram-zoom-slider/

License: MIT License

HTML 2.13% JavaScript 96.01% CSS 1.86%
carousel instagram pinch-to-zoom react slider zoom

react-instagram-zoom-slider's People

Contributors

dependabot[bot] avatar muhraff avatar semantic-release-bot avatar skozer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

react-instagram-zoom-slider's Issues

Change slides programmatically

๐Ÿš€ Feature Proposal

Allow for useSlider hook to provide a function to change the slide programatically.

Motivation

Split from issue #8

I'm building a lightbox with pinch to zoom and I want to use this library but need to open a photo at any position and also need to update the position programatically.

Example

const [zooming, currentSlide, changeSlide, bind, x, onScale] = useSlider({                                                            
  numSlides: previews.length,                                                                                            
  initialSlide: initialIndex,                                                                                 
})

changeSlide(3) // go to slide #4
changeSlide((currentSlide) => currentSlide + 1)) // go to slide #5

Positions element

If I have many sliders one after another, then when zooming in, the bottom slider overlays on top of the zoomed image

Overlay content

๐Ÿš€ Feature Proposal

Optional content to be overlaid on the slide at rest, then hidden when zooming - similar to the slide indicator.

Motivation

Show additional content on the slide without disturbing zoom functionality.

Example

const overlay = <div class="badge">New</div>

<Slider overlay={overlay} />

The second parameter of useTransition cannot be empty.

var transitions = useTransition(isVisible, null, {
from: {
opacity: 1
},
enter: {
opacity: 1
},
leave: {
opacity: 0
}
});

if (totalSlides < 2) {
return null;
}

Environment

  • react-instagram-zoom-slider v1.x.x
  • react-spring v9.2.6
  • react-use-gesture ^7.0.4
  • styled-components v5.0.x
  • react v16.12.x

Allow for initial position other than 0 in useSlider

๐Ÿš€ Feature Proposal

Allow for useSlider hook to specify an initial position and update the slide programatically.

Motivation

I'm building a lightbox with pinch to zoom and I want to use this library but need to open a photo at any position and also need to update the position programatically.

Example

const [zooming, currentSlide, changeSlide, bind, x, onScale] = useSlider({                                                            
  numSlides: previews.length,                                                                                            
  initialSlide: initialIndex,                                                                                 
})
useKey('ArrowRight', () => changeSlide(1), [changeSlide]);
useKey('ArrowLeft', () => changeSlide(-1), [changeSlide]);

Support for sliders that don't take up 100vw

๐Ÿš€ Feature Proposal

Expose a prop/useSlider argument where you can pass a width in order to use the slider in situations where you don't want it taking up 100vw

Motivation

Everything works great in the mobile/tablet version of the site, but in making the desktop version we no longer want the slider to take up 100vw. It would have a fixed width, but currently this package works under the assumption that the slider will always be 100vw.

./node_modules/react-instagram-zoom-slider/dist/index.es.js Module not found: Can't resolve 'react-spring' in 'C:\Users\binda\Desktop\painting webite\nepalese-artworks\node_modules\react-instagram-zoom-slider\dist'

๐Ÿ› Bug Report

(A clear and concise description of what the bug is.)

Steps to reproduce

Steps to reproduce the behavior:

Expected behavior

(A clear and concise description of what you expected to happen.)

Link to example (highly encouraged)

(Please provide either a CodeSandbox demo or an example GitHub repo.)

Environment

  • react-instagram-zoom-slider v1.x.x
  • react-spring v8.x.x
  • react-use-gesture v7.0.x
  • styled-components v5.0.x
  • react v16.12.x

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.