Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's 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 it's URL and the proper URL extention.

+ add another resource


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


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.


Save Automatically?

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.


                <h1 class="h5 mb-3">Flmngr: manage image gallery</h1>

<div id="btn" class="btn btn-primary" style="opacity:0.2;cursor:default">Manage gallery...</div>
<div id="loading" style="font-size:12px">Loading file manager...</div>
<p class="hint"><b>Hint</b>: after you selected gallery images,<br/> you can re-manage the existing gallery.</p>

<h2 class="h5 mt-5">Image gallery</h2>

<p id="hint" style="display:none" class="hint"><b>Hint</b>: the previews are clickable.</p>

<div id="images">
  <p>0 images selected</p>



                body {
  padding: 20px;
  background-color: #F4F4F4;

#images {
  .image {
    border: 1px solid #DDD;
    box-shadow: 5px 5px 0 0 #DDD;
    background-color: white;
    padding: 10px;
    display: inline-flex;
    flex-direction: column;
    margin: 0 25px 25px 0;
    img {
      max-height: 250px;
      cursor: pointer;
      border: 2px solid #007FFF;

      &:hover {
        border-color: orange;
    p {
      margin: 5px 0 0 0;
      font-size: 14px;
      color: #444;

.lum-img {
  cursor: zoom-out;
  max-width: 100vw !important;
  max-height: 100vh !important;

.lum-lightbox {
  z-index: 1000;
  cursor: zoom-out;

.lum-lightbox-inner img {
  margin: 0 auto;

.lum-lightbox-image-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;

.lum-close-button {
  cursor: pointer;

.lum-lightbox-image-wrapper {
    background: rgba(0, 0, 0, 0.7);

.hint {
  color: #007FFF; 
  margin-top: 10px; 
  line-height: 16px;


                // In real app replace with:
// import Flmngr from "flmngr";
import Flmngr from "";

// This demo uses a script for animating showing full-screen image when user clicks on a preview (a-la LightBox)
import {LuminousGallery} from "";

  apiKey: "FLMNFLMN",
  urlFileManager: '',
  urlFiles: '',
  imageFormats: [
        id: "preview",
        title: "Preview",
        suffix: "-preview",
        maxWidth: 250,
        maxHeight: 250
}, {
  onFlmngrLoaded: () => {

function selectFiles() {
  // Collect URLs of images of existing gallery set
  let elsExistingImages = document.querySelectorAll(".image > img");
  let urls = [];
  for (let i=0; i<elsExistingImages.length; i++)
    list: urls,
    isMultiple: true,
    acceptExtensions: ["png", "jpeg", "jpg", "webp", "gif"],
    createImageFormats: ["preview"],
    onFinish: (files) => {

function showSelectedImages(files) {
  let elImages = document.getElementById("images");
  elImages.innerHTML = "";
  let elP =  document.createElement("p");
  elP.textContent = files.length + " images selected";
  for (let file of files) {
    let filePreview = file.formats.find(file => file.format === "preview");
    let urlPreview = Flmngr.getNoCacheUrl(filePreview.url);
    let urlOriginal = Flmngr.getNoCacheUrl(file.url)
    let el = document.createElement("div");
    el.className = "image";
    let elImg = document.createElement("img");
    elImg.src = urlPreview;
    elImg.alt = "Image selected in Flmngr";
    elImg.setAttribute("data-src-original", urlOriginal);
    let elP = document.createElement("p");
    elP.textContent = file.url;

function attachLightBoxToGallery() {

  let elsPreviews = document.querySelectorAll(".image > img");
  document.getElementById("hint").style.display = elsPreviews.length > 0 ? "block" : "none";

  elsPreviews.forEach(el => {
    if (!el.hasAttribute("data-src-original"))
      el.setAttribute("data-src-original", el.getAttribute("src"));

  new LuminousGallery(
      "arrowNavigation": true
      "showCloseButton": true,
      "sourceAttribute": "data-src-original",

function attachOnClickListenerToButton() {
  let elBtn = document.getElementById("btn");
  // Style button as ready to be pressed = 1; = "pointer";
  let elLoading = document.getElementById("loading");
  // Add a listener for selecting files
  elBtn.addEventListener("click", () => {