REWORK button: add option for multiple button, CHANGE font

This commit is contained in:
Hoernschen 2023-11-21 17:33:04 +01:00
parent db7ec5795f
commit f696b07527
Signed by: hoernschen
GPG key ID: 37591FAF4E6D3462
9 changed files with 81 additions and 63 deletions

View file

@ -94,18 +94,6 @@
display: block; display: block;
} }
.header-contact-button {
background-color: {{ .Site.Params.color.primary }};
color: white;
border-radius: 4px;
padding: 0.5rem 1.5rem;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 1rem;
margin-left: 2.5rem
}
@media screen and (max-width: 600px) { @media screen and (max-width: 600px) {
.header { .header {
padding: 0.5rem; padding: 0.5rem;

View file

@ -1,25 +1,14 @@
.hero { .hero {
height: 700px; height: 700px;
background-image: url({{ .hero.background }}) !important; {{ with .hero.background }}
background-image: url({{ . }}) !important;
background-size: cover; background-size: cover;
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center center; background-position: center center;
{{ end }}
} }
.hero-icon-container { .hero-icon-container {
padding: 1rem; padding: 1rem;
margin: auto; margin: auto;
} }
.hero-button {
background-color: {{ .color.primary }};
color: white;
border: 2px solid {{ .color.primary }};
border-radius: 4px;
padding: 0.5rem 1.5rem;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 1rem;
margin-top: 1rem;
}

View file

@ -1,12 +1,26 @@
$font: {{ .Param "font" }}; $font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
{{ with .Site.Params.font }}
{{ if .name }}
$font: {{ .name }} !important;
{{ end }}
{{ if .url }}
@font-face { @font-face {
font-family: $font; font-family: $font;
src: url("/fonts/#{$font}/#{$font}-Regular.woff2") format('woff2'); src: url({{ .url }}) format( {{ .format | default "ttf" }} );
font-weight: 400; font-weight: 400;
font-style: normal; font-style: normal;
} }
{{ end }}
{{ end }}
* { * {
box-sizing: border-box; box-sizing: border-box;
word-break: break-word; word-break: break-word;
@ -25,7 +39,7 @@ body {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
color: #333; color: #333;
font-family: $font !important; font-family: $font;
font-weight: 400; font-weight: 400;
font-style: normal; font-style: normal;
} }
@ -332,7 +346,19 @@ button {
object-fit: contain; object-fit: contain;
} }
.service-button { .button-filled {
background-color: {{ .Site.Params.color.primary }};
color: white;
border: 2px solid {{ .Site.Params.color.primary }};
border-radius: 4px;
padding: 0.5rem 1.5rem;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 1rem;
}
.button-outlined {
background-color: transparent; background-color: transparent;
color: {{ .Site.Params.color.primary }}; color: {{ .Site.Params.color.primary }};
border: 2px solid {{ .Site.Params.color.primary }}; border: 2px solid {{ .Site.Params.color.primary }};
@ -342,10 +368,9 @@ button {
text-decoration: none; text-decoration: none;
display: inline-block; display: inline-block;
font-size: 1rem; font-size: 1rem;
margin-top: 2rem;
} }
.service-button:hover { .button-outlined:hover {
background-color: {{ .Site.Params.color.primary }}; background-color: {{ .Site.Params.color.primary }};
color: white; color: white;
} }

View file

@ -27,7 +27,7 @@
{{ $pages := where $.Site.RegularPages "Section" $id }} {{ $pages := where $.Site.RegularPages "Section" $id }}
{{- partial "team.html" (dict "id" $id "team" .Params "pages" $pages "defaultimage" $.Site.Params.defaultimage "odd" $odd) -}} {{- partial "team.html" (dict "id" $id "team" .Params "pages" $pages "defaultimage" $.Site.Params.defaultimage "odd" $odd) -}}
{{ else if eq .Params.type "contact" }} {{ else if eq .Params.type "contact" }}
{{- partial "contact.html" (dict "id" $id "contact" .Params "odd" $odd) -}} {{- partial "contact.html" (dict "id" $id "contact" .Params "content" .Content "odd" $odd) -}}
{{ else if eq .Params.type "logos" }} {{ else if eq .Params.type "logos" }}
{{- partial "logos.html" (dict "id" $id "logos" .Params "odd" $odd) -}} {{- partial "logos.html" (dict "id" $id "logos" .Params "odd" $odd) -}}
{{ else if eq .Params.type "links" }} {{ else if eq .Params.type "links" }}

View file

@ -0,0 +1,7 @@
{{ $outlined := "outlined"}}
<a class="{{if eq .type $outlined}} button-outlined {{else}} button-filled {{end}}" href="{{ .url }}">
{{ with .icon }}
<i class="icon-{{ . }}"></i>
{{ end }}
{{ .text }}
</a>

View file

@ -1,4 +1,5 @@
{{- $contact := .contact }} {{- $contact := .contact }}
{{- $content := .content }}
{{- $id := "contact"}} {{- $id := "contact"}}
{{if $contact.id}} {{if $contact.id}}
{{- $id = $contact.id}} {{- $id = $contact.id}}
@ -9,7 +10,7 @@
<div class="section-content contact"> <div class="section-content contact">
<div class="contact-text"> <div class="contact-text">
<h1>{{ $contact.title }}</h1> <h1>{{ $contact.title }}</h1>
<p>{{ $contact.subtitle }}</p> <p>{{ $content }}</p>
</div> </div>
<div class="contact-button-container"> <div class="contact-button-container">
<a class="contact-button" href="{{ $contact.button.url }}">{{ $contact.button.text }}</a> <a class="contact-button" href="{{ $contact.button.url }}">{{ $contact.button.text }}</a>

View file

@ -32,7 +32,9 @@
{{ end }} {{ end }}
{{- end }} {{- end }}
{{ if $header.button }} {{ if $header.button }}
<a class="header-contact-button" href="{{ $header.button.url }}">{{ $header.button.text }}</a> {{- range $header.button }}
{{ partial "components/button.html" . }}
{{- end }}
{{ end }} {{ end }}
</div> </div>
</div> </div>

View file

@ -21,8 +21,11 @@
<div class="divider"></div> <div class="divider"></div>
</div> </div>
<p>{{ $content }}</p> <p>{{ $content }}</p>
{{if $hero.button.visible}} <br />
<a class="hero-button" href="{{ $hero.button.url }}">{{ $hero.button.text }}</a> {{ with $hero.button }}
{{- range .}}
{{ partial "components/button.html" . }}
{{- end }}
{{ end }} {{ end }}
</div> </div>
<div class="hero-icon-container col-7"> <div class="hero-icon-container col-7">

View file

@ -20,8 +20,11 @@
<div class="divider"></div> <div class="divider"></div>
</div> </div>
<p>{{ $content }}</p> <p>{{ $content }}</p>
{{if and ($service.button) ($service.button.visible)}} <br />
<a class="service-button" href="{{ $service.button.url }}">{{ $service.button.text }}</a> {{ if $service.button }}
{{- range $service.button }}
{{ partial "components/button.html" . }}
{{- end }}
{{ end }} {{ end }}
</div> </div>
{{if and ($service.image) (eq $service.image.direction "right")}} {{if and ($service.image) (eq $service.image.direction "right")}}