-
Notifications
You must be signed in to change notification settings - Fork 1
/
pattern-modal.html
72 lines (72 loc) · 4.28 KB
/
pattern-modal.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<div class="m2m-modal-container d-flex flex-wrap justify-content-center mt-4">
{% comment %}
*-------------------------
Button to open the gallery
-------------------------*
{% endcomment %}
<input class="m2m-modal-btn" type="checkbox" id="m2m-modal-{{ include.id }}" name="m2m-modal-{{ include.id }}">
<label class="btn btn-lg btn-m2m btn-m2m-cta py-3 px-4 fw-bold" for="m2m-modal-{{ include.id }}">📷 <span class="initialism fs-5 ps-1"><strong>Open the gallery</strong></span></label>
{% comment %}
*-------------------------
Modal content
-------------------------*
{% endcomment %}
<div class="m2m-modal position-fixed d-flex flex-wrap justify-content-center">
<div class="m2m-modal-wrap d-block position-relative">
{% comment %}
*-------------------------
Carousel
-------------------------*
{% endcomment %}
<div class="m2m-carousel-container d-flex justify-content-center">
<div class="m2m-carousel">
<ul class="m2m-carousel-scroll list-unstyled mx-0 my-0" scroll-behavior="smooth">
{%- for image in site.static_files | where: "image", true -%}
{%- capture galleryPath -%}{{ include.folder }}{%- endcapture -%}
{%- if image.path contains galleryPath -%}
{%- assign filenameparts = image.path | split: "/" -%}
{%- assign imgCaption = filenameparts | last | replace: image.extname,'' | replace: 'thumb-', '' | replace: 'a_','' | replace: 'b_','' | replace: 'c_','' | replace: 'd_','' | replace: 'e_','' | replace: 'f_','' | replace: 'g_','' | replace: 'h_','' | replace: 'i_','' | replace: 'l_','' | replace: 'm_','' | replace: 'n_','' | replace: 'o_','' | replace: 'p_','' | replace: 'q_','' | replace: 'r_','' | replace: 's_','' | replace: 't_','' | replace: 'u_','' | replace: 'v_','' | replace: 'z_','' | replace: '-',' ' | replace: '_',' ' -%}
{%- unless image.path contains 'thumb-' -%}
<li class="m2m-carousel-scroll-item-outer">
<div id="{{ imgCaption | slugify }}-{%- increment slideId -%}" class="m2m-carousel-scroll-item">
{%- assign respFileNamePart = filenameparts | last -%}
{%- assign respImgPath = respFileNamePart | prepend: galleryPath | remove_first: "/" -%}
{% responsive_image_block %}
path: {{ respImgPath }}
alt: {{ imgCaption | capitalize }}
margin-nil: 0
{% endresponsive_image_block %}
</div>
</li>
{%- endunless -%}
{%- endif -%}
{%- endfor -%}
</ul>
{% comment %}
*-------------------------
Carousel navigation
-------------------------*
{% endcomment %}
<nav id="m2m-slider-nav">
{%- for image in site.static_files -%}
{%- capture galleryPath -%}{{ include.folder }}{%- endcapture -%}
{%- if image.path contains galleryPath -%}
{%- assign filenameparts = image.path | split: "/" -%}
{%- assign imgCaption = filenameparts | last | replace: image.extname,'' | replace: 'thumb-', '' | replace: 'a_','' | replace: 'b_','' | replace: 'c_','' | replace: 'd_','' | replace: 'e_','' | replace: 'f_','' | replace: 'g_','' | replace: 'h_','' | replace: 'i_','' | replace: 'l_','' | replace: 'm_','' | replace: 'n_','' | replace: 'o_','' | replace: 'p_','' | replace: 'q_','' | replace: 'r_','' | replace: 's_','' | replace: 't_','' | replace: 'u_','' | replace: 'v_','' | replace: 'z_','' | replace: '-',' ' | replace: '_',' ' -%}
{%- unless image.path contains 'thumb-' -%}
{%- assign imageNavPath = image.path | split: "/" | last | prepend: 'thumb-' -%}
{%- assign slideId = 0 -%}
{%- assign slideNavId = 0 -%}
{%- assign slideNav = 0 -%}
<a href="#{{ imgCaption | slugify }}-{%- increment slideNavId -%}">
<img class="mx-auto d-block" src="{{ galleryPath }}{{ imageNavPath }}" alt="{{ imgCaption | capitalize }}" title="Click to view {{ imgCaption | capitalize }}" width="120" height="120">
</a>
{%- endunless -%}
{%- endif -%}
{% endfor %}
</nav>
</div>
</div>
</div>
</div>
</div>