From 3cd2452b68644b22056488fce718ab5dd5832119 Mon Sep 17 00:00:00 2001 From: Anonymous Contributor Date: Fri, 15 Sep 2023 17:11:08 +0200 Subject: [PATCH] Add transition duration setting for SlideshowExt --- blueprints/modular/slideshowext.yaml | 8 ++++++++ css/slideshowext.css | 1 - templates/modular/slideshowext.html.twig | 6 +++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/blueprints/modular/slideshowext.yaml b/blueprints/modular/slideshowext.yaml index 473c726..74cd9f5 100644 --- a/blueprints/modular/slideshowext.yaml +++ b/blueprints/modular/slideshowext.yaml @@ -5,6 +5,14 @@ extends@: form: validation: loose fields: + header.transduration: + type: text + label: Übergangsdauer + help: 'Dauer des Übergangs (Fade-In bzw. -Out) zwischen zwei Slides in Sekunden' + default: 2 + validate: + required: true + type: int header.slides: type: list style: vertical diff --git a/css/slideshowext.css b/css/slideshowext.css index 5a5c517..43b552b 100644 --- a/css/slideshowext.css +++ b/css/slideshowext.css @@ -19,7 +19,6 @@ width: 100%; height: auto; overflow: hidden; - transition: visibility 0s 2s, opacity 2s linear; box-sizing: border-box; white-space: normal; justify-content: center; diff --git a/templates/modular/slideshowext.html.twig b/templates/modular/slideshowext.html.twig index ed384ed..71e6fa5 100644 --- a/templates/modular/slideshowext.html.twig +++ b/templates/modular/slideshowext.html.twig @@ -4,10 +4,14 @@ {% do assets.addCss('theme://css/slideshowext.css', 90) %} {% set slideStyle %} {% for image in slides %} + .slideshow-ext > .slide-content { + transition: visibility 0s {{ page.header.transduration }}s, opacity {{ page.header.transduration }}s linear; + } + #slide{{ loop.index }}:checked ~ #slide-content{{ loop.index }} { opacity: 1; visibility: visible; - transition: visibility 0s 2s, opacity 2s 2s linear; + transition: visibility 0s {{ page.header.transduration }}s, opacity {{ page.header.transduration }}s {{ page.header.transduration }}s linear; } {% endfor %} {% for image in slides %}