From 27fc2ef4de781d0db6e722492d30932754b902e9 Mon Sep 17 00:00:00 2001 From: Sergio Pena Date: Thu, 11 Aug 2022 23:56:39 +0200 Subject: [PATCH] feat: add parallax on hero Add boolean to set the hero background image as fixed creating a parallax scroll effect. --- layouts/partials/fragments/hero.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/layouts/partials/fragments/hero.html b/layouts/partials/fragments/hero.html index 3cf2b4a4..1391af85 100644 --- a/layouts/partials/fragments/hero.html +++ b/layouts/partials/fragments/hero.html @@ -12,6 +12,9 @@ {{- with .Params.minHeight -}} {{- (printf "min-height: %s;" .) | safeCSS -}} {{- end -}} + {{- if .Params.parallax -}} + background-attachment: fixed; + {{- end -}} background-image:url({{ partial "helpers/image.html" (dict "root" $self "asset" .Params.header) }})" class="jumbotron text-center header-image mb-0 {{- printf " bg-%s" $bg -}}