kolkov / ngx-gallery

A simple responsive native gallery component for Angular 8+.
https://ngx-gallery.kolkov.ru/
MIT License
115 stars 56 forks source link

Fallback image #105

Open niklasxulls opened 1 year ago

niklasxulls commented 1 year ago

A very important thing that this package is missing, is the option to set a placeholder picture/a fallback background-image, since the main picture may not load. The problem is, that you just url encode e.g the big property on the image and put it inside of background-image: url("...."), hence it's not possible to add a fallback by myself. Usually this would look like background-image: url("https://..."), url("/assets/images/placeholder.png").

It would be great if you could add such an option for a placeholder picture, or - this seems easier - allow the consumer of this package to define the value of background-image itself. Therefore you would just check if the provided value for "big" (example) contains the string url("... if so, you don't process the provided value any further, elsewise you serialize it and wrap it with url("... itself, as it is the case currently.