diff --git a/layouts/partials/track-card.html b/layouts/partials/track-card.html index ef4a9fd..cce596f 100755 --- a/layouts/partials/track-card.html +++ b/layouts/partials/track-card.html @@ -1,11 +1,20 @@ {{/* Track Card Component */}} {{- $hasVideo := .Resources.GetMatch "preview.*" -}} +{{- $audio := "" -}} +{{- with .Resources.GetMatch "track.*" -}} + {{- $audio = .RelPermalink -}} +{{- end -}}
{{/* Cover Image/Video */}} @@ -15,7 +24,7 @@ src="{{ $img.RelPermalink }}" alt="{{ $.Title }}" class="track-card__cover w-full h-full object-cover" - :class="{ 'opacity-0': hovering && $refs.video }" + :class="{ 'opacity-0': isActive && $refs.video }" loading="lazy" decoding="async" > @@ -27,24 +36,25 @@ {{- end }} - {{/* Video preview on hover */}} + {{/* Video preview on hover or playing */}} {{- with .Resources.GetMatch "preview.*" }} {{- end }} {{/* Play overlay - only show if NO video exists */}} {{- if not $hasVideo }} -
-
+
+
diff --git a/layouts/tracks/single.html b/layouts/tracks/single.html index 950fd72..4f93b88 100755 --- a/layouts/tracks/single.html +++ b/layouts/tracks/single.html @@ -35,35 +35,48 @@ {{- $img := .Resize "400x webp q90" }}
{{ $.Title }} - {{/* Video preview on hover */}} + {{/* Video preview on hover or playing */}} {{- with $.Resources.GetMatch "preview.*" }} {{- end }}
@@ -74,13 +87,17 @@