-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
The next major release and the project status (your feedback needed) #1749
Comments
New demos look great, when do you plan to release it? Or can I use it in project now? |
@markfinst I wouldn't recommend using it in production for now. |
Although Opera Mini is not supposed to work, it seems to perform just fine on the demos on https://photoswipe.com/v5/docs/getting-started/. I am happy about this because that is my default mobile browser (Android, current version is 55.1.2254.56965) but CanIUse does show "all" versions do not support ES6 modules. I am happy to see that closing on scrolling is going away because I will eventually get back to my quest of making a version that allows scrolling for long captions. I had to override it for my interim solution for my own site where the extended caption slides up from the bottom. #1692 Thank you for the improved images that work on dark or pale backgrounds. I see now harm in removing the share options since the URL is all that is needed. |
Hi, I remember that when I used the previous version of your (great) plugin, I had troubles trying to implement also gesture for mobile devices. Will these be included in the new version? And will they maybe be usable for photo and video/doc/pdf/etc. as well? Thank you! |
@fedyd I want to keep the library slim, so video/doc/pdf will unlikely be supported by the core. It should be possible to implement via API though. |
Hi @dimsemenov , I'm so happy to read this and look through the demos. I'll have a closer look this weekend, but from what I've seen it is really impressive. Cannot wait to try it out a little. |
@dimsemenov thank you. got it! |
Great to see a fresh start on PhotoSwipe! I'll give it a test in a side project while its in beta... |
Just tried the beta branch out in a vite.js powered app. So far so good! Will let you know in case I run into any problems. |
Great to see progress on V5 👌 Although somewhat outdated, Photoswipe 4 was still one of the best "popup" options for images. I spent some time myself modernizing the core and interface, which can be seen here: Following with great interest. |
What's the reason behind ditching history API and social sharing/deeplinking? |
History API is removed because of inconsistent behavior across different routing systems (such as Turbolinks), it also pollutes the user browser history in some cases (which makes back/forward browser actions unpredictable). And Sharing API is removed as it forces you to load JS library right away, which is non-ideal in terms of page load speed. It also just doesn't work if the browser isn't supported. And Open Graph data is incorrect when just |
This looks extremely promising. I'm refactoring my entire application frontend now (Rails/Sprockets/jquery to Rails/webpack/vanilla-js/Stimulus) and I'm struggling with Photoswipe because of an old and opaque jquery initializer script, and thinking maybe I should just make the jump to v5 to avoid the extra work. Getting this to work seems to take minimal effort unless you're doing something crazy. I'm a novice, and I got it to work with Rails with responsive images and captions in fifteen minutes with a working backend. In contrast, getting a barely working refactored v4 setup up and running took me hours and hours, and that wasn't even with responsive images (not the fault of v4 per se, my old setup was hard to parse). Great work lowering the barrier to entry, a lot of people will appreciate this! (And thanks for writing thorough examples, I never would have got captions to work otherwise.) I will test more the coming days to look for surprising behaviour (or bugs). One thing, though: Maybe I'm dense, but can I integrate the examples with a bundler like webpack? The main problem is the inclusion of the pswpModule core (and css) via the options as URL and not through, say, an import statement. Using the webpack path obviously doesn't work, since node_modules isn't a public path. I've put the whole Photoswipe dist folder in my public path for now, but would like to serve it from node_modules if I can (instead of using a separate script tag). If importing the core module and the css is possible, it's easier to help with testing transpiling as well. If that's a goal for you, that is! |
To be honest the "Native fullscreen button" is one of the pros on photoswipe please try not to remove it I use full screen option more often then the zoom in button not sure what other people's opinion on this but this is my use case. going directly to full screen is great but it is not good for accessibility which is becoming more and more important everyday. instead of directly opening full screen it will be nice to provide option to choose when and if user wants full screen thanks |
Should the options work allready or are the work in progress? I tried changing the backgound opacity and broke it. Liking the update so far. really good work |
@Cube707 documented options should work, how exactly are you modifying it? It must be a number between 0 and 1. Please open a separate issue if you won't be able to resolve the problem. @john-gr there is an example with native fullscreen here - https://photoswipe.com/v5/docs/native-fullscreen-on-open/ |
This looks awesome so far! I know how hard it can be to get stuff done like this with regards to motivation.
Being able to close the viewer by hitting back feels really intuitive, and it stood out to me as a missing feature. That said, I understand the issues, and as long as the API is there to open/close the viewer and listen to events or callbacks, I'm fine with that. |
Hi. I am using Photoswipe together with JIG. Can I make it to integrate PS v5 beta with JIG? Background for this. I want to use the PS Lightbox in a full screen mode together with the titel/caption/UI elements. With v4 I couldn't get it to work, only with framing. Looking forward to your answer. |
@dimsemenov - First of, thank you for all the time and effort you put into this project, great work! We are happily using I tried to replace PhotoSwipe v4 with v5-beta in our project (just as a POC),
When trying to switch to V5 beta I ran into following issues (I was using the core module, not the lightbox module, since we have our own custom lightbox):
Is this something you intentionally do not want to support in V5, or are those options just not implemented yet? I know that you can customize UI elements (https://photoswipe.com/v5/docs/styling/), and add custom buttons
I'm aware that this is a free, open-source project. I don't feel entitled to anything, and I hope my post does not come off as if I do. If you envision PhotoSwipe V5 to support to still use it in a way outlined above, and I can contribute to make it happen, just let me know! |
@jmory thanks a lot for the feedback, I'll try explain: About UI being a completely separate componentI understand that if you use something like Angular - you'd rather use Angular buttons. However, due to the nature of the PhotoSwipe, click/tap/drag events are handled in a special way and elements that are on top of the scrolling area are handled by the gallery. Also, the v5 UI is tiny, so I don't see the point to separate it from the core. You still can add any elements on top of PhotoSwipe, but they'll block gestures unless you either v5 indeed lacks documentation on how to disable UI elements, I'll try to improve this in the future patch. Currently, UI elements are just disabled by name, for example ( Inline galleryThe experimental v5 browser support range is much narrower and it's mainly designed to be used as a "lightbox" component. appendToEl optionBy default PhotoSwipe is added within If you're looking to add a custom sidebar you may use padding options. For example You may also use option getViewportSizeFn: () => {
return {
x: document.documentElement.clientWidth - 200,
y: window.innerHeight
};
} |
@dimsemenov The Browser Support part of the documentation contains a link to caniuse which just triggers a search for Is it the ECMAScript 2015 Spec, which is includes support for Modules (https://caniuse.com/es6) or is it Dynamic imports (https://caniuse.com/es6-module-dynamic-import)? Both differ quite a bit when it comes to supported browser versions. |
@dimsemenov What an awesome news! 🎉 Since I install Photoswipe via npm I'm having difficulties to import it. I opened a question here: @dimsemenov Is it in plan to add "support" for npm/Webpack-like environment? It's a keypoint for many in the choice of this library. Just one little note aside: please keep that amazing behaviour that scrolling down it closes the lightbox. Consider that many mainstream websites and apps have that, so it's popular UX for users. |
I was browsing through a series of pictures in a WhatsApp thread, and the back button closes the lightbox view, as is the custom on Android. Since the Photoswipe animation and general layout is pretty similar to WhatsApp's (it also has swipe down to close), muscle memory made me try the back button on my new v5 beta lightbox, and it of course went all the way to a different page. I don't think WhatsApp (or Google Photos, which behaves similarly) should decide what Photoswipe is like, but I would argue that not having back button close the lightbox violates the principle of least surprise, at least on Android where it's common to press the back button a lot because of its global design. When it comes to Turbo(links), I'm using it, and I already have plenty of workarounds for history weirdness. 😉 BTW, my preferred way of handling history would be to use pushstate when opening the lightbox, and replacestate when using next/previous. That way there will be less pollution of history, and the back button will always close the lightbox instead of showing the previous image. This is in line with Android convention (and, in my opinion, good UX design). Just a thought! |
@dimsemenov For me the ability to open the viewer from a unique URL is crucial, is that preserved without the history API? |
I agree with this completely. Will definitely miss History API! |
As much as I agree that the UX of having the History API is way better than not, I think it may also work out well if that's handled by a separate package or plug-in, so that people who want to use it can and it won't cause issues in PhotoSwipe core. |
After lightGallery, fancybox 4 I'm here now, because both very well known lightboxes uses a zoom functionality that blurring images because they use css scale calculations (>1) to zoom to natural size. That's ok for desktop but on mobile it is unacceptable. only the fancybox 4 developer saw a bigger problem in this .... but the way PhotoSwipe it does is the only right one. Perfectly sharp images. The big con of PhotoSwipe is the unusual way to include it. I’m working with laravelmix/webpack and I can’t get it work in my bundled js. So I have to implement it separately. Another not so nice thing are some frontend developer things. For instance: why is the background opacity a js option, although this could be better placed in the css file. Or why the icons images are an js option too? They should be defined in the css file too. But it’s ok - I can live with that atm. Really nice would be a soft fade between slides. it feels unusual incomplete that images are opened via a nice transition and swapping from image to image is totally basic. Thanks for your work and I look forward for improvements. |
I agree that's it's the issue, and I'll improve this part before the release. For now, while it's in beta, you may import it like this #1764 (comment)
Background is a JS option because it's animated and changed via JS (for stuff like close on vertical drag). And I can't use |
Would it be possible to have the JavaScript set and update a CSS custom property? That way you can control it from JavaScript, but allow more customizability in third-party stuff. You could name it something descriptive like You could then in the PhotoSwipe stylesheet(s) just have See |
@Ambient-Impact that will likely trigger the style calculations on each frame, which will hurt performance. |
I successuflly switch from lightGallery to PhotoSwipe v5 now. Beside new icons, I added an auto hide functionality for controls, toolbar and caption in desktop view. Additionally the pswp background contains a blurry thumbnail version of the slide now. As said - I'm really really happy with the quality on mobile. Thanks for this nice work! https://photos.alexander-korn.de/de/india-2014 Update: I also implemented an autoplay and download function now. :) |
Hmm, good point. Might be worth verifying if it always does or only if the custom property is used for certain properties? I can imagine browsers might get clever with optimizing that. |
I've looked at many different image viewer libraries, and PhotoSwipe(v5) has the smoothest, most native-like behavior on mobile. |
Great lib! |
@lingtalfi I'm not sure what you mean, can you elaborate, please? You may open a new issue. |
Oops my bad, it's just that my code used "pswp-link" as the child selector and I confounded the example in the docs with my code for a bit. Everything is fine in the doc, false alert :) |
Not sure how to troubleshoot this, but upgrading from 5.0.3 to latest gives me a new console error in Firefox (no error in Chromium):
As far as I can tell, everything seems to be working. I haven't dug really deep into srcset handling etc., but I can't see any visual problems, just a console message. 🤔 |
Here is my feedback. This means enqueuing the correct files and creating an easy to understand initialization (photoswipe-init.js) file. Adding a working PhotoSwipe WordPress tutorial will also gather some more attention to the project. I went ahead and added this new issue: |
Looks promising. Photoswipe 4 was amazing but the installation was a little complex. Any The docs should use CDN (Easier for users than only to do |
Thanks so much for this library/rewrite! It took a bit to get it to work as a JS noob (so a couple of tips below) but in the end it's really easy to set up and now it's working great with jpg, jpeg and png files! :) Are there any plans to also support TIFF (.tif) in the future? Tips for other noobs:
|
@dimsemenov - thanks for a great project! Do you have a timeframe for when v5 will be production ready? I'm working on a new project and wondering whether to use v4 or wait for v5? |
Use v5. I'm using it on a few live projects for about a month. I need to finish a few things before it'll be released officially (on npm etc.), but there should not be breaking changes.
Ye, I'll likely use Skypack as it makes it easy to import es modules once v5 will be released on NPM. I'm locking this thread, as it becomes hard to maintain. Thank you all for the feedback, if you got more - please open a separate issue, or just email me directly. |
Demo and docs for the new version
Hi all,
I'd like to share an update on the PhotoSwipe development. And I need your feedback.
Code rewrite and quality
I rewrote everything to modern JavaScript, it should now be easier to contribute or extend. Total JS file size is reduced by about 15%. The code is published in v5-beta branch (
src/
for source files,dist/
for compiled files).Skinning
PhotoSwipe no longer requires an external sprite and has only a single CSS file. Default icons are generated via JavaScript and are very small. Minor styling can be done via CSS variables.
I designed the new icons so they're visible on the dark and light background without having a dark backdrop:
A new guide on how to use your own icons →
Initialization
As you probably know, the current PhotoSwipe initialization is quite a mess, I'm trying to fix this problem.
In the new version, you're no longer required to include HTML structure for the lightbox itself.
The new version is split into two components, the second is loaded only after user initiates opening, so basic initialization looks like this:
More info about what this code does here.
Obviously, such initialization is optional, and you can just include files via script src.
Animations
prefers-reduced-motion
.Opening from cropped thumbnail
PhotoSwipe is now able to animate from the cropped thumbnail. Test it →
Opening image in a zoomed state
It's now easier to control the initial zoom level, Test it →.
Reponsive images
You may now define
srcset
for images inside the lightbox.PhotoSwipe now automatically generates and updates
sizes
attribute depending on zoom level.Features that will likely be removed:
You may now support PhotoSwipe on OpenCollective
I've lost motivation and abandoned the project for a year. I'm trying to find a way to prevent this from happening in the future and keep PhotoSwipe free and open-source.
I've created an OpenCollective account, consider sponsoring PhotoSwipe development. To give something in return I will provide email support for sponsors, so you may ask any question if you're having a problem.
If you have a minute, please test demos for v5 Beta on your mobile device, report issues via GitHub, or just email me.
The text was updated successfully, but these errors were encountered: