enh: add video to homepage

This commit is contained in:
Edoardo Rosa 2023-11-26 19:12:32 +01:00
parent c8e2b17d02
commit 30133f50cd
No known key found for this signature in database
GPG key ID: 2AF1937D15CB28F6
3 changed files with 29 additions and 13 deletions

View file

@ -9,20 +9,34 @@
<body
class="flex flex-col h-screen px-6 m-auto text-lg leading-7 max-w-7xl bg-neutral text-neutral-900 dark:bg-neutral-800 dark:text-neutral sm:px-14 md:px-24 lg:px-32">
<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"
href="#main-content"><span
class="font-bold text-primary-600 ltr:pr-2 rtl:pl-2 dark:text-primary-400">&darr;</span>{{ i18n
"nav.skip_to_main" }}</a>
</div>
{{ $header := print "partials/header/" .Site.Params.header.layout ".html" }}
{{ if templates.Exists $header }}
{{ partial $header . }}
{{ else }}
{{ partial "partials/header/basic.html" . }}
{{ end }}
{{ if .IsHome }}
{{ if .Site.Params.homePageVideo }}
<style>
.video-margin {
margin-top: 97vh;
}
</style>
<div class="absolute top-0 left-0 h-screen w-full">
<video class="h-screen w-full object-cover" autoplay loop muted>
<source src="{{ .Site.Params.homePageVideo }}" data-src="{{ .Site.Params.homePageVideo }}" type="video/mp4">
</video>
</div>
{{ end }}
{{ 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"
href="#main-content"><span
class="font-bold text-primary-600 ltr:pr-2 rtl:pl-2 dark:text-primary-400">&darr;</span>{{ i18n
"nav.skip_to_main" }}</a>
</div>
<div class="relative flex flex-col grow">
<main id="main-content" class="grow">
<main id="main-content" class="grow video-margin">
{{ block "main" . }}{{ end }}
{{ if and (.Site.Params.footer.showScrollToTop | default true) (gt .WordCount 1) }}
{{- partial "scroll-to-top.html" . -}}

View file

@ -1,6 +1,6 @@
<div class="min-h-[148px]"></div>
<div class="mt-10"></div>
<div class="fixed inset-x-0 pl-[24px] pr-[24px] bg-neutral dark:bg-neutral-800" style="z-index:100">
<div class="relative max-w-[64rem] ml-auto mr-auto">
<div class="relative ml-auto mr-auto">
{{ partial "partials/header/basic.html" . }}
</div>
</div>

View file

@ -1,8 +1,10 @@
<article class="max-w-full prose dark:prose-invert">
{{ with .Title }}
<header>
<h1>{{ . | emojify }}</h1>
</header>
{{ if .Site.Params.homepage.showTitle | default true }}
{{ with .Title }}
<header>
<h1>{{ . | emojify }}</h1>
</header>
{{ end }}
{{ end }}
<section>{{ .Content | emojify }}</section>
</article>