diff --git a/layouts/shortcodes/carousel.html b/layouts/shortcodes/carousel.html index c6b844a9..e719a8d3 100644 --- a/layouts/shortcodes/carousel.html +++ b/layouts/shortcodes/carousel.html @@ -1,4 +1,4 @@ -{{ $id := delimit (slice "carousel" (partial "functions/uid.html" .)) "-" }} +{{ $id := delimit (slice "carousel" (partial "functions/uid.html" .) (now.UnixNano)) "-" }} {{ $aspect := default "16-9" (.Get "aspectRatio") }} {{ $interval := default "2000" (.Get "interval") }} @@ -17,7 +17,12 @@ {{ end }} -
+
@@ -30,32 +35,27 @@ {{ if eq $num 0 }}data-twe-carousel-active aria-current="true"{{ end }} class="mx-[3px] box-content h-[3px] w-[30px] flex-initial cursor-pointer border-0 border-y-[10px] border-solid border-transparent bg-neutral bg-clip-padding p-0 -indent-[999px] opacity-50 transition-opacity duration-[600ms] ease-[cubic-bezier(0.25,0.1,0.25,1.0)] motion-reduce:transition-none" aria-label="Slide {{ $num }}"> - {{ $num = add $num 1 }} {{ end }} -
+
- {{ $num := 0 }} - {{ range $images }} + {{ range $index, $image := $images }} + {{ $hiddenClass := cond (eq $index 0) "" "hidden" }} - - {{ $num = add $num 1 }} {{ end }} -
+ +