-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request] Zooming images on click #384
Comments
I don't think this is a necessary feature. Most browsers let you open images in a new tab, where you can zoom in or out freely. |
Totally, but on mobile, it's an issue, also on the browser, you'll have to click on each image and open them in new tabs. Also, Zoom isn't necessary (It should just enlarge the image once clicked) I'll look into implementing it by myself (if the issue gets closed). |
@Anon-Exploiter Here is an example if you want it https://adityatelange.in/blog/hugo-image-zoom-in/ |
Thanks @adityatelange! I've another feature request in mind 😅 lemme know if I should create a new issue or just post here 🐱 |
I'd like to petition that this be implemented. I frequently post screenshots of my Bash command line and when it is too wide, it shrinks and becomes blurry. Most people expect to left-click to get a modal zoom on an image. Right clicking to open in a new tab is just not intuitive, IMHO. |
Here is some code to do exactly that using medium-zoom, put it in |
This is amazing, thank you!! I really wish that was documented in the wiki here. That's just fantastic. I went with this. I set the background to black with some transparency. mediumZoom(img, {
margin: 0, /* The space outside the zoomed image */
scrollOffset: 40, /* The number of pixels to scroll to close the zoom */
container: null, /* The viewport to render the zoom in */
template: null, /* The template element to display on zoom */
background: 'rgba(0, 0, 0, 0.8)'
}); |
@russmckendrick Actually there's one small issue. Images appear very blurry. I verified it is expanding to its full size, but it just doesn't have the same crispness that I see when I open the image outside of my browser. It's a PNG file. Is this due to medium-zoom or something else? |
Feel free to make the changes to the |
I'd be happy to do that once I figure out the blurry image issue! Thanks for the suggestion. |
@rcdailey I use hi-res screens and then a shortcode to scale them based on the size of the screen, for example ... ... with the shortcode being ... https://github.com/russmckendrick/blog/blob/main/layouts/shortcodes/img.html ... and calling it with something like ....
... looking a the screens in the repo mentioned above it looks like it is scaling the image up rather than down which is why I think you are getting the blur/pixelation. |
Describe the feature
Image zoom upon clicking on images
Additional context
Sometimes it's really difficult to see images with too much content in them (especially in the case of text). The zoom feature can display the image upon click and can escape it using ESC (key)
The text was updated successfully, but these errors were encountered: