From fc530bc4839c26624758620d28ba716344af52d0 Mon Sep 17 00:00:00 2001 From: Gabriele Musco Date: Mon, 5 Jul 2021 14:00:51 +0200 Subject: [PATCH] added new features to the jumbotron --- README.md | 7 ++- assets/scss/style.scss | 84 ++++++++++++++++++++++++++++++++- layouts/partials/jumbotron.html | 43 +++++++++++++---- 3 files changed, 123 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 81c2c90..77dcf32 100644 --- a/README.md +++ b/README.md @@ -199,8 +199,13 @@ Following is an example configuration: ```yaml title: My awesome website -subtitle: Some fancy subtitle +hugeTitle: false +subtitle: Some fancy subtitle +image: /jumbotron_image.svg +imagePosition: left # values: left, right, top, bottom background: /img/jumbotron_bg.png +fullscreen: false +downArrow: false links: - title: About me link: /pages/about diff --git a/assets/scss/style.scss b/assets/scss/style.scss index eb38cc9..d32e0ac 100644 --- a/assets/scss/style.scss +++ b/assets/scss/style.scss @@ -647,16 +647,91 @@ header.jumbotronContainer { {{ else }} background-color: rgba(0, 0, 0, .3); {{ end }} + {{ if (.Site.Data.jumbotron.fullscreen | default false) }} + height: 100vh; + {{ if (.Site.Data.jumbotron.downArrow | default false) }} + .arrow { + cursor: pointer; + &, svg { + height: 64px; + width: 64px; + } + opacity: .7; + border-radius: 100%; + border: 2px solid $fg_color; + padding: 3px; + // display: flex; flex-direction: row; justify-content: center; + background-color: transparent; + transition: background-color .15s ease-in-out; + svg { + margin-top: 5px; + &, * { + fill: $fg_color; + transition: fill .15s ease-in-out; + } + @keyframes bounce { + 0% { + transform: translateY(3px); + } + 100% { + transform: translateY(-3px); + } + } + animation: bounce 2s infinite ease-in-out alternate both; + + } + &:hover, &:focus, &:active { + background-color: $fg_color; + svg, svg * { + fill: $bg_color; + } + } + } + {{ end }} + {{ end }} } .jumbotron { width: 100%; - min-height: 40vh; - flex-direction: column; + {{ if (.Site.Data.jumbotron.fullscreen | default false) }} + height: 80vh; + {{ else }} + min-height: 40vh; + {{ end }} + flex-wrap: no-wrap; text-align: center; justify-content: center; align-items: center; + {{ $jumbotronImagePosition := (.Site.Data.jumbotron.imagePosition | default "left") }} + {{ if (eq $jumbotronImagePosition "left") }} + flex-direction: row; + {{ else if (eq $jumbotronImagePosition "right") }} + flex-direction: row-reverse; + {{ else if (eq $jumbotronImagePosition "top") }} + flex-direction: column; + {{ else if (eq $jumbotronImagePosition "bottom") }} + flex-direction: column-reverse; + {{ end }} + .main_box { + display: flex; + flex-direction: column; + text-align: center; + justify-content: center; + align-items: center; + flex-basis: 55%; + flex-grow: 1; + } + img { + flex-basis: 45%; + flex-grow: 1; + max-width: 100%; + min-width: 300px; + } h1 { font-weight: 300; + &.huge { + font-size: 4em; + margin: 24px; + } } ul { list-style: none; @@ -676,4 +751,9 @@ header.jumbotronContainer { } } } +@media only screen and (max-width: 520px) { + .jumbotron { + flex-wrap: wrap; + } +} {{ end }} diff --git a/layouts/partials/jumbotron.html b/layouts/partials/jumbotron.html index e9820da..90ec21f 100644 --- a/layouts/partials/jumbotron.html +++ b/layouts/partials/jumbotron.html @@ -1,13 +1,40 @@ {{ if (and (.Site.Params.enableJumbotron | default false) .Site.Data.jumbotron) }}
-

{{ .Site.Data.jumbotron.title }}

-

{{ .Site.Data.jumbotron.subtitle }}

- {{ if .Site.Data.jumbotron.links }} - - {{ end }} +
+ {{ if ( + and + (.Site.Data.jumbotron.fullscreen | default false) + (.Site.Data.jumbotron.downArrow | default false) + ) }} +
+ + + +
+ + {{ end }} {{ end }}