Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,12 @@ home_banner:
qr:
- icon: /images/custom-icon.svg
qr:
# Fixed blur background for posts and pages (uses the same image as home banner)
# Can be overridden per-post/page via front matter: fixed_background: true/false
post_page:
enable: false
# Transparency level of content panels when background is active (0–100, lower = more transparent)
transparency: 60
# HOME BANNER <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< end


Expand Down
4 changes: 4 additions & 0 deletions layout/page.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
<% } else if (theme.home_banner.enable === true && is_home() && page.prev && theme.home_banner.style === "fixed") { %>
<%- partial('pages/home/home-background') %>
<% } %>
<% const _postPageBgEnabled = page.fixed_background !== undefined ? page.fixed_background === true : (theme.home_banner.enable === true && theme.home_banner.post_page && theme.home_banner.post_page.enable === true); %>
<% if (_postPageBgEnabled && (is_post() || is_page() || is_archive() || is_tag() || is_category())) { %>
<%- partial('pages/home/home-background') %>
<% } %>

<div class="main-content-container flex flex-col justify-between min-h-dvh">
<div class="main-content-header">
Expand Down
15 changes: 14 additions & 1 deletion layout/pages/home/home-background.ejs
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
<% const _bgTransparency = theme.home_banner.transparency !== undefined ? theme.home_banner.transparency : 60; %>
<% const _bgOpacity = Math.min(100, Math.max(0, _bgTransparency)) / 100; %>
<% const _defaultModeDark = theme.colors && theme.colors.default_mode === 'dark'; %>
<style>
:root { --bg-panel-color: rgba(<%= _defaultModeDark ? '32, 33, 36' : '255, 255, 255' %>, <%= _bgOpacity %>); }
.light { --bg-panel-color: rgba(255, 255, 255, <%= _bgOpacity %>); }
.dark { --bg-panel-color: rgba(32, 33, 36, <%= _bgOpacity %>); }
.home-article-item,
.sidebar-links,
.sidebar-content,
Expand All @@ -7,7 +13,7 @@
.sidebar-links .links:hover,
.right-bottom-tools,
footer.footer {
background-color: var(--background-color-transparent-80) !important;
background-color: var(--bg-panel-color) !important;
}
.right-bottom-tools:hover,
a.page-number:hover,
Expand All @@ -24,6 +30,13 @@
.home-banner-background {
filter: blur(15px);
}
.article-content-container,
.post-toc-container,
.post-tools-container,
.archive-container,
.page-template-container {
background-color: var(--bg-panel-color) !important;
}
</style>

<div class="home-banner-background transition-fade fixed top-0 left-0 w-screen h-screen scale-125 sm:scale-110 box-border will-change-transform bg-cover">
Expand Down
8 changes: 7 additions & 1 deletion layout/pages/home/home-banner.ejs
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<% const _bgTransparency = theme.home_banner.transparency !== undefined ? theme.home_banner.transparency : 60; %>
<% const _bgOpacity = Math.min(100, Math.max(0, _bgTransparency)) / 100; %>
<% const _defaultModeDark = theme.colors && theme.colors.default_mode === 'dark'; %>
<% if (theme.home_banner.style === "fixed") { %>
<style>
:root { --bg-panel-color: rgba(<%= _defaultModeDark ? '32, 33, 36' : '255, 255, 255' %>, <%= _bgOpacity %>); }
.light { --bg-panel-color: rgba(255, 255, 255, <%= _bgOpacity %>); }
.dark { --bg-panel-color: rgba(32, 33, 36, <%= _bgOpacity %>); }
.home-banner-container {
background: none !important;
}
Expand All @@ -11,7 +17,7 @@
.sidebar-links .links:hover,
.right-bottom-tools,
footer.footer {
background-color: var(--background-color-transparent-80) !important;
background-color: var(--bg-panel-color) !important;
}
.right-bottom-tools:hover,
a.page-number:hover,
Expand Down