<div class="gallery-container">
    <button class="btn gallery-indicator js-gallery-indicator">
    Open Gallery
    <span class="js-gallery-count"></span>
    <svg class="icon icon--expand">
  <use xlink:href="/assets/icons/sprite-sheet.svg#expand"></use>
</svg>
  </button>
    <div class="gallery js-gallery" itemscope itemtype="http://schema.org/ImageGallery">
        <figure class="gallery-figure gallery-figure--lead" itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject">
            <a class="gallery-link" href="/assets/images/photogallery/photogalleryPortrait.jpg" itemprop="contentUrl" data-size="620x930">
                <img class="gallery-image gallery-image--portrait" src="/assets/images/photogallery/photogalleryPortrait.jpg" itemprop="thumbnail" alt="Image alt example" />
            </a>
            <figcaption class="gallery-figcaption" itemprop="caption description">
                Christy Altomare (center) stars in Anastasia, directed by Darko Tresnjak, at the Broadhurst Theatre.
                <span class="image-attribution">(© Matthew Murphy)</span>
            </figcaption>
        </figure>
        <figure class="gallery-figure gallery-figure--collection" itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject">
            <a class="gallery-link" href="/assets/images/photogallery/photoGallery1.jpg" itemprop="contentUrl" data-size="1200x800"></a>
            <figcaption class="gallery-figcaption" itemprop="caption description">
                Donec quam felis ultricies nec
            </figcaption>
        </figure>
        <figure class="gallery-figure gallery-figure--collection" itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject">
            <a class="gallery-link" href="/assets/images/photogallery/photoGallery3.jpg" itemprop="contentUrl" data-size="1200x800"></a>
            <figcaption class="gallery-figcaption" itemprop="caption description">
                Aenean imperdiet etiam
            </figcaption>
        </figure>
        <figure class="gallery-figure gallery-figure--collection" itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject">
            <a class="gallery-link" href="/assets/images/photogallery/photoGallery4.jpg" itemprop="contentUrl" data-size="1200x800"></a>
            <figcaption class="gallery-figcaption" itemprop="caption description">
                Curabitur ullamcorper ultricies nisi. Nam eget dui. Etiam rhoncus.
            </figcaption>
        </figure>
        <figure class="gallery-figure gallery-figure--collection" itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject">
            <a class="gallery-link" href="/assets/images/photogallery/photoGallery5.jpg" itemprop="contentUrl" data-size="1200x800"></a>
            <figcaption class="gallery-figcaption" itemprop="caption description">
                Maecenas nec odio et ante tincidunt tempus.
            </figcaption>
        </figure>
        <figure class="gallery-figure gallery-figure--collection" itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject">
            <a class="gallery-link" href="/assets/images/photogallery/photoGallery6.jpg" itemprop="contentUrl" data-size="1200x800"></a>
            <figcaption class="gallery-figcaption" itemprop="caption description">
                Aenean vulputate eleifend tellus.
            </figcaption>
        </figure>
        <figure class="gallery-figure gallery-figure--collection" itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject">
            <a class="gallery-link" href="/assets/images/photogallery/photoGallery7.jpg" itemprop="contentUrl" data-size="1200x800"></a>
            <figcaption class="gallery-figcaption" itemprop="caption description">
                Nullam dictum felis eu pede
            </figcaption>
        </figure>
    </div>
</div>

<!-- Default config of Photoswipe below. Added TM icons and basic btn classes to reduce styling.
    Taken from: http://photoswipe.com/documentation/getting-started.html
    A React port can be found here: https://github.com/minhtranite/react-photoswipe -->

<!-- Root element of PhotoSwipe. Must have class pswp. -->
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">
    <!-- Background of PhotoSwipe.
      It's a separate element, as animating opacity is faster than rgba(). -->
    <div class="pswp__bg"></div>
    <!-- Slides wrapper with overflow:hidden. -->
    <div class="pswp__scroll-wrap">
        <!-- Container that holds slides. PhotoSwipe keeps only 3 slides in DOM to save memory. -->
        <!-- don't modify these 3 pswp__item elements, data is added later on. -->
        <div class="pswp__container">
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
        </div>
        <!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
        <div class="pswp__ui pswp__ui--hidden">
            <div class="pswp__top-bar">
                <!--  Controls are self-explanatory. Order can be changed. -->
                <button class="btn pswp__button pswp__button--fs" title="Toggle fullscreen">
          <svg class="icon icon--fullscreen">
  <use xlink:href="/assets/icons/sprite-sheet.svg#fullscreen"></use>
</svg>
        </button>
                <button class="btn pswp__button pswp__button--close" title="Close (Esc)">
          <svg class="icon icon--close">
  <use xlink:href="/assets/icons/sprite-sheet.svg#close"></use>
</svg>
        </button>
                <div class="pswp__counter"></div>
                <!-- Preloader demo https://codepen.io/dimsemenov/pen/yyBWoR -->
                <div class="pswp__preloader">
                    <div class="pswp__preloader__icn">
                        <svg class="icon icon--progress">
  <use xlink:href="/assets/icons/sprite-sheet.svg#progress"></use>
</svg>
                    </div>
                </div>
            </div>
            <div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
                <div class="pswp__share-tooltip"></div>
            </div>
            <button class="btn pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
        <svg class="icon icon--arrow-left">
  <use xlink:href="/assets/icons/sprite-sheet.svg#arrow-left"></use>
</svg>
      </button>
            <button class="btn pswp__button pswp__button--arrow--right" title="Next (arrow right)">
        <svg class="icon icon--arrow-right">
  <use xlink:href="/assets/icons/sprite-sheet.svg#arrow-right"></use>
</svg>
      </button>
            <div class="pswp__caption">
                <div class="pswp__caption__center"></div>
            </div>
        </div>
    </div>
</div>
<div class="gallery-container">
  <button class="btn gallery-indicator js-gallery-indicator">
    {{indicator-copy}}
    <span class="js-gallery-count"></span>
    {{render '@icons--expand'}}
  </button>
  <div class="gallery js-gallery" itemscope itemtype="http://schema.org/ImageGallery">
    <figure class="gallery-figure gallery-figure--lead" itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject">
      <a class="gallery-link" href="/assets/images/photogallery/{{image}}" itemprop="contentUrl" data-size="{{data-size}}">
        <img class="gallery-image{{#if portrait}} gallery-image--portrait{{/if}}" src="/assets/images/photogallery/{{imageSmall}}" itemprop="thumbnail" alt="{{image-alt}}" />
      </a>
      {{#if caption}}
        <figcaption class="gallery-figcaption" itemprop="caption description">
          {{caption}}
          {{#if attribution}}
            <span class="image-attribution">{{attribution}}</span>
          {{/if}}
        </figcaption>
      {{/if}}
    </figure>
    {{#if gallery-items}}
      {{#each gallery-items}}
        <figure class="gallery-figure gallery-figure--collection" itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject">
            <a class="gallery-link" href="/assets/images/photogallery/{{image}}" itemprop="contentUrl" data-size="{{data-size}}"></a>
            {{#if caption}}
              <figcaption class="gallery-figcaption" itemprop="caption description">
                {{caption}}
                {{#if attribution}}
                  <span class="image-attribution">{{attribution}}</span>
                {{/if}}
              </figcaption>
            {{/if}}
        </figure>
      {{/each}}
    {{/if}}
  </div>
</div>

<!-- Default config of Photoswipe below. Added TM icons and basic btn classes to reduce styling.
    Taken from: http://photoswipe.com/documentation/getting-started.html
    A React port can be found here: https://github.com/minhtranite/react-photoswipe -->

<!-- Root element of PhotoSwipe. Must have class pswp. -->
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">
  <!-- Background of PhotoSwipe.
      It's a separate element, as animating opacity is faster than rgba(). -->
  <div class="pswp__bg"></div>
  <!-- Slides wrapper with overflow:hidden. -->
  <div class="pswp__scroll-wrap">
    <!-- Container that holds slides. PhotoSwipe keeps only 3 slides in DOM to save memory. -->
    <!-- don't modify these 3 pswp__item elements, data is added later on. -->
    <div class="pswp__container">
      <div class="pswp__item"></div>
      <div class="pswp__item"></div>
      <div class="pswp__item"></div>
    </div>
    <!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
    <div class="pswp__ui pswp__ui--hidden">
      <div class="pswp__top-bar">
        <!--  Controls are self-explanatory. Order can be changed. -->
        <button class="btn pswp__button pswp__button--fs" title="Toggle fullscreen">
          {{render '@icons--fullscreen'}}
        </button>
        <button class="btn pswp__button pswp__button--close" title="Close (Esc)">
          {{render '@icons--close'}}
        </button>
        <div class="pswp__counter"></div>
        <!-- Preloader demo https://codepen.io/dimsemenov/pen/yyBWoR -->
        <div class="pswp__preloader">
          <div class="pswp__preloader__icn">
            {{render '@icons--progress'}}
          </div>
        </div>
      </div>
      <div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
        <div class="pswp__share-tooltip"></div>
      </div>
      <button class="btn pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
        {{render '@icons--arrow-left'}}
      </button>
      <button class="btn pswp__button pswp__button--arrow--right" title="Next (arrow right)">
        {{render '@icons--arrow-right'}}
      </button>
      <div class="pswp__caption">
        <div class="pswp__caption__center"></div>
      </div>
    </div>
  </div>
</div>
{
  "indicator-copy": "Open Gallery",
  "image": "photogalleryPortrait.jpg",
  "imageSmall": "photogalleryPortrait.jpg",
  "portrait": true,
  "data-size": "620x930",
  "image-alt": "Image alt example",
  "caption": "Christy Altomare (center) stars in Anastasia, directed by Darko Tresnjak, at the Broadhurst Theatre.",
  "attribution": "(© Matthew Murphy)",
  "gallery-items": [
    {
      "image": "photoGallery1.jpg",
      "image-alt": "Image alt example",
      "caption": "Donec quam felis ultricies nec",
      "data-size": "1200x800"
    },
    {
      "image": "photoGallery3.jpg",
      "image-alt": "Image alt example",
      "caption": "Aenean imperdiet etiam",
      "data-size": "1200x800"
    },
    {
      "image": "photoGallery4.jpg",
      "image-alt": "Image alt example",
      "caption": "Curabitur ullamcorper ultricies nisi. Nam eget dui. Etiam rhoncus.",
      "data-size": "1200x800"
    },
    {
      "image": "photoGallery5.jpg",
      "image-alt": "Image alt example",
      "caption": "Maecenas nec odio et ante tincidunt tempus.",
      "data-size": "1200x800"
    },
    {
      "image": "photoGallery6.jpg",
      "image-alt": "Image alt example",
      "caption": "Aenean vulputate eleifend tellus.",
      "data-size": "1200x800"
    },
    {
      "image": "photoGallery7.jpg",
      "image-alt": "Image alt example",
      "caption": "Nullam dictum felis eu pede",
      "data-size": "1200x800"
    }
  ]
}
  • Content:
    /**
     * @overview Photo Gallery.
     * Employs Photoswipe: https://github.com/dimsemenov/photoswipe
     * Using default config taken from: http://photoswipe.com/documentation/getting-started.html
     * TODO: Convert to ES6/clean up formatting. This might not be necessary since site will
     * probably employ react port.
     * Custom elements: opening gallery on button click, options and displaying gallery image count.
     * @module Photo-Gallery.js
    */
    
    var initPhotoSwipeFromDOM = function(gallerySelector) {
        // Custom - get number of figures to display image count
        var galleries = document.querySelectorAll('.js-gallery');
    
        var displayImageCount = function(el) {
          var countText = el.previousElementSibling.querySelector('.js-gallery-count');
          var nodes = el.children.length;
          countText.innerText = '(' + nodes + ' Images)';
        };
    
        for (var i = 0; i < galleries.length; i++) {
          displayImageCount(galleries[i]);
        }
    
        // parse slide data (url, title, size ...) from DOM elements
        // (children of gallerySelector)
        var parseThumbnailElements = function(el) {
            var thumbElements = el.childNodes,
                numNodes = thumbElements.length,
                items = [],
                figureEl,
                linkEl,
                size,
                item;
    
            for(var i = 0; i < numNodes; i++) {
    
                figureEl = thumbElements[i]; // <figure> element
    
                // include only element nodes
                if(figureEl.nodeType !== 1) {
                    continue;
                }
    
                linkEl = figureEl.children[0]; // <a> element
    
                size = linkEl.getAttribute('data-size').split('x');
    
                // create slide object
                item = {
                    src: linkEl.getAttribute('href'),
                    w: parseInt(size[0], 10),
                    h: parseInt(size[1], 10)
                };
    
    
    
                if(figureEl.children.length > 1) {
                    // <figcaption> content
                    item.title = figureEl.children[1].innerHTML;
                }
    
                if(linkEl.children.length > 0) {
                    // <img> thumbnail element, retrieving thumbnail url
                    item.msrc = linkEl.children[0].getAttribute('src');
                }
    
                item.el = figureEl; // save link to element for getThumbBoundsFn
                items.push(item);
            }
    
            return items;
        };
    
        // find nearest parent element
        var closest = function closest(el, fn) {
            return el && ( fn(el) ? el : closest(el.parentNode, fn) );
        };
    
        // triggers when user clicks on thumbnail
        var onThumbnailsClick = function(e) {
            e = e || window.event;
            e.preventDefault ? e.preventDefault() : e.returnValue = false;
    
            var eTarget = e.target || e.srcElement;
    
            // find root element of slide
            var clickedListItem = closest(eTarget, function(el) {
                return (el.tagName && el.tagName.toUpperCase() === 'FIGURE');
            });
    
            if(!clickedListItem) {
                return;
            }
    
            // find index of clicked item by looping through all child nodes
            // alternatively, you may define index via data- attribute
            var clickedGallery = clickedListItem.parentNode,
                childNodes = clickedListItem.parentNode.childNodes,
                numChildNodes = childNodes.length,
                nodeIndex = 0,
                index;
    
            for (var i = 0; i < numChildNodes; i++) {
                if(childNodes[i].nodeType !== 1) {
                    continue;
                }
    
                if(childNodes[i] === clickedListItem) {
                    index = nodeIndex;
                    break;
                }
                nodeIndex++;
            }
    
            if(index >= 0) {
                // open PhotoSwipe if valid index found
                openPhotoSwipe( index, clickedGallery );
            }
            return false;
        };
    
        // Custom event listener to open gallery with clicking on View Images btn.
        var indicatorBtn = document.querySelectorAll(`.js-gallery-indicator`);
    
        for (var j = 0; j < indicatorBtn.length; j++) {
          var btn = indicatorBtn[j];
          btn.addEventListener(`click`, () => {
            openPhotoSwipe(0, btn.nextElementSibling);
          });
        }
    
        // parse picture index and gallery index from URL (#&pid=1&gid=2)
        var photoswipeParseHash = function() {
            var hash = window.location.hash.substring(1),
            params = {};
    
            if(hash.length < 5) {
                return params;
            }
    
            var vars = hash.split('&');
            for (var i = 0; i < vars.length; i++) {
                if(!vars[i]) {
                    continue;
                }
                var pair = vars[i].split('=');
                if(pair.length < 2) {
                    continue;
                }
                params[pair[0]] = pair[1];
            }
    
            if(params.gid) {
                params.gid = parseInt(params.gid, 10);
            }
    
            return params;
        };
    
        var openPhotoSwipe = function(index, galleryElement, disableAnimation, fromURL) {
            var pswpElement = document.querySelectorAll('.pswp')[0],
                gallery,
                options,
                items;
    
            items = parseThumbnailElements(galleryElement);
    
            // define options (if needed)
            options = {
                animateSlide: true,
                showHideOpacity: true,
                bgOpacity: 0.9,
    
                // define gallery index (for URL)
                galleryUID: galleryElement.getAttribute('data-pswp-uid'),
    
                getThumbBoundsFn: function() {
                    // See Options -> getThumbBoundsFn section of documentation for more info
                    var thumbnail = items[0].el.getElementsByTagName('img')[0], // find thumbnail
                        pageYScroll = window.pageYOffset || document.documentElement.scrollTop,
                        rect = thumbnail.getBoundingClientRect();
    
                    return {x:rect.left, y:rect.top + pageYScroll, w:rect.width};
                }
    
            };
    
            // PhotoSwipe opened from URL
            if(fromURL) {
                if(options.galleryPIDs) {
                    // parse real index when custom PIDs are used
                    // http://photoswipe.com/documentation/faq.html#custom-pid-in-url
                    for(var j = 0; j < items.length; j++) {
                        if(items[j].pid == index) {
                            options.index = j;
                            break;
                        }
                    }
                } else {
                    // in URL indexes start from 1
                    options.index = parseInt(index, 10) - 1;
                }
            } else {
                options.index = parseInt(index, 10);
            }
    
            // exit if index not found
            if( isNaN(options.index) ) {
                return;
            }
    
            if(disableAnimation) {
                options.showAnimationDuration = 0;
            }
    
            // Pass data to PhotoSwipe and initialize it
            gallery = new PhotoSwipe( pswpElement, PhotoSwipeUI_Default, items, options);
            gallery.init();
        };
    
        // loop through all gallery elements and bind events
        var galleryElements = document.querySelectorAll( gallerySelector );
    
        for(var i = 0, l = galleryElements.length; i < l; i++) {
            galleryElements[i].setAttribute('data-pswp-uid', i+1);
            galleryElements[i].onclick = onThumbnailsClick;
        }
    
        // Parse URL and open gallery if it contains #&pid=3&gid=1
        var hashData = photoswipeParseHash();
        if(hashData.pid && hashData.gid) {
            openPhotoSwipe( hashData.pid ,  galleryElements[ hashData.gid - 1 ], true, true );
        }
    };
    
    // execute above function
    initPhotoSwipeFromDOM('.js-gallery');
    
  • URL: /components/raw/photo-galleries/Photo-Galleries.js
  • Filesystem Path: src/components/02-Patterns/Photo Galleries/Photo-Galleries.js
  • Size: 7.6 KB
  • Content:
    .gallery-container {
      position: relative;
    
      &:hover {
        .gallery-indicator {
          background: rgba($color-black, 0.75);
        }
      }
    }
    
    .gallery-indicator {
      position: absolute;
      padding: 0.75rem 1rem 0.6rem;
      top: 1rem;
      right: 1rem;
      background: rgba($color-black, 0.5);
      border-radius: $border-radius;
      outline: none;
      font-family: $font-title;
      color: $color-white;
      transition: $transition;
    
      &:hover {
        cursor: pointer;
      }
    }
    
    .icon--expand {
      .gallery-indicator & {
        display: none;
        margin-left: 0.5rem;
        width: 1.5rem;
        height: 1.5rem;
        stroke: $color-white;
        stroke-width: 2;
    
        @include breakpoint($break-xsmall) {
          display: inline;
        }
      }
    }
    
    .icon--fullscreen {
      .pswp__button--fs & {
        position: relative;
        stroke: $color-white;
        width: 1.25rem;
        height: 1.25rem;
        z-index: -1;
        stroke-width: 8;
      }
    }
    
    .gallery {
      margin-bottom: 2rem;
      pointer-events: all;
    
      .article-content & {
        margin-top: 0.5rem;
      }
    }
    
    .gallery-figcaption {
      margin-bottom: 0;
    
      .gallery-figure--collection & {
        display: none;
      }
    }
    
    .gallery-figure {
      display: block;
    }
    
    .gallery-figure--lead {
      background: $color-gray;
    }
    
    .gallery-image {
      margin: 0 auto;
    }
    
    .gallery-image--portrait {
      width: 100%;
      max-width: 25rem;
    }
    
    // Includes Photoswipe's default-skin.scss with overrides for custom theming.
    /*! PhotoSwipe Default UI CSS by Dmitry Semenov | photoswipe.com | MIT license */
    /*
    	Contents:
    
    	1. Buttons
    	2. Share modal and links
    	3. Index indicator ("1 of X" counter)
    	4. Caption
    	5. Loading indicator
    	6. Additional styles (root element, top bar, idle state, hidden state, etc.)
    */
    // PhotoSwipe uses Autoprefixer, so vendor prefixed are added automatically when needed.
    
    /*
    	1. Buttons
     */
    .pswp__button {
      position: relative;
      display: block;
      float: right;
      margin: 0;
      padding: 0;
      width: 2.75rem;
      height: 2.75rem;
      cursor: pointer;
      overflow: visible;
      opacity: 0.75;
      transition: $transition;
    
      &:focus,
      &:hover {
        opacity: 1;
      }
    
      &:active {
        outline: none;
        opacity: 0.9;
      }
    }
    
    /* pswp__ui--over-close class it added when mouse is over element that should close gallery */
    .pswp__ui--over-close .pswp__button--close {
      opacity: 1;
    }
    
    .pswp__button,
    .pswp__button--arrow--left:before,
    .pswp__button--arrow--right:before {
      width: 2.75rem;
      height: 2.75rem;
    }
    
    .icon--close {
      .pswp__button--close & {
        position: relative;
        width: 2.25rem;
        height: 2.25rem;
        z-index: -1;
        stroke: $color-white;
      }
    }
    
    .pswp__button--fs {
      position: absolute;
      display: none;
      top: -0.13rem;
      left: 0;
      width: 2.75rem;
      color: $color-white;
      font-family: $font-body;
      font-size: $ms-neg-1;
    }
    
    .pswp--supports-fs .pswp__button--fs,
    .pswp--zoom-allowed .pswp__button--zoom {
      display: block;
    }
    
    /* no arrows on touch screens */
    .pswp--touch {
      .pswp__button--arrow--left,
      .pswp__button--arrow--right {
        visibility: hidden;
      }
    }
    
    /*
      Arrow buttons hit area
      (icon is added to :before pseudo-element)
    */
    .pswp__button--arrow--left,
    .pswp__button--arrow--right {
      position: absolute;
      margin-top: -3.13rem;
      top: 50%;
      width: 4.38rem;
      height: 6.25rem;
      background: none;
    }
    
    .pswp__button--arrow--left {
      left: 0;
    }
    
    .pswp__button--arrow--right {
      right: 0;
    }
    
    .icon--arrow-right {
      .pswp__button--arrow--right & {
        position: relative;
        width: 2.5rem;
        height: 2.5rem;
        z-index: -1;
        stroke: $color-white;
      }
    }
    
    .icon--arrow-left {
      .pswp__button--arrow--left & {
        position: relative;
        width: 2.5rem;
        height: 2.5rem;
        z-index: -1;
        stroke: $color-white;
      }
    }
    
    /*
    	2. Share modal/popup and links
     */
    .pswp__counter,
    .pswp__share-modal {
      -webkit-user-select: none;
      -moz-user-select: none;
      user-select: none;
    }
    
    .pswp__share-modal--fade-in {
      opacity: 1;
    
      .pswp__share-tooltip {
        transform: translateY(0);
      }
    }
    
    /*
    	3. Index indicator ("1 of X" counter)
     */
    .pswp__counter {
      float: right;
      margin-right: 0.25rem;
      height: 2.75rem;
      opacity: 0.75;
      line-height: 3rem;
      font-size: $ms-neg-1;
      color: $color-background;
    }
    
    /*
    	4. Caption
     */
    .pswp__caption {
      position: absolute;
      left: 0;
      bottom: 0;
      width: 100%;
      min-height: 2.75rem;
    
      small {
        font-size: $ms-neg-1;
        color: $color-white;
      }
    }
    
    .pswp__caption__center {
      margin: 0 auto;
      padding: 0.63rem;
      max-width: 50rem;
      line-height: 1.25;
      font-size: $ms-neg-1;
      color: $color-white;
      text-align: center;
    }
    
    .pswp__caption--empty {
      display: none;
    }
    
    /* Fake caption element, used to calculate height of next/prev image */
    .pswp__caption--fake {
      visibility: hidden;
    }
    
    /*
      5. Loading indicator (preloader)
      You can play with it here - http://codepen.io/dimsemenov/pen/yyBWoR
     */
    .pswp__preloader {
      position: absolute;
      top: 0;
      left: 50%;
      width: 2.75rem;
      height: 2.75rem;
      opacity: 0;
      transition: $transition;
      will-change: opacity;
      direction: ltr;
    
      @include breakpoint($break-large) {
        position: relative;
        float: right;
        left: auto;
      }
    }
    
    .pswp__preloader__icn {
      margin: 0.75rem;
      width: 1.25rem;
      height: 1.25rem;
    }
    
    .pswp__preloader--active {
      opacity: 1;
    }
    
    .pswp--css_animation {
      .pswp__preloader--active {
        opacity: 1;
    
        .pswp__preloader__icn {
          animation: spin-clockwise 1.5s linear infinite;
        }
      }
    
    	.pswp__preloader__icn {
        position: absolute;
        margin: 0;
        top: 0.5rem;
        opacity: 0.75;
        transform-origin: 50% 55%;
    
        @include breakpoint($break-large) {
          left: 0.94rem;
        }
      }
    }
    
    .icon--progress {
      .pswp__preloader__icn & {
        width: 1.25rem;
        height: 1.25rem;
        stroke: $color-white;
        stroke-width: 5.5;
      }
    }
    
    /*
      6. Additional styles
     */
    /* root element of UI */
    .pswp__ui {
      -webkit-font-smoothing: auto;
      visibility: visible;
      opacity: 1;
      z-index: 50;
    }
    
    /* top black bar with buttons and "1 of X" indicator */
    .pswp__top-bar {
      position: absolute;
      left: 0;
      top: 0;
      width: 100%;
      height: 2.75rem;
    }
    
    .pswp__caption,
    .pswp__top-bar,
    .pswp--has_mouse .pswp__button--arrow--left,
    .pswp--has_mouse .pswp__button--arrow--right {
      -webkit-backface-visibility: hidden;
      will-change: opacity;
      transition: $transition;
    }
    
    /* pswp--has_mouse class is added only when two subsequent mousemove events occur */
    .pswp--has_mouse {
      .pswp__button--arrow--left,
      .pswp__button--arrow--right {
        visibility: visible;
      }
    }
    
    /* pswp__ui--idle class is added when mouse isn't moving for several seconds (JS option timeToIdle) */
    .pswp__ui--idle {
      .pswp__top-bar {
        opacity: 0;
      }
    
      .pswp__button--arrow--left,
      .pswp__button--arrow--right {
        opacity: 0;
      }
    }
    
    /*
    	pswp__ui--hidden class is added when controls are hidden
    	e.g. when user taps to toggle visibility of controls
    */
    .pswp__ui--hidden {
      .pswp__top-bar,
      .pswp__caption,
      .pswp__button--arrow--left,
      .pswp__button--arrow--right {
        /* Force paint & create composition layer for controls. */
        opacity: 0.001;
      }
    }
    
    /* pswp__ui--one-slide class is added when there is just one item in gallery */
    .pswp__ui--one-slide {
      .pswp__button--arrow--left,
      .pswp__button--arrow--right,
      .pswp__counter {
        display: none;
      }
    }
    
    .pswp__element--disabled {
      display: none !important;
    }
    
  • URL: /components/raw/photo-galleries/Photo-Galleries.scss
  • Filesystem Path: src/components/02-Patterns/Photo Galleries/Photo-Galleries.scss
  • Size: 7.2 KB

The photo gallery functionality employs Photoswipe.