From e3224082023cb1d7ae3429c0b6ae5f243afbb458 Mon Sep 17 00:00:00 2001 From: Max Mehl Date: Mon, 5 Feb 2024 15:33:43 +0100 Subject: [PATCH] allow to define aspect ratio --- README.md | 1 + assets/scss/snap-gallery.scss | 2 +- layouts/partials/gallery.html | 2 +- layouts/partials/slideshow.html | 2 +- layouts/shortcodes/snap-gallery.html | 6 +++--- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 21538e5..9d347d3 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,7 @@ All parameters: - `src`: Must contain either a comma-separated list of paths to images, or a directory path containing images. - `lightbox`: Whether a click on an image shall open a lightbox modal. Default: `true`. +- `aspectratio`: Define the aspect ratio of the images in the slideshow/gallery. Default: `16/10`. - `mode`: Can be either `gallery` or `slideshow`. Default: `gallery`. - For gallery mode: - `columns`: Amount of columns the images are displayed in. Default: `4`. diff --git a/assets/scss/snap-gallery.scss b/assets/scss/snap-gallery.scss index 53e0d39..da5a148 100644 --- a/assets/scss/snap-gallery.scss +++ b/assets/scss/snap-gallery.scss @@ -17,7 +17,7 @@ $gap: var(--gap); min-width: var(--min-width); img { - aspect-ratio: 16/10; + aspect-ratio: var(--aspectratio); width: 100%; object-fit: cover; } diff --git a/layouts/partials/gallery.html b/layouts/partials/gallery.html index 1ea1e76..85b03c9 100644 --- a/layouts/partials/gallery.html +++ b/layouts/partials/gallery.html @@ -1,6 +1,6 @@ {{- $imgs := .imgs -}} {{- $galno := .galno -}} -