diff options
author | Doge <[email protected]> | 2021-05-21 01:53:08 +0800 |
---|---|---|
committer | Doge <[email protected]> | 2021-05-21 01:53:08 +0800 |
commit | ef9166a92607093dea593653a9977fba40d82ad3 (patch) | |
tree | 5d499dea3a8c0a5160b702f68616c03f94e2f5ad /layout | |
parent | d187e68f0e2233b8440d190136cc9087c49b9342 (diff) | |
download | chromate-ef9166a92607093dea593653a9977fba40d82ad3.tar.gz chromate-ef9166a92607093dea593653a9977fba40d82ad3.tar.bz2 chromate-ef9166a92607093dea593653a9977fba40d82ad3.zip |
Add header adjustment with autoscroll
Diffstat (limited to 'layout')
-rw-r--r-- | layout/_partial/header.ejs | 12 | ||||
-rw-r--r-- | layout/post.ejs | 12 |
2 files changed, 20 insertions, 4 deletions
diff --git a/layout/_partial/header.ejs b/layout/_partial/header.ejs index 34097f7..a9d9dbd 100644 --- a/layout/_partial/header.ejs +++ b/layout/_partial/header.ejs @@ -1,7 +1,7 @@ -<% if (is_post()) { %> -<section class="hero is-medium auto-dark"> +<% if (is_home()) { %> +<section class="hero is-<%= theme.header.index %> auto-dark"> <% } else { %> -<section class="hero is-large auto-dark"> +<section class="hero is-<%= theme.header.other %> auto-dark"> <% } %> <div class="hero-head"> <header class="navbar" aria-label="main navigation"> @@ -69,4 +69,10 @@ </p> </div> </div> + + <% if (is_home()) { %> + <div class="hero-foot"> + + </div> + <% } %> </section>
\ No newline at end of file diff --git a/layout/post.ejs b/layout/post.ejs index 9d9c8df..1419b70 100644 --- a/layout/post.ejs +++ b/layout/post.ejs @@ -1,6 +1,16 @@ <div class="columns"> <div class="column is-8 is-offset-2"> - <div class="card"> + <div id="post" class="card"> + <% if (theme.header.autoscroll) { %> + <script> + window.addEventListener("load", ()=>{ + let content = document.getElementById("post"); + content.scrollIntoView({ + behavior: "smooth" + }); + }); + </script> + <% } %> <% if (page.thumbnail) { %> <div class="card-iamge"> <figure class="image is-16by9"> |