diff --git a/assets/scss/mgallery.scss b/assets/scss/mgallery.scss new file mode 100644 index 0000000..5546649 --- /dev/null +++ b/assets/scss/mgallery.scss @@ -0,0 +1,73 @@ +// Gallery CSS + +// Define the masonry container +.masonry-container { + display: flex; + flex-flow: wrap; + flex-direction: row; + width: 100%; + padding-right: 8px; + padding-left: 8px; + margin-right: auto; + margin-left: auto; +} + +// Define the masonry classes for the columns 2..5 +$masonry-columns: ( + "2": 2, + "3": 3, + "4": 4, + "5": 5 +) !default; + +@each $key, $cols in $masonry-columns { + .masonry-#{$key} { + -ms-column-count: #{$cols}; + -webkit-column-count: #{$cols}; /* Chrome, Safari, Opera */ + -moz-column-count: #{$cols}; /* Firefox */ + column-count: #{$cols}; + } +} + +// Define the class for the different gap sizes +$masonry-gaps: ( + "0" : 0, + "xs" : 0.1rem, + "s" : 0.25rem, + "m" : 0.5rem, + "l" : 1rem, + "xl" : 1.5rem, + "xxl": 2rem +) !default; + +// The masonry column gap +@each $key, $gap in $masonry-gaps { + .masonry-gap-#{$key} { + -ms-column-gap: #{$gap}; + -moz-column-gap: #{$gap}; + -webkit-column-gap: #{$gap}; + column-gap: #{$gap}; + } +} + +// Override for grid column gap +@each $key, $gutter in $masonry-gaps { + .grid-gap-#{$key} { + --bs-gutter-x: #{$gutter}; + } +} + +// The row padding for both grid and masonry +@each $key, $gap in $masonry-gaps { + .gallery-pad-#{$key} { + padding-bottom: #{$gap}; + } +} + +// Define the image class in a masonry +.masonry-1 img, .masonry-2 img, .masonry-3 img, .masonry-4 img, .masonry-5 img { + flex-direction: column; + position: relative; + width: 100%; +} + diff --git a/config.toml b/config.toml index 12754cf..2bb51f0 100644 --- a/config.toml +++ b/config.toml @@ -4,22 +4,14 @@ min = "0.110.0" max = "" [[module.mounts]] - source = "dist/js/lightbox-plus-jquery.js" - target = "assets/js/modules/lightbox/lightbox-plus-jquery.js" + source = "dist/js" + target = "assets/js/modules/mgallery" [[module.mounts]] source = "dist/css" - target = "assets/scss" - includeFiles = "lightbox.scss" + target = "assets/scss/modules/mgallery" [[module.mounts]] source = "dist/images" - target = "assets/images" - [[module.mounts]] - source = "dist/css" - target = "assets/scss" - includeFiles = "mgallery.scss" - [[module.mounts]] - source = "dist/shortcodes/mgallery.html" - target = "layouts/shortcodes/mgallery.html" + target = "static/images" [[module.mounts]] source = 'layouts' target = 'layouts' diff --git a/dist/css/mgallery.scss b/dist/css/mgallery.scss deleted file mode 100644 index 4119f03..0000000 --- a/dist/css/mgallery.scss +++ /dev/null @@ -1,156 +0,0 @@ -// Gallery CSS - -// Define the masonry container -.masonry-container { - display: flex; - flex-flow: wrap; - flex-direction: row; - width: 100%; - padding-right: 8px; - padding-left: 8px; - margin-right: auto; - margin-left: auto; -} - -.masonry-2 { - -ms-column-count: 2; - -webkit-column-count: 2; /* Chrome, Safari, Opera */ - -moz-column-count: 2; /* Firefox */ - column-count: 2; -} - -.masonry-3 { - -ms-column-count: 3; - -webkit-column-count: 3; /* Chrome, Safari, Opera */ - -moz-column-count: 3; /* Firefox */ - column-count: 3; -} - -.masonry-4 { - -ms-column-count: 4; - -webkit-column-count: 4; /* Chrome, Safari, Opera */ - -moz-column-count: 4; /* Firefox */ - column-count: 4; -} - -.masonry-5 { - -ms-column-count: 5; - -webkit-column-count: 5; /* Chrome, Safari, Opera */ - -moz-column-count: 5; /* Firefox */ - column-count: 5; -} - -.masonry-gap-0 { - -ms-column-gap: 0; - -moz-column-gap: 0; - -webkit-column-gap: 0; - column-gap: 0; -} - -.masonry-gap-xs { - -ms-column-gap: 0.1rem; - -moz-column-gap: 0.1rem; - -webkit-column-gap: 0.1rem; - column-gap: 0.1rem; -} - -.masonry-gap-s { - -ms-column-gap: 0.25rem; - -moz-column-gap: 0.25rem; - -webkit-column-gap: 0.25rem; - column-gap: 0.25rem; -} - -.masonry-gap-m { - -ms-column-gap: 0.5rem; - -moz-column-gap: 0.5rem; - -webkit-column-gap: 0.5rem; - column-gap: 0.5rem; -} - -.masonry-gap-l { - -ms-column-gap: 1rem; - -moz-column-gap: 1rem; - -webkit-column-gap: 1rem; - column-gap: 1rem; -} - -.masonry-gap-xl { - -ms-column-gap: 1.5rem; - -moz-column-gap: 1.5rem; - -webkit-column-gap: 1.5rem; - column-gap: 1.5rem; -} - -.masonry-gap-xxl { - -ms-column-gap: 2rem; - -moz-column-gap: 2rem; - -webkit-column-gap: 2rem; - column-gap: 2rem; -} - -// Override for grid column gap -.grid-gap-0 { - --bs-gutter-x: 0; -} - -.grid-gap-xs { - --bs-gutter-x: 0.1rem; -} - -.grid-gap-s { - --bs-gutter-x: 0.25rem; -} - -.grid-gap-m { - --bs-gutter-x: 0.5rem; -} - -.grid-gap-l { - --bs-gutter-x: 1rem; -} - -.grid-gap-xl { - --bs-gutter-x: 1.5rem; -} - -.grid-gap-xxl { - --bs-gutter-x: 2rem; -} - -// The row padding for both grid and masonry -.gallery-pad-0 { - padding-bottom: 0; -} - -.gallery-pad-xs { - padding-bottom: 0.1rem; -} - -.gallery-pad-s { - padding-bottom: 0.25rem; -} - -.gallery-pad-m { - padding-bottom: 0.5rem; -} - -.gallery-pad-l { - padding-bottom: 1rem; -} - -.gallery-pad-xl { - padding-bottom: 1.5rem; -} - -.gallery-pad-xxl { - padding-bottom: 2rem; -} - -// Define the image class in a masonry -.masonry-1 img, .masonry-2 img, .masonry-3 img, .masonry-4 img, .masonry-5 img { - flex-direction: column; - position: relative; - width: 100%; -} - diff --git a/exampleSite/content/_index.md b/exampleSite/content/_index.md index a5a6711..5860b94 100644 --- a/exampleSite/content/_index.md +++ b/exampleSite/content/_index.md @@ -4,4 +4,6 @@ description: Site to test module shortcode(s). date: 2023-07-10 --- -TODO: placeholder \ No newline at end of file +Gallery test + +{{< mgallery cols=3 type="masonry" gap="m" radius="true" zoom="false" list="img/*" unique="false" >}} \ No newline at end of file diff --git a/exampleSite/content/gallery/img/JM_LSP_01b.jpg b/exampleSite/content/gallery/img/JM_LSP_01b.jpg new file mode 100755 index 0000000..3c131ef Binary files /dev/null and b/exampleSite/content/gallery/img/JM_LSP_01b.jpg differ diff --git a/exampleSite/content/gallery/img/JM_LSP_02.jpg b/exampleSite/content/gallery/img/JM_LSP_02.jpg new file mode 100755 index 0000000..644b581 Binary files /dev/null and b/exampleSite/content/gallery/img/JM_LSP_02.jpg differ diff --git a/exampleSite/content/gallery/img/JM_LSP_03.jpg b/exampleSite/content/gallery/img/JM_LSP_03.jpg new file mode 100755 index 0000000..f5356e5 Binary files /dev/null and b/exampleSite/content/gallery/img/JM_LSP_03.jpg differ diff --git a/exampleSite/content/gallery/img/JM_LSP_10.jpg b/exampleSite/content/gallery/img/JM_LSP_10.jpg new file mode 100755 index 0000000..f0b6d1c Binary files /dev/null and b/exampleSite/content/gallery/img/JM_LSP_10.jpg differ diff --git a/exampleSite/content/gallery/img/JM_LSP_11.jpg b/exampleSite/content/gallery/img/JM_LSP_11.jpg new file mode 100755 index 0000000..cfab5b3 Binary files /dev/null and b/exampleSite/content/gallery/img/JM_LSP_11.jpg differ diff --git a/exampleSite/content/gallery/img/JM_LSP_12.jpg b/exampleSite/content/gallery/img/JM_LSP_12.jpg new file mode 100755 index 0000000..d6a810e Binary files /dev/null and b/exampleSite/content/gallery/img/JM_LSP_12.jpg differ diff --git a/exampleSite/content/gallery/img/JM_LSP_13.jpg b/exampleSite/content/gallery/img/JM_LSP_13.jpg new file mode 100755 index 0000000..0861569 Binary files /dev/null and b/exampleSite/content/gallery/img/JM_LSP_13.jpg differ diff --git a/exampleSite/content/gallery/index.md b/exampleSite/content/gallery/index.md new file mode 100644 index 0000000..76b86de --- /dev/null +++ b/exampleSite/content/gallery/index.md @@ -0,0 +1,29 @@ + + +--- +title: Gallery +description: Example for gallery +date: 2023-05-20 +--- + + +To show this gallery properly in this example site, additional bootstrap classes are needed to wrap the gallery in. +It is still not exactly the same as when using Hinode, but close enough. + +