From aed0b6bc61d8f78faafbe61d1eb3530f4878a690 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Thu, 19 Feb 2026 17:30:14 +0100 Subject: [PATCH] feat: sync track cover hover effect with playing state --- layouts/partials/track-card.html | 28 +++++++++++----- layouts/tracks/single.html | 57 +++++++++++++++++++++----------- 2 files changed, 56 insertions(+), 29 deletions(-) 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 @@