Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div class="header d-flex flex-column align-items-center">
  <h1 class="display-6 mt-3 mb-0">lightGallery</h1>
  <p class="lead mt-2 mb-4">
    lightGallery is a feature-rich, modular JavaScript gallery plugin for building beautiful image and video galleries for the web and the mobile
  </p>
  
    <p class="lead mt-2 mb-4">
   With lightGallery, you can create both carousel slider and lightBox galleries. You can create inline gallery by passing the container element via container option. All the lightBox features are available in inline gallery as well. inline gallery can be converted to the lightBox gallery by clicking on the maximize icon on the toolbar


  </p>
 
  <a class="btn mb-5 btn-outline-primary" href="https://github.com/sachinchoolur/lightGallery" target="_blank">View on GitHub</a>
</div>
<div class="d-flex justify-content-center">
  <div id="inline-video-gallery-container" class="inline-gallery-container"></div>
</div>
              
            
!

CSS

              
                body {
  padding: 40px;
  background-image: linear-gradient(#e8f0ff 0%, white 52.08%);
  color: #0e3481;
  min-height: 100vh;
}

.header .lead {
  max-width: 620px;
}

.inline-gallery-container {
  width: 700px;
  height: 500px;
  position: relative;
}
              
            
!

JS

              
                import lightGallery from "https://cdn.skypack.dev/lightgallery@2.4.0";

import lgZoom from "https://cdn.skypack.dev/lightgallery@2.4.0/plugins/zoom";
import lgThumbnail from "https://cdn.skypack.dev/lightgallery@2.4.0/plugins/thumbnail";

import lgVideo from "https://cdn.skypack.dev/lightgallery@2.4.0/plugins/video"
console.log(lgVideo, 'lgVideo')



const $lgInlineVideoContainer = document.getElementById(
    'inline-video-gallery-container',
);

if ($lgInlineVideoContainer) {
    const _inlineGallery = lightGallery($lgInlineVideoContainer, {
        container: $lgInlineVideoContainer,
        dynamic: true,
        thumbnail: true,
        swipeToClose: false,
        // addClass: 'lg-inline',
        mode: 'lg-scale-up',
        slideShowAutoplay: true,
        hash: false,
        pager: false,
        closable: false,
        showMaximizeIcon: true,
        rotate: false,
        download: false,
        slideDelay: 400,
        plugins: [lgThumbnail, lgVideo],
        // appendSubHtmlTo: '.lg-item',
        dynamicEl: [
           {
      src: 'https://youtu.be/IUN664s7N-c',
      subHtml: `<h4>'Peck Pocketed' by Kevin Herron | Disney Favorite</h4>`,
    },
    {
      src: 'https://www.youtube.com/watch?v=ttLu7ygaN6I',
      subHtml: `<h4>The Heart Of The Forest| Disney Favorite</h4>`,
      thumb: 'https://img.youtube.com/vi/your_youtube_video_id/mqdefault.jpg',
    },
    {
      src: 'https://www.youtube.com/watch?v=C3vyugaBhSs',
      subHtml: `<h4>UE5 | In The Heart Of The Forest by Anastasia Gorban</h4>`,
    },
           
        ],
    });
    _inlineGallery.openGallery();
}
              
            
!
999px

Console