small fixes

This commit is contained in:
teldra 2022-06-12 17:50:30 +02:00
parent d85001555c
commit 6ae758daf8
4 changed files with 15 additions and 18 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 558 KiB

After

Width:  |  Height:  |  Size: 268 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

After

Width:  |  Height:  |  Size: 84 KiB

View File

@ -1,11 +1,11 @@
.banner {
height: calc(1em * 33vh);
min-height: calc(100vw / 3.5);
display: flex;
align-items: center;
font-size: 115%;
//box-shadow: inset 0px -11px 8px -10px #444;
background-repeat: no-repeat;
background-size: cover;
background-size: 100%;
background-position: top center;
flex-direction: column;
align-content: center;

View File

@ -37,26 +37,23 @@
{{ if $title }}</h3>{{ else }}</h2>{{ end }}
{{ with .Resources.GetMatch $banner }}
{{ if eq hugo.Environment "development" }}
{{ $good_ratio := "1.7777777777777777"}}
{{ $good_w := "1920"}}
{{ $good_h := "550"}}
{{ $ratio := div (float .Width) (float .Height) }}
{{ if lt $ratio $good_ratio }}
Ratio: {{ $ratio }}: not a good ratio, better around {{ $good_ratio }} (lower the hight in relation to the width)<br>
{{ else if gt $ratio $good_ratio }}
Ratio: {{ $ratio }}: not a good ratio, better around {{ $good_ratio }}(higher)<br>
{{ if lt (int .Width) $good_w }}
Width: {{ .Width }}px: too small, better {{ $good_w -}}px in width<br>
{{ else if gt (int .Width) $good_w }}
Width: {{ .Width }}px: too big, better {{ $good_w -}}px in width<br>
{{ end }}
{{ if lt (int .Width) "1920" }}
Width: {{ .Width }}px: too small, better 1920px in width<br>
{{ else if gt (int .Width) "1920" }}
Width: {{ .Width }}px: too big, better 1920px in width<br>
{{ end }}
{{ if lt (int .Height) "1080" }}
Height: {{ .Height }}px: too small, better 1080px in height<br>
{{ else if gt (int .Height) "1080" }}
Height: {{ .Height }}px: too big, better 1080px in height<br>
{{ if lt (int .Height) $good_h }}
Height: {{ .Height }}px: too small, better {{ $good_h -}}px in height<br>
{{ else if gt (int .Height) $good_h }}
Height: {{ .Height }}px: too big, better {{ $good_h -}}px in height<br>
{{ end }}
{{ end }}
<div class="img" style="background-image: url({{ .Permalink }})">
</div>
<!--<div class="img" style="background-image: url({{ .Permalink }})">
</div>-->
<img src="{{ .Permalink }}" />
{{ end }}
<div class="text">
{{ if .Description }}