Blurhash-type of thing for articles with a banner

This commit is contained in:
daudix
2024-09-17 04:59:08 +03:00
parent 3b633f63b4
commit 3b244ecb03
12 changed files with 24 additions and 2 deletions

View File

@ -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 footnotes' go back button.
- Add active state to slider thumb. - Add active state to slider thumb.
- Add Bahasa Melayu translation (#78). - 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 fading on top/bottom of the search results container.
- Add loading animation to "Load Comments" button. - Add loading animation to "Load Comments" button.
- Add margin between comment author name and timestamp. - Add margin between comment author name and timestamp.

View File

@ -10,7 +10,7 @@
outline-color: transparent; outline-color: transparent;
outline-style: dashed; outline-style: dashed;
outline-width: 0.125rem; outline-width: 0.125rem;
box-shadow: var(--edge-highlight); box-shadow: var(--edge-highlight), var(--shadow-glass);
border-radius: var(--rounded-corner); border-radius: var(--rounded-corner);
border-start-end-radius: 2.125rem; border-start-end-radius: 2.125rem;
border-end-end-radius: 1.8125rem; border-end-end-radius: 1.8125rem;
@ -320,5 +320,16 @@
border-block-start: max(1px, 0.0625rem) solid var(--fg-muted-2); border-block-start: max(1px, 0.0625rem) solid var(--fg-muted-2);
padding-block-start: 0.5rem; 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;
}
} }
} }

View File

@ -32,6 +32,10 @@
--purple-fg: rgb(220 138 221); --purple-fg: rgb(220 138 221);
--red-fg: rgb(246 97 81); --red-fg: rgb(246 97 81);
--yellow-fg: rgb(248 228 92); --yellow-fg: rgb(248 228 92);
// FILTERS
--blurhash-blur: brightness(25%) blur(1rem);
color-scheme: dark; color-scheme: dark;
} }
@ -69,6 +73,7 @@
// FILTERS // FILTERS
--blur: saturate(180%) blur(0.75rem); --blur: saturate(180%) blur(0.75rem);
--blurhash-blur: contrast(25%) brightness(175%) blur(1rem);
// FONT SIZES // FONT SIZES
--font-size-xx-small: 0.625rem; --font-size-xx-small: 0.625rem;
@ -114,10 +119,10 @@
--disabled-opacity: 60%; --disabled-opacity: 60%;
// SHADOWS // 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: 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-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%); --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 // STATES
--hover: scale(110%); --hover: scale(110%);

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 460 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 652 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 684 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 826 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 484 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 855 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 983 B

View File

@ -72,6 +72,11 @@
</small> </small>
</div> </div>
{%- endif -%} {%- endif -%}
{%- if page.extra.banner -%}
{%- set blurhash = resize_image(path=page.colocated_path ~ page.extra.banner, width=16, height=8, op="fill", format="webp") -%}
<div class="blurhash" style="--blurhash: url('{{ blurhash.url }}')"></div>
{%- endif -%}
</article> </article>
{%- endfor %} {%- endfor %}
</div> </div>