From 6a0c47ff96bd2565d32a4df3a9b7a79ce24d8460 Mon Sep 17 00:00:00 2001 From: "Thomas A. Christensen II" <25492070+MillironX@users.noreply.github.com> Date: Fri, 22 Nov 2024 20:37:42 -0600 Subject: [PATCH] feat: Add card formatting --- assets/styles/millironx.css | 94 +++++++++++++++- layouts/_default/list.html | 129 +++++++++++++--------- layouts/partials/category-button.html | 45 ++++---- layouts/partials/list-item-thumbnail.html | 26 ----- 4 files changed, 192 insertions(+), 102 deletions(-) delete mode 100644 layouts/partials/list-item-thumbnail.html diff --git a/assets/styles/millironx.css b/assets/styles/millironx.css index a6f91d8..2c077f9 100644 --- a/assets/styles/millironx.css +++ b/assets/styles/millironx.css @@ -169,6 +169,79 @@ blockquote small { line-height: 1; } +.card { + background-color: color-mix( + in srgb, + light-dark(var(--brown-swiss-gray), var(--eclipse-gray)), + white 10% + ); + border-color: light-dark( + var(--manhattan-steel-blue), + var(--brown-swiss-gray) + ); + border-width: 1.5pt; + border-radius: 0.1rem; + border-style: outset; + margin: 1rem 0; + padding: 0.5rem; + padding-top: 0; + position: relative; + display: flex; + flex-direction: column; +} + +.card-link { + white-space: nowrap; + display: inline-flex; + gap: 0.375rem; + align-items: center; + text-underline-offset: 0.25em; + backface-visibility: hidden; + margin: 0 0.5em; +} + +.category-button { + position: absolute; + top: 1em; + right: 1em; + display: grid; + color: white; + background-color: var(--ear-tag-red); + border-radius: 0.5em; + padding: 1em; +} + +.card-title { + margin-right: 3em; +} + +.card-title > a { + color: inherit; +} + +.img-thumbnail { + width: 100%; + height: auto; + margin-top: 0.5rem; +} + +.thumb-icon-wrapper { + margin-top: 1rem; + display: flex; + justify-content: center; + align-content: center; +} + +.thumb-icon-badge { + font-size: xx-large; + justify-self: center; + align-self: center; + padding: 1.5rem 3rem; + border-radius: 3rem; + background-color: var(--ear-tag-red); + color: white; +} + /* Helper classes */ @@ -254,6 +327,25 @@ blockquote small { max-width: 50%; } + .card { + flex-direction: row; + } + + .img-thumbnail { + margin-right: 1rem; + } + + .card-header { + width: 20vw; + flex-shrink: 0; + display: flex; + justify-content: center; + } + + .card-body { + margin-left: 1rem; + } + /* Clearfix implementation */ @@ -271,7 +363,7 @@ blockquote small { } } /* end @media */ -@supports (animation-timeline: scroll()) { +@supports (animation-timeline: scroll()) and (animation-range) { @keyframes sticky-header { from { height: 50vh; diff --git a/layouts/_default/list.html b/layouts/_default/list.html index fb5e9aa..9168fd5 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,64 +1,91 @@ {{ define "main" }} {{ partial "scrolling-image-header" . }} -
-
+
+
{{ block "content" . }} {{ .Content }} {{ end }}
-
- {{ range .Pages }} -
-
- {{ partial "category-button" . }} + {{ range .Pages }} +
+ {{ partial "category-button" . }} - -
- {{ partial "list-item-thumbnail" . }} - - {{/* Prefer full-text links over local ones */}} - {{ $link := default .RelPermalink (index .Params "link") }} -

{{ .Title }}

- -
- {{ dateFormat "02 Jan 2006" .Date }} -
- - {{ range (.GetTerms "people") }} - {{ .LinkTitle }} - {{ end }} - - -

- {{ .Summary }} - Read more » -

-
- - - +
+ + {{ end }}
{{ end }} diff --git a/layouts/partials/category-button.html b/layouts/partials/category-button.html index e6c5d7c..b54d5ba 100644 --- a/layouts/partials/category-button.html +++ b/layouts/partials/category-button.html @@ -1,27 +1,24 @@ -
- {{ with .Param "categories" }} - {{ range $i, $category := . }} - {{ if eq $i 0 }} - {{ with $.Site.GetPage (printf "/%s/%s" "categories" $category) }} - {{ $iconDictionary := dict - "video" "fad fa-video" - "paper" "fad fa-book" - "poster" "fad fa-presentation" - "thesis" "fad fa-graduation-cap" - "presentation" "fad fa-podium" - "web" "fad fa-globe" - }} - {{ $categoryIcon := index $iconDictionary $category }} - - - - {{ end }} +{{ with .Param "categories" }} + {{ range $i, $category := . }} + {{ if eq $i 0 }} + {{ with $.Site.GetPage (printf "/%s/%s" "categories" $category) }} + {{ $iconDictionary := dict + "video" "fad fa-video" + "paper" "fad fa-book" + "poster" "fad fa-presentation" + "thesis" "fad fa-graduation-cap" + "presentation" "fad fa-podium" + "web" "fad fa-globe" + }} + {{ $categoryIcon := index $iconDictionary $category }} + + + {{ end }} {{ end }} {{ end }} -
+{{ end }} diff --git a/layouts/partials/list-item-thumbnail.html b/layouts/partials/list-item-thumbnail.html deleted file mode 100644 index 44bed22..0000000 --- a/layouts/partials/list-item-thumbnail.html +++ /dev/null @@ -1,26 +0,0 @@ -{{ with .Param "fa-thumbnail" }} -
- - - -
-{{ end }} - -{{/* Thumbnail images should be stored as 'thumbnail'.* in the page bundle, but - historically they might have been referenced as 'thumbnail' in the front - matter, or (even more historically) as 'cardImage'. Use scratch to - normalize all these different systems. -*/}} -{{ $bundleGlob := "thumbnail.*" }} -{{ $frontThumbGlob := print "images/" (.Params.thumbnail) ".*" }} -{{ $frontCardGlob := print "images/" (.Params.cardImage) ".jpg" }} -{{ $allThumbnailGlob := print "{" $frontThumbGlob "," $frontCardGlob "," $bundleGlob "}" }} -{{ with .Resources.GetMatch $allThumbnailGlob }} - {{ $thumbnail := . }} - {{ $thumbnailResized := $thumbnail.Resize "600x" }} - Thumbnail of {{ .Title }} -{{ end }}