diff --git a/CHANGELOG.md b/CHANGELOG.md index f2a00fb..c914be6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add active state to footnotes' go back button. - Add active state to slider thumb. - Add Bahasa Melayu translation (#78). +- Add blurred banner to the article in list, if one is present. - Add fading on top/bottom of the search results container. - Add loading animation to "Load Comments" button. - Add margin between comment author name and timestamp. diff --git a/sass/_article-list.scss b/sass/_article-list.scss index 74b7c28..a042986 100644 --- a/sass/_article-list.scss +++ b/sass/_article-list.scss @@ -10,7 +10,7 @@ outline-color: transparent; outline-style: dashed; outline-width: 0.125rem; - box-shadow: var(--edge-highlight); + box-shadow: var(--edge-highlight), var(--shadow-glass); border-radius: var(--rounded-corner); border-start-end-radius: 2.125rem; border-end-end-radius: 1.8125rem; @@ -320,5 +320,16 @@ border-block-start: max(1px, 0.0625rem) solid var(--fg-muted-2); padding-block-start: 0.5rem; } + + .blurhash { + position: absolute; + opacity: var(--dim-opacity); + z-index: -1; + filter: var(--blurhash-blur); + inset: 0; + background-image: var(--blurhash); + background-position: center; + background-size: cover; + } } } diff --git a/sass/_variables.scss b/sass/_variables.scss index bf8b49a..6ccf78b 100644 --- a/sass/_variables.scss +++ b/sass/_variables.scss @@ -32,6 +32,10 @@ --purple-fg: rgb(220 138 221); --red-fg: rgb(246 97 81); --yellow-fg: rgb(248 228 92); + + // FILTERS + --blurhash-blur: brightness(25%) blur(1rem); + color-scheme: dark; } @@ -69,6 +73,7 @@ // FILTERS --blur: saturate(180%) blur(0.75rem); + --blurhash-blur: contrast(25%) brightness(175%) blur(1rem); // FONT SIZES --font-size-xx-small: 0.625rem; @@ -114,10 +119,10 @@ --disabled-opacity: 60%; // SHADOWS + --edge-highlight: inset 0 0.0625rem 0 rgb(255 255 255 / 10%); --shadow: 0 0 0 0.0625rem rgb(0 0 0 / 3%), 0 0.0625rem 0.1875rem 0.0625rem rgb(0 0 0 / 7%), 0 0.125rem 0.375rem 0.125rem rgb(0 0 0 / 3%); --shadow-raised: 0 0 0 0.0625rem rgb(0 0 0 / 6%), 0 0.125rem 0.375rem 0.125rem rgb(0 0 0 / 14%), 0 0.25rem 0.75rem 0.25rem rgb(0 0 0 / 6%); --shadow-glass: 0 0.75rem 1.5rem -1rem rgb(0 0 0 / 50%); - --edge-highlight: inset 0 0.0625rem 0 rgb(255 255 255 / 10%); // STATES --hover: scale(110%); diff --git a/static/processed_images/banner.826a4b69b346b5d4.jpg b/static/processed_images/banner.826a4b69b346b5d4.jpg new file mode 100644 index 0000000..a897b98 Binary files /dev/null and b/static/processed_images/banner.826a4b69b346b5d4.jpg differ diff --git a/static/processed_images/banner.842d37f0cf47655b.png b/static/processed_images/banner.842d37f0cf47655b.png new file mode 100644 index 0000000..365a104 Binary files /dev/null and b/static/processed_images/banner.842d37f0cf47655b.png differ diff --git a/static/processed_images/banner.85f993cdc35ace32.jpg b/static/processed_images/banner.85f993cdc35ace32.jpg new file mode 100644 index 0000000..45d69e2 Binary files /dev/null and b/static/processed_images/banner.85f993cdc35ace32.jpg differ diff --git a/static/processed_images/banner.8deb3c618a299ab6.jpg b/static/processed_images/banner.8deb3c618a299ab6.jpg new file mode 100644 index 0000000..50f7db6 Binary files /dev/null and b/static/processed_images/banner.8deb3c618a299ab6.jpg differ diff --git a/static/processed_images/banner.bec8a672e7b17fb6.jpg b/static/processed_images/banner.bec8a672e7b17fb6.jpg new file mode 100644 index 0000000..2efae2c Binary files /dev/null and b/static/processed_images/banner.bec8a672e7b17fb6.jpg differ diff --git a/static/processed_images/banner.ed0678c0bce42ad1.webp b/static/processed_images/banner.ed0678c0bce42ad1.webp new file mode 100644 index 0000000..b1bde2a Binary files /dev/null and b/static/processed_images/banner.ed0678c0bce42ad1.webp differ diff --git a/static/processed_images/banner.ef59d6bceabab042.webp b/static/processed_images/banner.ef59d6bceabab042.webp new file mode 100644 index 0000000..ece68b1 Binary files /dev/null and b/static/processed_images/banner.ef59d6bceabab042.webp differ diff --git a/static/processed_images/banner.f518e108c1e70a95.jpg b/static/processed_images/banner.f518e108c1e70a95.jpg new file mode 100644 index 0000000..f398158 Binary files /dev/null and b/static/processed_images/banner.f518e108c1e70a95.jpg differ diff --git a/templates/partials/articles.html b/templates/partials/articles.html index 64d9302..5040fad 100644 --- a/templates/partials/articles.html +++ b/templates/partials/articles.html @@ -72,6 +72,11 @@ {%- endif -%} + {%- if page.extra.banner -%} + {%- set blurhash = resize_image(path=page.colocated_path ~ page.extra.banner, width=16, height=8, op="fill", format="webp") -%} +
+ {%- endif -%} + {%- endfor %}