<!doctype html>
<html lang="en">
  <head>
    <title>{{ title }}</title>
    
    <style>
        body {
            background-color: #202020;
            color: #0aaaaa;
        }

        .header {
            margin: 0 auto;
            text-align: center;
            width: 90%;
            font: 20px Helvetica, Arial, sans-serif;
        }
        
        .facade {
            margin: 0 auto;
            text-align: left;
            width: 90%;
            font: 14px Helvetica, Arial, sans-serif;
        }
        
        .footnote {
            margin: 0 auto;
            text-align: center;
            width: 90%;
            font: 12px Helvetica, Arial, sans-serif;
        }
               
        .gallery {
            height: 200px;
        }

        a:link, a:visited, a:hover, a:active {
            color: #0aaaaa;
        }
    </style>
    
  </head>
  <body>
    <div class="header"><h1>{{ title }}</h1></div>
    <div class="facade">
    {% for gallery in galleries -%}
    <h1>{{ gallery.title }}</h1><div class="gallery" id="gallery{{ loop.index }}"></div>
    {% endfor -%}
    </div>
    <div class="footnote">Gallery generated by <a href=https://github.com/gergelyk/galgen>galgen</a> and powered by <a href=https://galleriajs.github.io/>galleriajs</a></div>
    </div>
    
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/galleria/1.6.1/galleria.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/galleria/1.6.1/themes/folio/galleria.folio.min.js"></script>
    <script>

    Galleria.configure({
        imageCrop: false,
        transition: "fade",
    });

    {% for gallery in galleries -%}
    var data{{ loop.index }} = [
        {% for image in gallery.images -%}
        {thumb: "{{ image.thumb }}", image: "{{ image.image }}"},
        {% endfor -%}
    ]
    Galleria.run("#gallery{{ loop.index }}", {dataSource: data{{ loop.index }}});
    {% endfor -%}

    </script>
</body>
</html>
