Code Monkey home page Code Monkey logo

ui's Introduction

Fancyapps UI

Collection of task-oriented components that will make you more productive. Packed full of features that you and your clients will love.

Full docs with examples: https://fancyapps.com/

License

This is commercial software. See LICENSE.md for more info.

ui's People

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  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  avatar  avatar  avatar  avatar  avatar  avatar

ui's Issues

Fancybox video gallery autoplays all the videos

I created a gallery of all videos using html type and I want it to be autoplayed when clicked but all videos (even when not selected) is autoplaying in the background (because I'm hearing the audio of the all the videos I included).

Trouble getting events to fire

I'm having a hard time getting the 'load' or 'done' event to fire. For the code below, the init works fine, but the load event doesn't fire. My popup is just one slide (a modal), not sure if that matters.

var popup = new Fancybox(
{
  type: 'ajax', 
  src: '/?view=popup-email'
},
{
  on: {
    init: function(fancybox, slide) {
     console.log('fancybox init');
    },
   load: function(fancybox, slide) {
     console.log('fancybox loaded content');
   }
  }
});

I've also tried it this way:

popup.on("load", function(fancybox, slide) {
  console.log('fancybox loaded content');
});

But that doesn't work for me either. What am I doing wrong?

Basically what I need is to know when the HTML has been added to the page so I can set up some new events on those elements in the popup.

New upscaling/zoom behaviour causes blurry images (Panzoom)

If I'm not completely wrong, the behavior of how images are scaled to 100% has changed in comparison to fancybox 3.

Fancybox 4 uses now css transform and scales the image up to - for example - scale(1.4066). This causes naturally a little blurred image also if the calculation is right and the scaled image corresponds 1:1 to the natural image size.

It's the browser's transform scale rendering that blurs the image and after a lot of research about this, this can't be fixed with css tweaks.

The lower the screen resolution, the more the problem appears:

left fancybox 4, right the image url opened

At the end this is very sad for all user who want to show her images on mobile devices with panzoom functionality.

The solution could only be another way to reach the 1:1 / zoomed view of an image - without any css transform upscaling.

rebuild fancyapp !

Hi, thanks for this great improvement to remove JQuery and make it JS vanilla plus add an amazing Carousel and zoom
(Huge Thanks)

I have a small problem, I have a Carousel Gallary which includes many photos 10-12 but these photos are filtered into several tags eg: sport, education, kitchen, etc...
under the Carousel I have tags on each tag click I want to rebuild the Carousel according to the selected tag

but the method destroy is not working correctly, also init() the same

    let myCarousel = new Carousel(document.querySelector("#myCarousel"), {
        slidesPerPage: 1,
        preload: 2,
        Dots: false

    });
const filterGallary = Fancybox.bind('[data-fancybox="gallery"]', {
    closeButton: "top",
    dragToClose: false,
    Thumbs: false,
    Carousel: {
        Dots: false,
    },
});

I tried several solutions mostly doesn't work, the final solution I made is to remove slides and add new slides
the problem with this solution is that Carousel is not considered these changes and I still have white places instead of old slides, the same also to redraw the slide itself eg πŸ‘


   document.querySelector("#myCarousel .carousel__track").innerHTML = ""
let templates = ''
   needed.forEach((item, i) => {
       let template = `  <div
         class="carousel__slide"
         data-src="/storage/${item.src}"
         data-fancybox="gallery"
         data-caption="${item.name}"

       >
         <img
         width="600"
         height="420"
             src="/storage/Thumbs/fit/850/600/${item.src}"
            alt="${item.name}"
         />
       </div>`
       templates += template
   });
   document.querySelector("#myCarousel .carousel__track").innerHTML = templates
   myCarousel.destroy();

   let myCarousel = new Carousel(document.querySelector("#myCarousel"), {
       slidesPerPage: 1,
       preload: 2,
       Dots: false,
   });


thanks for helping in advance!

Time estimate for autoplay, buttons, etc?

Just wondering if there is any time estimate for when some of the final features are going to be added. Been using fancybox for years and like many others am changing things to be jquery free. At the same time, I notice a lot of the things I use and love about fancybox haven't been added in yet (buttons, autoplay, and so on, plus the documentation isn't quite all listed yet). Any information would be great. Thanks!

fancybox.umd.js can’t in head tag

Hello,
It seems that fancybox.umd.js cannot be included in the head tag, but the help document does not explain.
How should I make fancybox.umd.js dependencies can be included in the head tag?

html example, it canβ€˜t work
<!DOCTYPE html>
<html>
<head>
  <link
  rel="stylesheet"
  href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.css"
/>
<script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.umd.js"></script>
</head>
<body>


<button data-fancybox data-src="#dialog-content">
  HTML element
</button>

<div id="dialog-content" style="display:none;">
  <h2>Hello, world!</h2>
</div>

<script>
  Fancybox.bind("[data-fancybox]", {
  // Your options go here
});
</script>
</body>
</html>

Iframe Keyboard Navigation

Hello,

I am currently in search for a lightbox alternative for our project and Fancybox looks like a very good choice. Especially the good integration of keyboard controls is a big plus for this plugin.

However, we have some cases where there are multiple Iframes in one gallery. The current behaviour is that once you get into one iframe, you navigate through all the other iframes of the gallery as well before regaining focus in the lightbox overlay.

To replicate this you can simply adjust this playground example (https://fancyapps.com/playground/vk) by duplicating the last video 'a'-tag.

Can a fix for this issue still be expected for the 4.0.0 release?

Thanks in advance!

Side-by-Side-use with the old fancybox?

We have a lot of websites that use the existing fancybox for certain things, and we would like to introduce the new one as well.

This may result in scenarios where the old and new are running on the same page.

Is there a safe way to ensure that they don't conflict or don't both try to operate on the same images?

Or could the new fancybox just ensure that it doesn't operate on tags which were already processed by the previous one (and vica-versa)?

Events triggered for preloaded images

Hi, when i use something like

Fancybox.bind("[data-fancybox]", {
  on: {
        done: (fancybox, slide) => {
            console.log(slide);
        }
   }
});

i would expect that the event only fires when a slide is shown, but it's also triggered for the slide before, and the slide after. So it seems the preloaded slides trigger the event too. I tried it with the load and reveal event too, with the same result. Maybe i understand here something wrong?

mainClass not getting added

I'm trying to use the 'mainClass' option to add a custom class. I see in the code it's supposed to add to the .fancybox__carousel, but it is not getting added.

var popup = new Fancybox(
[
{
type: 'ajax',
src: '/?view=popup-email',
mainClass: 'email-popup'
}
],{
on: {
init: function(){},
reveal: function(){}
});

Am I doing something wrong here?

About licensing

Hello, I wonder are we allowed to use it in our wordpress themes that we are selling to multiple clients with extended license? It was enough for V3 but I wanna be sure for V4.

Thanks.

Carousel

Installed the carousel. Scrolls with a large white space. Something went wrong???
2
1
myCarousel = new Carousel(document.querySelector("#carousel"),{slides: slide,'dragFree':true});

Vanilla CSS rather than SCSS, important for Shopify users

jQuery is no longer required with fancyapps ui, which is great!

Would be even better if there was also a vanilla css option.
Is this something you're working on or will consider?

SCSS is deprecated for Shopify and they now recommend only using vanilla CSS, so this rules out a lot of users from being able to fully embrace this.

Fancybox 3 Documentation

Glad to see the new Fancybox is finally released, and I'm excited to dig into it. That said, I expect to be using v3 for a while longer, and perhaps indefinitely for existing projects. Is the v3 website/documentation still available?

Change arrow icons?

Hi,

How can I change the prev and next arrow icons?

I tried:

template:{ prevTpl' <button type="button"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-left"><line x1="19" y1="12" x2="5" y2="12"></line><polyline points="12 19 5 12 12 5"></polyline></svg></button>', nextTpl: ''<button type="button"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-right"><line x1="5" y1="12" x2="19" y2="12"></line><polyline points="12 5 19 12 12 19"></polyline></svg></button>', },

This didn't work for me, so I changed my local copy of the fancybox.umd.js file for now.

Thanks!

[Suggestion] Class names namespace to avoid conflicts

Problem: Class name carousel is too generic - e.g. conflicts with bootstrap or prior own etc.

Solution: Add a fb namespace: e.g. fb- so it becomes fb-carousel__button

Sub problem: The options can change the class name - but e.g. carousel__button seems to be "hardcoded" in Fancybox.js

picture slideshow 'autoplay' ?

Hello,

Great to see the new version at work.
It was well worth the wait.
Do you intend to make it possible to enable some kind of picture 'autoplay' as was the case with v3 ?

The animation are not smooth

Trying to use new fancybox, i found the animation are not smooth

fancybox 3
TEST

fanvybox 4
TEST2

it seem like you are remove the hash option, can you bring it back? i want to set it to false, because it will cause the website reload when use in pjax

Roadmap / Time till stable?

We can't wait to use this in production ;)

Any idea of the timeline, till when it should be stable?

Many thanks for you awesome work!

Case sensitive problem with Html.scss file

Hi,

Shouldn't ui/src/Fancybox/plugins/Html/html.scss filename be in uppercase?

In fancyapps/ui/blob/main/src/Fancybox/Fancybox.scss the import is "Html.scss":

@import "plugins/Image/Image.scss";
@import "plugins/Html/Html.scss";
@import "plugins/Thumbs/Thumbs.scss";

Windows is not case sensitive, but when compiling in Linux occurs an error because the file plugins/Html/Html.scss doesn't exist.

Thanks!

Fancybox is not working if to include main script load via head tag

If to include fancybox main script file (in mine example it is fancybox.umd.js) in head tag

<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="panzoom.css">
    <link rel="stylesheet" href="fancybox.css">
    <script src="fancybox.umd.js"></script>
    <title>Document</title>
</head>

when Fancybox is not working at all
I'm using declarative method as said in documentation
<a href="https://lipsum.app/id/1/1024x768" data-fancybox>Image</a>

I need to add custom element to each image with template variable, no success

Hi, thanks for your project! I need to add custom element to each image in the gallery (I am adding functionality to rate each image with 5 star rating). Trying to use template variable, but no success. Is this not supported by the library?

var gallery = [
  {
    src: "https://lipsum.app/id/2/800x600",
    thumb: "https://lipsum.app/id/2/80x80",
    caption: "First image",
  },
  {
    src: "https://lipsum.app/id/3/800x600",
    thumb: "https://lipsum.app/id/3/80x80",
    caption: "Second image",
  },
  {
    src: "https://lipsum.app/id/4/800x600",
    thumb: "https://lipsum.app/id/4/80x80",
    caption: "Third image",
  },
];
const customHtml = "whatever..."
Fancybox.show(gallery,  {
   template: {
    main: customHtml
  }   
})

Panzoom Bug

The newest Update v4.0.0-beta.0 is broken (at least on Firefox 91 and Chrome 92.0.4515.131 on Windows). At click or zoom on an image, the zoom will instantly be reset to original (verified on https://fancyapps.com/docs/ui/panzoom/). Sometimes the position of an image is wrong if there are multiple panzooms on the same page.

why some options not work ?

<link
  rel="stylesheet"
  href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.css"
/>
<script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.umd.js"></script>

<script>
  window.addEventListener('load', () => {
    document.querySelectorAll('#article-container :not(a):not(.gallery-group) > img, #article-container > img').forEach(i => {
      let src = i.getAttribute('src')
      btf.wrap(i,'a',{'href': src, 'data-fancybox':"gallery"})
    })

    Fancybox.bind("[data-fancybox]", {
      showClass: false,
      hideClass: false,
      animated: false,
      closeButton: 'outside',
      Hash: false,

    })

  }) 
</script>

i found it still have animation.
the test website: https://test.immyw.com/Gallery/ohmygirl

data-main-class stop working after update

hi i found the following bug appear on the last version
<a class="DDVRR" href="#" data-fancybox="xxxxx" data-main-class="fancy-option1" data-src="/storage/etc.jpg " />

thanks in advance

Thumb images do not showing when there are two object in Programmatic

var $imgs = [ { src: "https://lipsum.app/id/2/800x600", thumb: "https://lipsum.app/id/2/80x80", caption: "First image", }, { src: "https://lipsum.app/id/3/800x600", thumb: "https://lipsum.app/id/3/80x80", caption: "Second image", },

but it shows when there are three object

How can I solve the problem ?

toolbar.scss - can't compile

Not sure if this is a problem with my compiler being older or what, but it is not liking line 22 in Toolbar.scss in the 4.0.0-beta.0

Error: wrong number of arguments (1 for 3) for `rgb'

text-shadow: var(--fancybox-toolbar-text-shadow, 1px 1px 1px rgb(0 0 0 / 40%));

Unfortunately the app I use for 'on the fly compiling/minimizing' in Windows hasn't been updated in some time so hopefully there is a work-around for this.

Download button

Hi,

Loving the new fancybox.

What's the best way to add a download button for the image, think fancybox 3 use to display this by default.

Ben

Animated: false won't work

First of all congrats for the new release, it looks very cool so far!

A thing i discovered is that setting animations inactive won't work. I tried

Fancybox.bind("[data-lightbox]", {
    showClass: false,
    hideClasse: false
}

or

Fancybox.bind("[data-lightbox]", {
    animated: false
}

but both variants won't prevent fancybox to bring the slide and fade animation on showing images.

but both

PDF content not displayed in Fancybox 4.0.0 Alpha 2

Used v3 for years to display images and PDF files. Noticed v4 is available and upgraded today. Unfortunately, PDF content is not displayed in v4. All I see is an white placeholder. Are there any special requirements for new version to display PDF content?

In v3, it was enough to add this:

data-type="iframe"

Infinite gallery

First of all, thanks for this great plugin!

The example from the docs shows single images in the gallery instead of two listed images.
https://fancyapps.com/docs/ui/fancybox/api#initialization

<div id="gallery">
  <a href="https://lipsum.app/id/1/800x600">
    <img src="https://lipsum.app/id/1/300x225" />
  </a>

  <a href="https://lipsum.app/id/2/800x600">
    <img src="https://lipsum.app/id/2/300x225" />
  </a>
</div>

<script>
  Fancybox.bind("#gallery a", {
    on : {
      ready : (fancybox) => {
        console.log(`fancybox #${fancybox.id} is ready!`);
      }
    }
  });
</script>

I'd like to use the bind method to observe the container for elements and add slides dynamically (I use infinite scroll in the grid).

Fancybox 4 seems to be missing Download button support?

Could you please add Download button support, with it's own attribute, so it can be different to the previewed url.
data-download="download url goes here.."

For example,
we might use iframe to support pdf js,.. but need the download action to download the original pdf file.

Thank you!

slide # out of total added to captions?

Was doing this in the old jquery version which allowed me to add a '# of #' to the caption to show the current out of total for the viewing gallery. Is there a similar method in this version?

    caption : function( instance, item ) {
        var caption = $(this).data('caption') || '';
	
        return ( caption.length ? caption + '<br>' : '' ) + '<span class="fancybox-number"><span data-fancybox-index></span> of <span data-fancybox-count></span></span>';
    },

Reload causes UI init problems

For my galleries I took the "Facebook inspired design, thumbnail images for background" example from the showcase.

This works very well but on reloading the page, when fancybox opens again by itself, the UI is broken and the background are gone.

React wrapper

In doc we can found short info about implementation Fancybox in React (https://fancyapps.com/docs/ui/fancybox/react). Could somebody help me with import that NativeFancybox? I added with Yarn @fancyapps and insert an import: @fancyapps/ui/dist/fancybox.esm, but it doesn't work, because of undefined

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.