A pure CSS lightbox

gravatar
CSS 2/3, perfundo
Snippet by Anon
996 0
HTML
<div class="c-hero qa-hero">
    <div class="o-vertical-spacing o-vertical-spacing--xl c-hero__inner">
        <div class="c-hero__head">
            <h1 class="c-h1">perfundo</h1>
            <h2 class="c-h3">
            a pure CSS lightbox
          </h2>
        </div>

        <h2>Single Image</h2>
        <div class="c-quick-demo">
            <div class="perfundo">
                <a class="perfundo__link" href="#perfundo-single2">
                    <img src="http://doodlenerd.com/Uploads/Resources/2018/08/Vo7q29KSJj0/images/img-single_s.jpg" alt="Demo image">
                </a>
                <div id="perfundo-single2" class="perfundo__overlay fadeInLeft">
                    <figure class="perfundo__content perfundo__figure">
                        <img src="http://doodlenerd.com/Uploads/Resources/2018/08/Vo7q29KSJj0/images/img-single_s.jpg" alt="Demo image">
                        <div class="perfundo__image" style="width: 800px; padding-top: 56.25%; background-image: url(http://doodlenerd.com/Uploads/Resources/2018/08/Vo7q29KSJj0/images/img-single.jpg);"></div>
                        <figcaption class="perfundo__figcaption">Single image with caption</figcaption>
                    </figure>
                    <a href="#perfundo-untarget" class="perfundo__close perfundo__control">Close</a>
                </div>
            </div>
        </div>

        <h2>Simple Gallery</h2>
        <div class="perfundo">
            <a class="perfundo__link" href="#perfundo-img1">
                <img src="http://doodlenerd.com/Uploads/Resources/2018/08/Vo7q29KSJj0/images/img1_s.jpg" alt="Demo image">
            </a>
            <div id="perfundo-img1" class="perfundo__overlay fadeIn">
                <figure class="perfundo__content perfundo__figure">
                    <img src="http://doodlenerd.com/Uploads/Resources/2018/08/Vo7q29KSJj0/images/img1_s.jpg" alt="Demo image">
                    <div class="perfundo__image" style="width: 800px; padding-top: 66.25%; background-image: url(http://doodlenerd.com/Uploads/Resources/2018/08/Vo7q29KSJj0/images/img1.jpg);"></div>
                </figure>
                <a href="#perfundo-untarget" class="perfundo__close perfundo__control">Close</a>
                <a class="perfundo__next perfundo__control" href="#perfundo-img2">Next</a>
            </div>
        </div>

        <div class="perfundo">
            <a class="perfundo__link" href="#perfundo-img2">
                <img src="http://doodlenerd.com/Uploads/Resources/2018/08/Vo7q29KSJj0/images/img2_s.jpg" alt="Demo image">
            </a>
            <div id="perfundo-img2" class="perfundo__overlay fadeIn">
                <figure class="perfundo__content perfundo__figure">
                    <img src="http://doodlenerd.com/Uploads/Resources/2018/08/Vo7q29KSJj0/images/img2_s.jpg" alt="Demo image">
                    <div class="perfundo__image" style="width: 800px; padding-top: 66.25%; background-image: url(http://doodlenerd.com/Uploads/Resources/2018/08/Vo7q29KSJj0/images/img2.jpg);"></div>
                </figure>
                <a href="#perfundo-untarget" class="perfundo__close perfundo__control">Close</a>
                <a class="perfundo__next perfundo__control" href="#perfundo-img3">Next</a>
                <a class="perfundo__prev perfundo__control" href="#perfundo-img1">Prev</a>
            </div>
        </div>

        <div class="perfundo">
            <a class="perfundo__link" href="#perfundo-img3">
                <img src="http://doodlenerd.com/Uploads/Resources/2018/08/Vo7q29KSJj0/images/img3_s.jpg" alt="Demo image">
            </a>
            <div id="perfundo-img3" class="perfundo__overlay fadeIn">
                <figure class="perfundo__content perfundo__figure">
                    <img src="http://doodlenerd.com/Uploads/Resources/2018/08/Vo7q29KSJj0/images/img3_s.jpg" alt="Demo image">
                    <div class="perfundo__image" style="width: 800px; padding-top: 66.25%; background-image: url(http://doodlenerd.com/Uploads/Resources/2018/08/Vo7q29KSJj0/images/img3.jpg);"></div>
                </figure>
                <a href="#perfundo-untarget" class="perfundo__close perfundo__control">Close</a>
                <a class="perfundo__prev perfundo__control" href="#perfundo-img2">Prev</a>
            </div>
        </div>


        <h2>Content</h2>
        <div class="perfundo">
            <a class="perfundo__link" href="#perfundo-content">Open the lightbox...</a>
            <div id="perfundo-content" class="perfundo__overlay bounceIn">
                <div class="perfundo__content perfundo__html">
                    <h5>Lorem Ipsum</h5>
                    <p>Sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem
                        ipsum dolor sit amet.</p>
                    <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren,
                        no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur.</p>
                </div>
                <a href="#perfundo-untarget" class="perfundo__close perfundo__control">Close</a>
            </div>
        </div>


        <h2>Direct Linking</h2>
        <p><a href="https://perfundo.oberlehner.net/#perfundo-single">perfundo.oberlehner.net/#perfundo-single</a></p>

        <h2>JavaScript enhanced gallery</h2>
        <div class="perfundo js-perfundo">
            <a class="perfundo__link js-perfundo-link" href="#perfundo-img1">
                <img src="http://doodlenerd.com/Uploads/Resources/2018/08/Vo7q29KSJj0/images/img1_s.jpg" alt="Demo image">
            </a>
            <div id="perfundo-img1" class="perfundo__overlay fadeIn js-perfundo-overlay">
                <figure class="perfundo__content perfundo__figure">
                    <img src="http://doodlenerd.com/Uploads/Resources/2018/08/Vo7q29KSJj0/images/img1_s.jpg" alt="Demo image">
                    <div class="perfundo__image" style="width: 800px; padding-top: 66.25%; background-image: url(http://doodlenerd.com/Uploads/Resources/2018/08/Vo7q29KSJj0/images/img1.jpg);"></div>
                </figure>
                <a href="#perfundo-untarget" class="perfundo__close perfundo__control js-perfundo-close">Close</a>
                <a class="perfundo__next perfundo__control js-perfundo-next" href="#perfundo-img2">Next</a>
            </div>
        </div>

        <div class="perfundo js-perfundo">
            <a class="perfundo__link js-perfundo-link" href="#perfundo-img2">
                <img src="http://doodlenerd.com/Uploads/Resources/2018/08/Vo7q29KSJj0/images/img2_s.jpg" alt="Demo image">
            </a>
            <div id="perfundo-img2" class="perfundo__overlay fadeIn js-perfundo-overlay">
                <figure class="perfundo__content perfundo__figure">
                    <img src="http://doodlenerd.com/Uploads/Resources/2018/08/Vo7q29KSJj0/images/img2_s.jpg" alt="Demo image">
                    <div class="perfundo__image" style="width: 800px; padding-top: 66.25%; background-image: url(http://doodlenerd.com/Uploads/Resources/2018/08/Vo7q29KSJj0/images/img2.jpg);"></div>
                </figure>
                <a href="#perfundo-untarget" class="perfundo__close perfundo__control js-perfundo-close">Close</a>
                <a class="perfundo__next perfundo__control js-perfundo-next" href="#perfundo-img3">Next</a>
                <a class="perfundo__prev perfundo__control js-perfundo-prev" href="#perfundo-img1">Prev</a>
            </div>
        </div>

        <div class="perfundo js-perfundo">
            <a class="perfundo__link js-perfundo-link" href="#perfundo-img3">
                <img src="http://doodlenerd.com/Uploads/Resources/2018/08/Vo7q29KSJj0/images/img3_s.jpg" alt="Demo image">
            </a>
            <div id="perfundo-img3" class="perfundo__overlay fadeIn js-perfundo-overlay">
                <figure class="perfundo__content perfundo__figure">
                    <img src="http://doodlenerd.com/Uploads/Resources/2018/08/Vo7q29KSJj0/images/img3_s.jpg" alt="Demo image">
                    <div class="perfundo__image" style="width: 800px; padding-top: 66.25%; background-image: url(http://doodlenerd.com/Uploads/Resources/2018/08/Vo7q29KSJj0/images/img3.jpg);"></div>
                </figure>
                <a href="#perfundo-untarget" class="perfundo__close perfundo__control js-perfundo-close">Close</a>
                <a class="perfundo__prev perfundo__control js-perfundo-prev" href="#perfundo-img2">Prev</a>
            </div>
        </div>
    </div>
</div>
CSS
{ } JS
/* Only required for JavaScript enhanced gallery*/

// Initialize a perfundo Lightbox.
/*perfundo('.perfundo', {
  disableHistory: true,
  swipe: true
});*/
Preview