From 7e59454c192154f5de4e3d80d34fc235e6f9b108 Mon Sep 17 00:00:00 2001 From: rra Date: Sun, 24 Oct 2021 14:45:29 +0200 Subject: [PATCH] network cards now have a different layout for portrait and landscape mode --- layouts/partials/network_card.html | 39 +++++++++++++++------------- static/css/main.css | 41 ++++++++++++++++++++++-------- 2 files changed, 51 insertions(+), 29 deletions(-) diff --git a/layouts/partials/network_card.html b/layouts/partials/network_card.html index bc21bb3..8a92bb4 100644 --- a/layouts/partials/network_card.html +++ b/layouts/partials/network_card.html @@ -1,33 +1,36 @@
+ {{ $postPermalink := .Permalink}}

{{ .Title }}

- + +
From {{ if .Params.author }}{{.Params.author}} at {{ end }}{{ .Params.feed_name }}
- -
- {{ with (index (.Resources.ByType "image") 0) }} - {{ $thumb := .Fit "540x360"}} -
- {{ .Title }} -
+ {{ with (index (.Resources.ByType "image") 0) }} + {{ $height := add .Height 0.0}} + {{ $ratio := div $height .Width}} + {{ $thumb := .Fit "540x360"}} +
+
+ {{ .Title }} +
+ {{ else }} +
{{ end }}
{{ .Summary }}
+
-
- {{ if .Truncated }} -
\ No newline at end of file diff --git a/static/css/main.css b/static/css/main.css index 2a1d365..41764d3 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -206,19 +206,22 @@ body { .summary-text { flex: 1; padding: 1em; - max-height: 300px; - min-width: 20ch; + min-width: 34ch; text-overflow: ellipsis; overflow: hidden; } .summary-image > img { - height: 100%; +/* height: 100%; object-fit: cover; - max-width: 100%; + max-width: 100%;*/ } +.summary-image > a { + display: flex; +} + .summary-image{ border-right: 2px solid var(--border-color); } @@ -247,7 +250,7 @@ footer.post-footer { border: 2px solid darkcyan; box-shadow:1em 1em 0 #d2d1c8; background-color: lightgreen; - max-width: 540px; + max-width: min-content; margin-bottom: 2em; flex: auto; margin: 0 3em 3em 0; @@ -264,7 +267,7 @@ footer.post-footer { .h-entry.network header h2{ padding: 0.2em 0.5em 0.2em 0.5em; margin: 0; - border-color: darkcyan; + border: none; } .h-entry.network header h2:hover{ @@ -282,8 +285,7 @@ footer.post-footer { } .network .header-metadata .dt-published{ - padding-left: 1.2em; - min-width: 16ch; + border-bottom: 2px solid darkcyan; } @@ -296,15 +298,25 @@ footer.post-footer { padding: 0.5em 1.2em 0.5em 1.2em; } -.network footer.post-footer{ - border-top: 2px solid darkcyan; +.network .p-summary { + display: flex; } -.network .summary-image { +.network .p-summary.portrait { + flex-direction: row; +} +.network .p-summary.landscape{ + flex-direction: column; +} +.network .summary-image.portrait { + border-right: 2px solid darkcyan; +} +.network .summary-image.landscape { border-bottom: 2px solid darkcyan; border-right: none; } + .network .summary-image > img { display: inherit; } @@ -333,6 +345,13 @@ div.network-source{ border-left: 2px solid darkcyan; } +.network footer.post-footer{ + border-top: 2px solid darkcyan; + flex-flow: row; + font-size: 0.8rem; + padding-left: 1.2em; + min-width: 16ch; +} /* calendar cards */