Much fancier banners

This commit is contained in:
daudix
2024-07-15 07:10:12 +03:00
parent 462e248be9
commit 12408de744
3 changed files with 15 additions and 6 deletions

View File

@ -7,6 +7,7 @@ updated = "2024-06-21"
[taxonomies] [taxonomies]
tags = ["Demo", "Test"] tags = ["Demo", "Test"]
[extra] [extra]
banner = "quill.png#pixels"
toc = true toc = true
disclaimer = """ disclaimer = """
See [demo](@/demo/index.md) for showcase of all Duckquill possibilities. This page is a demo of a post with title, publication date, tags, disclaimer, table of contents and comments. See [demo](@/demo/index.md) for showcase of all Duckquill possibilities. This page is a demo of a post with title, publication date, tags, disclaimer, table of contents and comments.
@ -18,8 +19,6 @@ user = "sungsphinx"
id = "111789185826519979" id = "111789185826519979"
+++ +++
![Quill](quill.png)
## The what? ## The what?
This is a Duckquill post example, this post has nothing but a bunch of text and random formatting, acting like a demo. This is a Duckquill post example, this post has nothing but a bunch of text and random formatting, acting like a demo.

View File

@ -1,4 +1,4 @@
#banner { #banner-container {
$mask: linear-gradient(black, transparent); $mask: linear-gradient(black, transparent);
-webkit-mask-image: $mask; -webkit-mask-image: $mask;
-webkit-user-select: none; -webkit-user-select: none;
@ -7,9 +7,17 @@
left: 0; left: 0;
z-index: -1; z-index: -1;
mask-image: $mask; mask-image: $mask;
transition: none; width: 100vw;
margin: 0; height: 50vw;
user-select: none; user-select: none;
#banner {
position: fixed;
top: 0;
left: 0;
transition: none;
margin: 0;
}
} }
.banner-margin { .banner-margin {

View File

@ -5,7 +5,9 @@
{%- set date_locale = macros_translate::translate(key="date_locale", default="en_US", language_strings=language_strings) -%} {%- set date_locale = macros_translate::translate(key="date_locale", default="en_US", language_strings=language_strings) -%}
<article> <article>
{%- if page.extra.banner -%} {%- if page.extra.banner -%}
<img id="banner" class="full-bleed" src="{{ current_url | safe }}{{ page.extra.banner }}" /> <div id="banner-container">
<img id="banner" class="full-bleed" src="{{ current_url | safe }}{{ page.extra.banner }}" />
</div>
{%- endif -%} {%- endif -%}
<h1 {% if page.extra.banner %}class="banner-margin"{%- endif -%}>{{ page.title }}</h1> <h1 {% if page.extra.banner %}class="banner-margin"{%- endif -%}>{{ page.title }}</h1>