updating background and logic for new background setting.
This commit is contained in:
@@ -9,8 +9,52 @@
|
||||
{{- partialCached "init.html" . -}}
|
||||
|
||||
{{ $bodyLayout := "flex flex-col h-screen m-auto leading-7 max-w-7xl px-6 sm:px-14 md:px-24 lg:px-32" }}
|
||||
|
||||
{{/* Global Background Logic */}}
|
||||
{{ $useGlobalBg := false }}
|
||||
{{ $bgImage := "" }}
|
||||
{{ if site.Params.defaultBackgroundImage }}
|
||||
{{ $useGlobalBg = true }}
|
||||
{{ $bgImage = site.Params.defaultBackgroundImage }}
|
||||
{{ if .IsHome }}
|
||||
{{ if or (eq .Site.Params.homepage.layout "background") (eq .Site.Params.homepage.layout "hero") }}
|
||||
{{ if .Site.Params.homepage.homepageImage }}{{ $useGlobalBg = false }}{{ end }}
|
||||
{{ end }}
|
||||
{{ else if .IsPage }}
|
||||
{{ $heroStyle := .Params.heroStyle | default (.Site.Params.article.heroStyle | default "basic") }}
|
||||
{{ if or (eq $heroStyle "background") (eq $heroStyle "hero") }}
|
||||
{{ if .Params.featureimage }}{{ $useGlobalBg = false }}{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ $bodyColor := "text-lg bg-neutral text-neutral-900 dark:bg-neutral-800 dark:text-neutral" }}
|
||||
<body class="{{ $bodyLayout }} {{ $bodyColor }} {{ with .Params.bodyClass }}{{ . }}{{ end }} {{ if site.Params.enableStyledScrollbar | default true }}bf-scrollbar{{ end }}">
|
||||
{{ if $useGlobalBg }}
|
||||
{{ $bodyColor = "text-lg text-neutral-900 dark:text-neutral" }}
|
||||
{{ end }}
|
||||
|
||||
{{ $globalBgClass := cond $useGlobalBg "has-global-bg" "" }}
|
||||
|
||||
<body class="{{ $bodyLayout }} {{ $bodyColor }} {{ with .Params.bodyClass }}{{ . }}{{ end }} {{ $globalBgClass }} {{ if site.Params.enableStyledScrollbar | default true }}bf-scrollbar{{ end }}">
|
||||
|
||||
{{ if $useGlobalBg }}
|
||||
{{ $bgURL := "" }}
|
||||
{{ if or (strings.HasPrefix $bgImage "http:") (strings.HasPrefix $bgImage "https:") }}
|
||||
{{ $bgURL = $bgImage }}
|
||||
{{ else }}
|
||||
{{ $bgURL = $bgImage | absURL }}
|
||||
{{ end }}
|
||||
<div id="global-background" class="fixed inset-0 overflow-hidden pointer-events-none single_hero_background nozoom" style="z-index: -1;">
|
||||
{{ $style := "" }}
|
||||
{{ $defaultPosition := site.Params.imagePosition | default false }}
|
||||
{{ if $defaultPosition }}
|
||||
{{ $style = printf "object-position: %s;" $defaultPosition }}
|
||||
{{ end }}
|
||||
<img src="{{ $bgURL }}" class="absolute inset-0 w-full h-[1000px] md:h-[1200px] object-cover" role="presentation" {{ if $style }}style="{{ $style | safeCSS }}"{{ end }}>
|
||||
<div class="absolute inset-0 h-[1000px] md:h-[1200px] bg-neutral/60 dark:bg-neutral-800/60 mix-blend-normal"></div>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
<div id="the-top" class="absolute flex self-center">
|
||||
<a
|
||||
class="px-3 py-1 text-sm -translate-y-8 rounded-b-lg bg-primary-200 focus:translate-y-0 dark:bg-neutral-600"
|
||||
|
||||
Reference in New Issue
Block a user