Comments (14)
The example was chosen on purpose ;-)
from react-images.
That would depend on the gallery and how the images are displayed. For example, if the gallery shows small square thumbnails, to have it "morph" into the full picture you'd have to know which part of the image is shown in the thumbnail (could be a face in the top right corner, not necessarily the center of the image).
Even for more classic galleries (like Flickr's) the images are sometimes slightly cropped left and right to avoid having to recompute each line on window resize.
In theory it would be possible to pass extra information to the Lightbox, like the source image's position in the window. That might not work for people who use a gallery component they don't control, could be tough to get the positions.
from react-images.
@GregoryPotdevin Thank you for your reply. So does that mean currently react-images doesn't support the zoom in/out feature? I think it is necessary to some extent, since when we view a picture of very large size, the picture will be down scaled and we cannot view it in detail without zooming in it.
from react-images.
Actually I think I completely (really) misunderstood what you wanted ^^ You don't want to zoom images from the grid to the lightbox (while opening), you just want to zoom on images once open and pan around ? Like Flickr does ? https://www.flickr.com/photos/albertdros/29188487546/in/explore-2016-08-25/
(I love how it just moves around when you move your mouse, with no drag'n'drop, though you can't control the zoom level).
That should be possible to add.
@jossmac Is this on your roadmap ? Would you like a PR for something like this or is it too much for react-images ? An alternative would be to have an "imageComponent" prop which could resize a "ZoomableImage" component ^^
from react-images.
@GregoryPotdevin yes, what I want is something like the Flickr does. The movement way of flickr is really cool! If the zoom level can be controlled, that will be awesome.
from react-images.
Hi guys, I'm on holidays at the moment and don't have my laptop. I'll check this out when I get back
It sounds like this could be a useful feature, though I'm concerned about bloat in what was originally a simple component
from react-images.
@jossmac that's where the "pluggable components" approach I was talking about a while back could be interesting. Add in a prop to bypass the default image component, and then someone can post a "ZoomableImage" component on npm that could be used with react-images.
from react-images.
So the images
prop would just accept an array of whatever the consumer wants to pass through?
That could be possible now I've re-implemented the layout using flexbox; though we lose the ability to apply inline styles, specifically maxHeight: calc(100vh - ${heightOffset})
which is critical to making it responsive. Hmm...
from react-images.
More like <Lightbox images={[...]} imageRenderer={ZoomableImage] />
. Kind of like how you can pass options/value renderers to react-select to have custom displays.
Maybe the maxHeight can be set on a container div and the image inside takes 100% height ?
from react-images.
About to head into a meeting with @JedWatson right now re: KeystoneJS, I'll see what he has to say about it :)
from react-images.
I've sold @jossmac on how this would work, seems like it would be a good fit for react-images.
Probably allow users to replace thumbnailComponent
and imageComponent
?
from react-images.
My initial PR for the thumbnails already had a thumbnails component prop and 2 different thumbnail implementations (for testing, the paginated and non-paginated ones) but apparently that didn't make it after merge
https://github.com/GregoryPotdevin/react-images/blob/8090a6cd02c2e90fd99fa123382a290435f9f287/src/Lightbox.js#L247
renderThumbnails() {
const { images, currentImage, onClickThumbnail, thumbnails:ThumbnailsComponent } = this.props
if (!ThumbnailsComponent) return null
return <ThumbnailsComponent images={images}
currentImage={currentImage}
onClickThumbnail={onClickThumbnail} />
}
from react-images.
Has this issue moved forward at all? I love this simple design but would really appreciate the ability to zoom.
from react-images.
@mjvalade no i don't think this will be implemented by this library. instead we should focus on issue #54 where the user can pass in a custom component that has zoom if so desired. there are too many possible features to implement such as favoriting, custom captioning, annotations, video, etc and it would best to be broken off into custom image or possibly content components.
from react-images.
Related Issues (20)
- showNavigationOnTouchDevice is not part of the type for CarouselProps HOT 2
- Style Autoprefixer broken for `display: flex`
- TypeError: undefined is not an object (evaluating 'currentView.caption') HOT 1
- Option to always show header and footer. HOT 1
- Warning using ModalGateway in react's Strict Mode HOT 2
- Is there a way to disable some/all the shortcuts ? HOT 1
- Component Customization with Styled-Components Library HOT 5
- Picture title HOT 4
- NPM Audit Security report HOT 3
- 想添加一个查看预览图时,可旋转的功能
- React 17 support HOT 6
- FATAL: 1.1.7 to 1.2.0-beta.6 breaks fullscreen mode ('active' of undefined) HOT 7
- is there a way we can disable scrolling for the carousel
- Demo error HOT 4
- In search of a replacement ❓ HOT 2
- Can I get the images data from a json file and how? Thanks HOT 1
- Can you add an option for adding hyperlink(s) under the photo? HOT 1
- A vulnerability introduced in react-images HOT 2
- Can it view .tif or .tiff type image ? HOT 1
- Type '{ children: Element; }' has no properties in common with type 'IntrinsicAttributes'. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-images.