From 0b552cbbf605b897c96e5a09e3a339f8a0955dc3 Mon Sep 17 00:00:00 2001 From: Doge Date: Sat, 8 May 2021 16:36:20 +0800 Subject: Draw header page --- _config.yml | 4 +-- layout/_partial/head.ejs | 2 +- layout/_partial/header.ejs | 87 +++++++++++++++++++++++++++++----------------- source/css/style.css | 16 +++++++++ 4 files changed, 75 insertions(+), 34 deletions(-) diff --git a/_config.yml b/_config.yml index 4294862..bea0c16 100644 --- a/_config.yml +++ b/_config.yml @@ -7,8 +7,8 @@ highlight: lightmode: 'atom-one-light' darkmode: 'atom-one-dark' navbar: - - ['https://google.com', 'fa fa-google'] - - ['https://twitter.com', 'fa fa-twitter'] + - ['https://init.blog', 'fa fa-cube'] + - ['https://github.com/guiqiqi', 'fa fa-github'] - ['/feed', 'fa fa-rss'] menubar: - ['/about', 'About'] diff --git a/layout/_partial/head.ejs b/layout/_partial/head.ejs index 3d4ee79..d20850c 100644 --- a/layout/_partial/head.ejs +++ b/layout/_partial/head.ejs @@ -21,6 +21,6 @@ - + <%- css("css/style.css") %> \ No newline at end of file diff --git a/layout/_partial/header.ejs b/layout/_partial/header.ejs index 32d2d2a..f7fef30 100644 --- a/layout/_partial/header.ejs +++ b/layout/_partial/header.ejs @@ -1,33 +1,58 @@ -
-
-
- <%= config.title %> -
-
- <% for (let item of theme.menubar) { %> - <%= item[1] %> - <% } %> -
+
+
+
- <% if (theme.logo) { %> - - <% } %> -
- <%= config.description %> + +
+
+

+ <% if (theme.logo) { %> + + <% } else { %> + + <%= config.title %> + + <% } %> +

+

+ <%- config.description %> +

    + <% for (let index in theme.navbar) { %> + <% + const mapping = theme.navbar[index]; + const link = mapping[0]; + const favicon = mapping[1]; + let outter = link.startsWith("https://") ? true : false; + %> + + + + <% } %> +
+

+
- -
\ No newline at end of file + \ No newline at end of file diff --git a/source/css/style.css b/source/css/style.css index 60e5df1..8ce9927 100644 --- a/source/css/style.css +++ b/source/css/style.css @@ -1,3 +1,19 @@ pre { background-color: none !important; +} + +@media (prefers-color-scheme: dark) { + * { + transition: backgourd-color 0.5s; + } +} + +@media screen and (max-width: 1023px) { + .navbar-menu { + box-shadow: 0 8px 16px -8px rgb(10 10 10 / 10%) !important; + } +} + +.navbar-brand .navbar-item:hover { + background-color: inherit !important; } \ No newline at end of file -- cgit v1.2.3