diff --git a/README.md b/README.md index 32f6847..da55e82 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ Promo image which may be a bit outdated:
- Responseive to screen size/shape - SEO friendly - Customizable +- Video cover - [Fork Awesome Icons][fork-awesome-icons] out of the box - Header logo - Visual guards to guarantee readability @@ -69,6 +70,9 @@ Look at this nice »envelope«-icon: `{{}}`. I took ### Header logo Configured in `_index.md`, see `exampleSite`: `header_logo: "images/chef-hat.png"` +### Video cover +Set `header_use_video: true` in `/exampleSite/content/_index.md` and define video source via custom partial, such as `exampleSite/layouts/partials/custom_header_video.html`. + ### Footer version information In order to see technical version information (extracted from Hugo's [GitInfo](https://gohugo.io/variables/git/))) set the following general option in your config.toml: `enableGitInfo = true` @@ -84,8 +88,6 @@ Referencing and showing icons in front of the link text is possible with a new p Visit as at {{}} ``` - - ## 🐛 Issues / 💡 Feedback / 👑 Contributing [Discussion](https://github.com/zjedi/hugo-scroll/discussions) for Q&A (when unsure), [Issues](https://github.com/zjedi/hugo-scroll/issues) for tracking, diff --git a/assets/css/theme.scss b/assets/css/theme.scss index a67c3bb..614aacf 100644 --- a/assets/css/theme.scss +++ b/assets/css/theme.scss @@ -12,7 +12,12 @@ body { line-height: 0; } -#site-head { +#site-head.withCenteredImage{ + /* can't be used together with video */ + background: var(--section-light-bg-color) no-repeat center center; +} + +#site-head, #site-head.withCenteredImage { position: relative; display: table; width: 100%; @@ -20,9 +25,22 @@ body { margin-bottom: 0rem; text-align: center; color: var(--cover-text-color); - background: var(--section-light-bg-color) no-repeat center center; background-size: cover; + /* Big cover video at the landing area */ + video { + bottom: 0; + height: 100%; + min-width: 100%; + -o-object-fit: cover; + object-fit: cover; + position: absolute; + right: 0; + top: 0; + width: auto; + z-index: -100; + } + .title-and-description-guard { margin: auto; padding: 0.6em; diff --git a/exampleSite/assets/cover/pexels-pressmaster-3209239-960x540-25fps.mp4 b/exampleSite/assets/cover/pexels-pressmaster-3209239-960x540-25fps.mp4 new file mode 100644 index 0000000..be1a086 Binary files /dev/null and b/exampleSite/assets/cover/pexels-pressmaster-3209239-960x540-25fps.mp4 differ diff --git a/exampleSite/content/_index.md b/exampleSite/content/_index.md index eda3c35..9645395 100644 --- a/exampleSite/content/_index.md +++ b/exampleSite/content/_index.md @@ -1,8 +1,13 @@ --- # Striking header background image, Ideal images are homogenous around the centre and contrasting to the text. Non-ideal images can use `title_guard` header_image: "images/cover-image.jpg" +# +# When set true, uses video from custom_header_video.html partial, instead of header_image +header_use_video: false +# # Optional header logo. CSS: `#blog-logo`, with max-height defined, optimize to prevent scaling header_logo: "images/chef-hat.png" +# # Headers are safeHTML, you can use HTML tags such as b,i,u,br header_headline: "Jane Doe" header_subheadline: "Nutrition Coach & Chef Consultant" diff --git a/exampleSite/content/homepage/credits.md b/exampleSite/content/homepage/credits.md index 7268ce0..bec53f8 100644 --- a/exampleSite/content/homepage/credits.md +++ b/exampleSite/content/homepage/credits.md @@ -3,6 +3,9 @@ title: "Credits" weight: 99 header_menu: true --- -In this section we give thanks to authors of resources used on this demo page. -![Nice picture to make you pay me ;-)](images/chef-hat.png) -{{}} +In this section we give credit to authors of resources used on this demo page. + +- {{}} +- {{}} + + diff --git a/exampleSite/layouts/partials/custom_header_video.html b/exampleSite/layouts/partials/custom_header_video.html new file mode 100644 index 0000000..33366d4 --- /dev/null +++ b/exampleSite/layouts/partials/custom_header_video.html @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/exampleSite/static/images/photography-of-tomatoes-near-basil-leaves-1391487.jpg b/exampleSite/static/images/photography-of-tomatoes-near-basil-leaves-1391487.jpg deleted file mode 100644 index 271a8a5..0000000 Binary files a/exampleSite/static/images/photography-of-tomatoes-near-basil-leaves-1391487.jpg and /dev/null differ diff --git a/layouts/index.html b/layouts/index.html index 38ba28c..b9e978f 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -4,8 +4,21 @@ {{ $sections := cond .Site.BuildDrafts $sections (where $sections "Draft" "==" false) }} -