From ad8f9f55ea79a4d587aecc69698808da82de3d62 Mon Sep 17 00:00:00 2001 From: somhairle Date: Tue, 21 Apr 2026 20:40:27 +0800 Subject: 二〇二六年四月二十一日 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/theme/LICENSE | 21 ++ themes/theme/_config.yml | 91 ++++++ themes/theme/layout/archive.ejs | 1 + themes/theme/layout/category.ejs | 4 + themes/theme/layout/index.ejs | 1 + themes/theme/layout/layout.ejs | 24 ++ themes/theme/layout/pages/page_head.ejs | 14 + themes/theme/layout/pages/profile.ejs | 21 ++ themes/theme/layout/partials/back_to_top.ejs | 24 ++ themes/theme/layout/partials/footer.ejs | 16 ++ themes/theme/layout/partials/head.ejs | 73 +++++ themes/theme/layout/partials/header.ejs | 42 +++ themes/theme/layout/partials/paginator.ejs | 14 + themes/theme/layout/partials/post_gallery.ejs | 42 +++ themes/theme/layout/partials/post_list.ejs | 29 ++ themes/theme/layout/partials/tag_cloud.ejs | 11 + themes/theme/layout/post.ejs | 14 + themes/theme/layout/post/post_comment.ejs | 48 ++++ themes/theme/layout/post/post_content.ejs | 7 + themes/theme/layout/post/post_footer.ejs | 21 ++ themes/theme/layout/post/post_head.ejs | 34 +++ themes/theme/layout/search.ejs | 21 ++ themes/theme/layout/tag.ejs | 17 ++ themes/theme/source/css/animation.styl | 14 + themes/theme/source/css/base.styl | 38 +++ themes/theme/source/css/color.styl | 10 + themes/theme/source/css/color_mode/classic.styl | 19 ++ themes/theme/source/css/color_mode/dark.styl | 20 ++ themes/theme/source/css/color_mode/default.styl | 20 ++ themes/theme/source/css/component/button.styl | 64 +++++ themes/theme/source/css/component/component.styl | 44 +++ themes/theme/source/css/component/icon.styl | 21 ++ themes/theme/source/css/font-slices.styl | 47 ++++ themes/theme/source/css/font.styl | 105 +++++++ themes/theme/source/css/highlight/ascetic.styl | 37 +++ themes/theme/source/css/highlight/brown-paper.styl | 55 ++++ themes/theme/source/css/highlight/dark.styl | 27 ++ themes/theme/source/css/highlight/darkula.styl | 33 +++ themes/theme/source/css/highlight/foundation.styl | 71 +++++ themes/theme/source/css/highlight/github-gist.styl | 57 ++++ themes/theme/source/css/highlight/github.styl | 79 ++++++ themes/theme/source/css/highlight/googlecode.styl | 72 +++++ themes/theme/source/css/highlight/idea.styl | 78 ++++++ themes/theme/source/css/highlight/rainbow.styl | 46 +++ themes/theme/source/css/highlight/school-book.styl | 57 ++++ .../theme/source/css/highlight/solarized-dark.styl | 45 +++ .../source/css/highlight/solarized-light.styl | 71 +++++ themes/theme/source/css/highlight/tomorrow.styl | 56 ++++ themes/theme/source/css/highlight/vs.styl | 58 ++++ themes/theme/source/css/highlight/xcode.styl | 74 +++++ themes/theme/source/css/highlight/zenburn.styl | 46 +++ themes/theme/source/css/layout.styl | 13 + themes/theme/source/css/media.styl | 28 ++ themes/theme/source/css/motion.styl | 34 +++ themes/theme/source/css/normalize.styl | 308 +++++++++++++++++++++ themes/theme/source/css/page/search.styl | 65 +++++ themes/theme/source/css/partials/footer.styl | 20 ++ themes/theme/source/css/partials/header.styl | 121 ++++++++ themes/theme/source/css/partials/paginator.styl | 28 ++ themes/theme/source/css/partials/post_gallery.styl | 39 +++ themes/theme/source/css/partials/post_list.styl | 39 +++ themes/theme/source/css/partials/profile.styl | 69 +++++ themes/theme/source/css/post/code.styl | 97 +++++++ themes/theme/source/css/post/media.styl | 17 ++ themes/theme/source/css/post/mermaid.styl | 96 +++++++ themes/theme/source/css/post/post_comment.styl | 12 + themes/theme/source/css/post/post_content.styl | 104 +++++++ themes/theme/source/css/post/post_footer.styl | 29 ++ themes/theme/source/css/post/post_head.styl | 18 ++ themes/theme/source/css/post/table.styl | 36 +++ themes/theme/source/css/post/tag_plugin.styl | 48 ++++ themes/theme/source/css/post/task_list.styl | 43 +++ themes/theme/source/css/style.styl | 47 ++++ themes/theme/source/css/variable.styl | 72 +++++ themes/theme/source/favicon.ico | Bin 0 -> 3396 bytes themes/theme/source/fonts/CarroisSong.ttf | Bin 0 -> 4915204 bytes themes/theme/source/fonts/cjk-common.woff2 | Bin 0 -> 431544 bytes themes/theme/source/fonts/cjk-ext.woff2 | Bin 0 -> 1220816 bytes themes/theme/source/fonts/latin-base.woff2 | Bin 0 -> 25024 bytes themes/theme/source/fonts/latin-ext.woff2 | Bin 0 -> 22076 bytes .../source/fonts/src/GoogleSansCode-Regular.ttf | Bin 0 -> 1893976 bytes themes/theme/source/fonts/symbols.woff2 | Bin 0 -> 13740 bytes themes/theme/source/icon/arrow-left.svg | 7 + themes/theme/source/icon/arrow-right.svg | 7 + themes/theme/source/icon/arrow-up.svg | 7 + themes/theme/source/icon/checkbox-checked.svg | 13 + themes/theme/source/icon/checkbox-default.svg | 13 + themes/theme/source/icon/close-btn.svg | 3 + themes/theme/source/icon/marker.svg | 18 ++ themes/theme/source/js/format.js | 23 ++ themes/theme/source/js/menu.js | 27 ++ themes/theme/source/js/mermaid-zoom.js | 169 +++++++++++ themes/theme/source/js/search.js | 68 +++++ themes/theme/source/js/theme-switch.js | 31 +++ themes/theme/source/profile_cover.jpg | Bin 0 -> 84287 bytes 95 files changed, 3723 insertions(+) create mode 100644 themes/theme/LICENSE create mode 100644 themes/theme/_config.yml create mode 100644 themes/theme/layout/archive.ejs create mode 100644 themes/theme/layout/category.ejs create mode 100644 themes/theme/layout/index.ejs create mode 100644 themes/theme/layout/layout.ejs create mode 100644 themes/theme/layout/pages/page_head.ejs create mode 100644 themes/theme/layout/pages/profile.ejs create mode 100644 themes/theme/layout/partials/back_to_top.ejs create mode 100644 themes/theme/layout/partials/footer.ejs create mode 100644 themes/theme/layout/partials/head.ejs create mode 100644 themes/theme/layout/partials/header.ejs create mode 100644 themes/theme/layout/partials/paginator.ejs create mode 100644 themes/theme/layout/partials/post_gallery.ejs create mode 100644 themes/theme/layout/partials/post_list.ejs create mode 100644 themes/theme/layout/partials/tag_cloud.ejs create mode 100644 themes/theme/layout/post.ejs create mode 100644 themes/theme/layout/post/post_comment.ejs create mode 100644 themes/theme/layout/post/post_content.ejs create mode 100644 themes/theme/layout/post/post_footer.ejs create mode 100644 themes/theme/layout/post/post_head.ejs create mode 100644 themes/theme/layout/search.ejs create mode 100644 themes/theme/layout/tag.ejs create mode 100644 themes/theme/source/css/animation.styl create mode 100644 themes/theme/source/css/base.styl create mode 100644 themes/theme/source/css/color.styl create mode 100644 themes/theme/source/css/color_mode/classic.styl create mode 100644 themes/theme/source/css/color_mode/dark.styl create mode 100644 themes/theme/source/css/color_mode/default.styl create mode 100644 themes/theme/source/css/component/button.styl create mode 100644 themes/theme/source/css/component/component.styl create mode 100644 themes/theme/source/css/component/icon.styl create mode 100644 themes/theme/source/css/font-slices.styl create mode 100644 themes/theme/source/css/font.styl create mode 100644 themes/theme/source/css/highlight/ascetic.styl create mode 100644 themes/theme/source/css/highlight/brown-paper.styl create mode 100644 themes/theme/source/css/highlight/dark.styl create mode 100644 themes/theme/source/css/highlight/darkula.styl create mode 100644 themes/theme/source/css/highlight/foundation.styl create mode 100644 themes/theme/source/css/highlight/github-gist.styl create mode 100644 themes/theme/source/css/highlight/github.styl create mode 100644 themes/theme/source/css/highlight/googlecode.styl create mode 100644 themes/theme/source/css/highlight/idea.styl create mode 100644 themes/theme/source/css/highlight/rainbow.styl create mode 100644 themes/theme/source/css/highlight/school-book.styl create mode 100644 themes/theme/source/css/highlight/solarized-dark.styl create mode 100644 themes/theme/source/css/highlight/solarized-light.styl create mode 100644 themes/theme/source/css/highlight/tomorrow.styl create mode 100644 themes/theme/source/css/highlight/vs.styl create mode 100644 themes/theme/source/css/highlight/xcode.styl create mode 100644 themes/theme/source/css/highlight/zenburn.styl create mode 100644 themes/theme/source/css/layout.styl create mode 100644 themes/theme/source/css/media.styl create mode 100644 themes/theme/source/css/motion.styl create mode 100644 themes/theme/source/css/normalize.styl create mode 100644 themes/theme/source/css/page/search.styl create mode 100644 themes/theme/source/css/partials/footer.styl create mode 100644 themes/theme/source/css/partials/header.styl create mode 100644 themes/theme/source/css/partials/paginator.styl create mode 100644 themes/theme/source/css/partials/post_gallery.styl create mode 100644 themes/theme/source/css/partials/post_list.styl create mode 100644 themes/theme/source/css/partials/profile.styl create mode 100644 themes/theme/source/css/post/code.styl create mode 100644 themes/theme/source/css/post/media.styl create mode 100644 themes/theme/source/css/post/mermaid.styl create mode 100644 themes/theme/source/css/post/post_comment.styl create mode 100644 themes/theme/source/css/post/post_content.styl create mode 100644 themes/theme/source/css/post/post_footer.styl create mode 100644 themes/theme/source/css/post/post_head.styl create mode 100644 themes/theme/source/css/post/table.styl create mode 100644 themes/theme/source/css/post/tag_plugin.styl create mode 100644 themes/theme/source/css/post/task_list.styl create mode 100644 themes/theme/source/css/style.styl create mode 100644 themes/theme/source/css/variable.styl create mode 100644 themes/theme/source/favicon.ico create mode 100644 themes/theme/source/fonts/CarroisSong.ttf create mode 100644 themes/theme/source/fonts/cjk-common.woff2 create mode 100644 themes/theme/source/fonts/cjk-ext.woff2 create mode 100644 themes/theme/source/fonts/latin-base.woff2 create mode 100644 themes/theme/source/fonts/latin-ext.woff2 create mode 100644 themes/theme/source/fonts/src/GoogleSansCode-Regular.ttf create mode 100644 themes/theme/source/fonts/symbols.woff2 create mode 100644 themes/theme/source/icon/arrow-left.svg create mode 100644 themes/theme/source/icon/arrow-right.svg create mode 100644 themes/theme/source/icon/arrow-up.svg create mode 100644 themes/theme/source/icon/checkbox-checked.svg create mode 100644 themes/theme/source/icon/checkbox-default.svg create mode 100644 themes/theme/source/icon/close-btn.svg create mode 100644 themes/theme/source/icon/marker.svg create mode 100644 themes/theme/source/js/format.js create mode 100644 themes/theme/source/js/menu.js create mode 100644 themes/theme/source/js/mermaid-zoom.js create mode 100644 themes/theme/source/js/search.js create mode 100644 themes/theme/source/js/theme-switch.js create mode 100644 themes/theme/source/profile_cover.jpg (limited to 'themes') diff --git a/themes/theme/LICENSE b/themes/theme/LICENSE new file mode 100644 index 00000000..6c4fd597 --- /dev/null +++ b/themes/theme/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 zoeingwingkei + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/themes/theme/_config.yml b/themes/theme/_config.yml new file mode 100644 index 00000000..f642fd1a --- /dev/null +++ b/themes/theme/_config.yml @@ -0,0 +1,91 @@ + +# html lang +language: en + +# header +site_brand_name: 暮秋小屋 + +logo_image: + enable: false + image_path: /logo.ico # path to your logo image + +menu: + 主页: / + 日记本: /categories/gallery/ + 泛医学: /tags/Medicine/ + 计算机: /tags/Technique/ + 生活: /tags/Life/ + 全部: /archives + 关于: /about + +# stylesheets loaded in the +stylesheets: +- /css/style.css + +# scripts loaded in the end of the body +scripts: +- /js/menu.js + +# favicon +favicon: /favicon.ico + +date_format: MMM D, YYYY + +# profile +profile: + title: 暮秋小屋 + body: "思念、灵感、文档的寄存处" + image: /profile_cover.jpg + + links: + 计算机: /tags/Technique/ + 泛医学: /tags/Medicine/ + 生活: /tags/Life/ + 日记本: /categories/gallery/ + 网页存档: /tags/Archive + 全部: /archives + 关于: /about + +# footer +footer: + copyright_info: + enable: true + author: 韩暮秋 + + powered_by: + enable: true + + other_info: + enable: false + content: + +# color mode: default / classic / dark +color_mode: default + +# mathjax setting +# note: need to install the hexo plugin for math: https://github.com/hexojs/hexo-math +mathjax_enable: true + +# comments: support disqus and valine +valine: # valine setup guide: https://valine.js.org/quickstart.html + enable: false + appId: # Your valine app Id + appKey: # Your valine app Key + lang: 'en' + placeholder: 'Say something' + avatar: 'mp' + meta: ['nick', 'mail'] + +disqus: # disqus setup guide: https://help.disqus.com/en/articles/1717056-publisher-quick-start-guide + enable: false + disqus_url: # your diqsuq url or shortname + language: 'en' + +# local search +local_search: + enable: true + place_holder: Search Anything + trigger: auto # auto: trigger search whenever input changes + top_n_per_article: 1 # show top n results per article, show all results by setting to -1 + unescape: false # unescape html strings to the readable one + preload: false # reload the search data when the page loads, this will accelerate the search process diff --git a/themes/theme/layout/archive.ejs b/themes/theme/layout/archive.ejs new file mode 100644 index 00000000..426f6a86 --- /dev/null +++ b/themes/theme/layout/archive.ejs @@ -0,0 +1 @@ +<%- partial('partials/post_list') %> \ No newline at end of file diff --git a/themes/theme/layout/category.ejs b/themes/theme/layout/category.ejs new file mode 100644 index 00000000..aad151ae --- /dev/null +++ b/themes/theme/layout/category.ejs @@ -0,0 +1,4 @@ +
+ <%- partial('partials/post_gallery') %> +
+ diff --git a/themes/theme/layout/index.ejs b/themes/theme/layout/index.ejs new file mode 100644 index 00000000..a8c4c3ed --- /dev/null +++ b/themes/theme/layout/index.ejs @@ -0,0 +1 @@ +<%- partial('pages/profile') %> \ No newline at end of file diff --git a/themes/theme/layout/layout.ejs b/themes/theme/layout/layout.ejs new file mode 100644 index 00000000..4edf6098 --- /dev/null +++ b/themes/theme/layout/layout.ejs @@ -0,0 +1,24 @@ + + + + <%- partial('partials/head') %> + + +
+ + <%- partial('partials/header') %> + +
+
+ <%- body %> +
+
+ + <%- partial('partials/footer') %> + +
+ + + + + diff --git a/themes/theme/layout/pages/page_head.ejs b/themes/theme/layout/pages/page_head.ejs new file mode 100644 index 00000000..709fd55c --- /dev/null +++ b/themes/theme/layout/pages/page_head.ejs @@ -0,0 +1,14 @@ +
+ +
+
\ No newline at end of file diff --git a/themes/theme/layout/pages/profile.ejs b/themes/theme/layout/pages/profile.ejs new file mode 100644 index 00000000..19f38a05 --- /dev/null +++ b/themes/theme/layout/pages/profile.ejs @@ -0,0 +1,21 @@ +
+
+ <% if (theme.profile.image) {%> + featured_image + <% } %> +
+
+
+ <%=theme.profile.title%> +
+
+ <%=theme.profile.body%> +
+ <% Object.keys(theme.profile.links).forEach(key => { %> + + <% }); %> +
+ +
\ No newline at end of file diff --git a/themes/theme/layout/partials/back_to_top.ejs b/themes/theme/layout/partials/back_to_top.ejs new file mode 100644 index 00000000..df413f52 --- /dev/null +++ b/themes/theme/layout/partials/back_to_top.ejs @@ -0,0 +1,24 @@ +
+ +
+ + \ No newline at end of file diff --git a/themes/theme/layout/partials/footer.ejs b/themes/theme/layout/partials/footer.ejs new file mode 100644 index 00000000..6200a376 --- /dev/null +++ b/themes/theme/layout/partials/footer.ejs @@ -0,0 +1,16 @@ + diff --git a/themes/theme/layout/partials/head.ejs b/themes/theme/layout/partials/head.ejs new file mode 100644 index 00000000..23265719 --- /dev/null +++ b/themes/theme/layout/partials/head.ejs @@ -0,0 +1,73 @@ + + + +<% if(config.author){ %> + + <% } %> + <% if(config.subtitle){ %> + + <% } %> + <% if(config.description){ %> + + <% } %> + <% if(config.keywords){ %> + + <% } %> + + <% var title=page.title; if (is_archive()){ title=__('Archive'); if (is_month()){ title + +=': ' + page.year + '/' + page.month; } else if (is_year()){ title +=': ' + + page.year; } } else if (is_category()){ title=__('Category') + ': ' + page.category; + } else if (is_tag()){ title=__('Tag') + ': ' + page.tag; } %> + + + <% if (title){ %> + <%= title %> | <% } %> + <%= config.title %> + + + <%# favicon %> + <% if (theme.favicon){ %> + + <% } %> + + <%# css list %> + <% if (theme.stylesheets !==undefined && theme.stylesheets.length> + 0) { %> + + <% theme.stylesheets.forEach(url=> { %> + + <% }); %> + <% } %> + + <%# font preload - critical slices %> + + + + <%# javascript list %> + <% if (theme.scripts !==undefined && + theme.scripts.length> 0) { %> + + <% theme.scripts.forEach(url=> { %> + + <% }); %> + <% } %> + + <%# mathjax support %> + <% if(theme.mathjax_enable){ + %> + + + <% } %> + + <%# valine comment + support %> + <% if(theme.valine.enable){ + %> + + <% } %> \ No newline at end of file diff --git a/themes/theme/layout/partials/header.ejs b/themes/theme/layout/partials/header.ejs new file mode 100644 index 00000000..97752d9e --- /dev/null +++ b/themes/theme/layout/partials/header.ejs @@ -0,0 +1,42 @@ +
+
+
+ + + +
+
+
diff --git a/themes/theme/layout/partials/paginator.ejs b/themes/theme/layout/partials/paginator.ejs new file mode 100644 index 00000000..41c26391 --- /dev/null +++ b/themes/theme/layout/partials/paginator.ejs @@ -0,0 +1,14 @@ +<% if (page.total > 1){ %> +
+
+ +
+<% } %> \ No newline at end of file diff --git a/themes/theme/layout/partials/post_gallery.ejs b/themes/theme/layout/partials/post_gallery.ejs new file mode 100644 index 00000000..488270d3 --- /dev/null +++ b/themes/theme/layout/partials/post_gallery.ejs @@ -0,0 +1,42 @@ +
+
+ <% page.posts.each(function (post) { %> +
+ +
+ <% if (post.featured_image) {%> + featured_image + <% } %> +
+
+
+ <% }) %> +
+
+ <%- partial('partials/paginator') %> +
+
diff --git a/themes/theme/layout/partials/post_list.ejs b/themes/theme/layout/partials/post_list.ejs new file mode 100644 index 00000000..df3e8f2e --- /dev/null +++ b/themes/theme/layout/partials/post_list.ejs @@ -0,0 +1,29 @@ +
+ <% var last_year = ''; %> + <% page.posts.each(function (post) { %> + + <% var cur_year = post.date.year(); %> + + <% if(last_year !== cur_year){ %> +
<%- cur_year %>
+ <% last_year = cur_year; } %> + +
+
+ + <% if (post.title) {%> + <%= post.title %> + <% } else {%> + *Untitled + <% } %> + +
+ + +
+ + <% }) %> +
+ <%- partial('partials/paginator') %> +
+
diff --git a/themes/theme/layout/partials/tag_cloud.ejs b/themes/theme/layout/partials/tag_cloud.ejs new file mode 100644 index 00000000..75d8eef2 --- /dev/null +++ b/themes/theme/layout/partials/tag_cloud.ejs @@ -0,0 +1,11 @@ +
+
+ <%site.tags.forEach(tag=>{%> + + <%})%> +
+
\ No newline at end of file diff --git a/themes/theme/layout/post.ejs b/themes/theme/layout/post.ejs new file mode 100644 index 00000000..00475498 --- /dev/null +++ b/themes/theme/layout/post.ejs @@ -0,0 +1,14 @@ +
+ + <% if (is_post()) {%> + <%- partial('post/post_head') %> + <%- partial('post/post_content') %> + <%- partial('post/post_footer') %> + <% if (!page.hide_comment) {%> + <%- partial('post/post_comment') %> + <% } %> + <%} else {%> + <%- partial('pages/page_head') %> + <%- partial('post/post_content') %> + <%} %> +
\ No newline at end of file diff --git a/themes/theme/layout/post/post_comment.ejs b/themes/theme/layout/post/post_comment.ejs new file mode 100644 index 00000000..60a76fb4 --- /dev/null +++ b/themes/theme/layout/post/post_comment.ejs @@ -0,0 +1,48 @@ +
+ + <% if (theme.valine.enable) {%> +
+ + <% } %> + + <% if (theme.disqus.enable) {%> +
+ + + <% } %> + + + +
\ No newline at end of file diff --git a/themes/theme/layout/post/post_content.ejs b/themes/theme/layout/post/post_content.ejs new file mode 100644 index 00000000..e51bc059 --- /dev/null +++ b/themes/theme/layout/post/post_content.ejs @@ -0,0 +1,7 @@ +
+ <%-page.content%> +
+ + \ No newline at end of file diff --git a/themes/theme/layout/post/post_footer.ejs b/themes/theme/layout/post/post_footer.ejs new file mode 100644 index 00000000..c4978890 --- /dev/null +++ b/themes/theme/layout/post/post_footer.ejs @@ -0,0 +1,21 @@ +
+
+ +
diff --git a/themes/theme/layout/post/post_head.ejs b/themes/theme/layout/post/post_head.ejs new file mode 100644 index 00000000..ad821406 --- /dev/null +++ b/themes/theme/layout/post/post_head.ejs @@ -0,0 +1,34 @@ +
+ +
+ <% if (page.featured_image) {%> + featured_image + <% } else { %> +
+ <% } %> +
+
\ No newline at end of file diff --git a/themes/theme/layout/search.ejs b/themes/theme/layout/search.ejs new file mode 100644 index 00000000..ed7ba50e --- /dev/null +++ b/themes/theme/layout/search.ejs @@ -0,0 +1,21 @@ + + + + <%- partial('partials/head') %> + + +
+ <%- partial('partials/header') %> + +
+
+ <%- body %> +
+
+ + <%- partial('partials/footer') %> +
+ + + + diff --git a/themes/theme/layout/tag.ejs b/themes/theme/layout/tag.ejs new file mode 100644 index 00000000..045cc160 --- /dev/null +++ b/themes/theme/layout/tag.ejs @@ -0,0 +1,17 @@ +
+ <% if(is_tag()){ %> + +

+ / tags + / <%=page.tag%> / +

+ <%- partial('partials/post_list') %> + + <% }else{ %> + +

/ tags /

+ <%- partial('partials/tag_cloud') %> + + <% } %> + +
\ No newline at end of file diff --git a/themes/theme/source/css/animation.styl b/themes/theme/source/css/animation.styl new file mode 100644 index 00000000..ef22c6f9 --- /dev/null +++ b/themes/theme/source/css/animation.styl @@ -0,0 +1,14 @@ +@keyframes fadeIn + from + opacity 0 + to + opacity 1 + +.fade-in + animation fadeIn 0.6s ease + +.post-list-item, .post-gallery-item + transition opacity $transition-duration ease + + &:hover + opacity 0.85 \ No newline at end of file diff --git a/themes/theme/source/css/base.styl b/themes/theme/source/css/base.styl new file mode 100644 index 00000000..02dc0bb7 --- /dev/null +++ b/themes/theme/source/css/base.styl @@ -0,0 +1,38 @@ +div + display block + padding 0 + margin 0 + +ul + list-style none + padding 0 + margin 0 + +*, *::before, *::after + box-sizing border-box + +a + text-decoration: none + color: $color-text-primary + +input + outline none + border none + +body + text-style(body-default) + background-color $color-background + +/* clears the 'X' from Internet Explorer */ +input[type=search]::-ms-clear + display none + width 0 + height 0 +input[type=search]::-ms-reveal + display none + width 0 + height 0 + +/* clears the 'X' from Chrome */ +input[type="search"]::-webkit-search-decoration, input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-results-button, input[type="search"]::-webkit-search-results-decoration + display: none diff --git a/themes/theme/source/css/color.styl b/themes/theme/source/css/color.styl new file mode 100644 index 00000000..c7cf2c25 --- /dev/null +++ b/themes/theme/source/css/color.styl @@ -0,0 +1,10 @@ +$color_path = 'color_mode/default.styl' + +if hexo-config("color_mode") == 'default' + $color_path = 'color_mode/default.styl' +else if hexo-config("color_mode") == 'dark' + $color_path = 'color_mode/dark.styl' +else if hexo-config("color_mode") == 'classic' + $color_path = 'color_mode/classic.styl' + +@import $color_path diff --git a/themes/theme/source/css/color_mode/classic.styl b/themes/theme/source/css/color_mode/classic.styl new file mode 100644 index 00000000..cd3f6413 --- /dev/null +++ b/themes/theme/source/css/color_mode/classic.styl @@ -0,0 +1,19 @@ +$color-text-primary = #1C1917 +$color-text-secondary = #78716C +$color-text-third = #A8A29E +$color-text-fourth = #E7E5E4 +$color-background = #FFFBEB + +$color-accent = #2563EB +$color-border = #E7E5E4 + +$color-code-background = #FEF3C7 +$color-code-highlight = #2563EB +$color-code-default = #57534E +$color-code-marker = #A8A29E + +$color-search-marker = #FDE68A +$color-overlay = rgba(0, 0, 0, 0.4) +$color-glass = rgba(255, 251, 235, 0.85) + +@import "../highlight/github.styl" \ No newline at end of file diff --git a/themes/theme/source/css/color_mode/dark.styl b/themes/theme/source/css/color_mode/dark.styl new file mode 100644 index 00000000..67a9aaa6 --- /dev/null +++ b/themes/theme/source/css/color_mode/dark.styl @@ -0,0 +1,20 @@ +// COLOR +$color-text-primary = #FAFAFA +$color-text-secondary = #A1A1AA +$color-text-third = #71717A +$color-text-fourth = #3F3F46 +$color-background = #18181B + +$color-accent = #3B82F6 +$color-border = #3F3F46 + +$color-code-background = #27272A +$color-code-highlight = #3B82F6 +$color-code-default = #D4D4D8 +$color-code-marker = #71717A + +$color-search-marker = #854D0E +$color-overlay = rgba(0, 0, 0, 0.6) +$color-glass = rgba(24, 24, 27, 0.85) + +@import "../highlight/github-gist.styl" \ No newline at end of file diff --git a/themes/theme/source/css/color_mode/default.styl b/themes/theme/source/css/color_mode/default.styl new file mode 100644 index 00000000..15f8a292 --- /dev/null +++ b/themes/theme/source/css/color_mode/default.styl @@ -0,0 +1,20 @@ +// COLOR +$color-text-primary = #09090B +$color-text-secondary = #71717A +$color-text-third = #A1A1AA +$color-text-fourth = #E4E4E7 +$color-background = #FFFFFF + +$color-accent = #2563EB +$color-border = #E4E4E7 + +$color-code-background = #F4F4F5 +$color-code-highlight = #2563EB +$color-code-default = #52525B +$color-code-marker = #A1A1AA + +$color-search-marker = #FDE68A +$color-overlay = rgba(0, 0, 0, 0.4) +$color-glass = rgba(255, 255, 255, 0.92) + +@import "../highlight/github.styl" \ No newline at end of file diff --git a/themes/theme/source/css/component/button.styl b/themes/theme/source/css/component/button.styl new file mode 100644 index 00000000..6c6520db --- /dev/null +++ b/themes/theme/source/css/component/button.styl @@ -0,0 +1,64 @@ +.btn + display inline-flex + align-items center + justify-content center + white-space nowrap + border-radius $margin-m-2 + font-size $font-size-header + font-weight 400 + transition all $transition-duration ease + cursor pointer + border none + text-decoration none + user-select none + outline none + padding $margin-m-0 $margin-l-0 + + &:focus-visible + outline 2px solid $color-accent + outline-offset 2px + + &:disabled + pointer-events none + opacity 0.5 + +.btn-default + background-color $color-text-primary + color $color-background + + &:hover + opacity 0.9 + + &:active + opacity 0.95 + +.btn-outline + border 1px solid $color-border + background-color transparent + color $color-text-primary + + &:hover + border-color $color-accent + color $color-accent + +.btn-ghost + background-color transparent + color $color-text-primary + + &:hover + background-color $color-text-fourth + +.btn-link + background-color transparent + color $color-accent + text-decoration underline + text-underline-offset 4px + + &:hover + text-decoration none + +@keyframes spin + 0% + transform rotate(0deg) + 100% + transform rotate(360deg) \ No newline at end of file diff --git a/themes/theme/source/css/component/component.styl b/themes/theme/source/css/component/component.styl new file mode 100644 index 00000000..b203aecc --- /dev/null +++ b/themes/theme/source/css/component/component.styl @@ -0,0 +1,44 @@ +.h-line-primary + background-color $color-text-primary + height $line-third + +.h-line-secondary + background-color $color-border + height $line-third + +hr + background-color $color-border + height $line-third + border 0 + +.tag-list + display flex + flex-wrap wrap + margin-bottom $margin-m-0 + +.tag-title + margin $margin-m-1 0 + color $color-text-secondary + font-size $font-size-header + + a + color @color + +.post-tag + text-style(post-tag) + border 1px solid $color-border + margin-right $margin-s-2 + margin-bottom $margin-s-2 + padding $margin-s-2 $margin-m-0 $margin-s-2 $margin-m-0 + border-radius $margin-m-2 + transition all $transition-duration ease + + a + background-image none!important + + &:hover + border-color $color-accent + background-color $color-accent + + a + color #fff diff --git a/themes/theme/source/css/component/icon.styl b/themes/theme/source/css/component/icon.styl new file mode 100644 index 00000000..8a6c0511 --- /dev/null +++ b/themes/theme/source/css/component/icon.styl @@ -0,0 +1,21 @@ +.icon + display block + background-color $color-text-primary + width $icon-size + height $icon-size + +.arrow-up + -webkit-mask-image url('../icon/arrow-up.svg') + mask-image url('../icon/arrow-up.svg') + +.arrow-left + -webkit-mask-image url('../icon/arrow-left.svg') + mask-image url('../icon/arrow-left.svg') + +.arrow-right + -webkit-mask-image url('../icon/arrow-right.svg') + mask-image url('../icon/arrow-right.svg') + +.close-btn + -webkit-mask-image url('../icon/close-btn.svg') + mask-image url('../icon/close-btn.svg') \ No newline at end of file diff --git a/themes/theme/source/css/font-slices.styl b/themes/theme/source/css/font-slices.styl new file mode 100644 index 00000000..97b9b47b --- /dev/null +++ b/themes/theme/source/css/font-slices.styl @@ -0,0 +1,47 @@ +// FONT SLICES - GoogleSansCode 分段字体定义 +// 自动生成,包含 5 个 Unicode 范围切片 + +// Latin 基础字符集(ASCII + 基本拉丁 + 常用标点) +@font-face + font-family 'GoogleSansCode' + font-style normal + font-weight 400 + font-display swap + src url('/fonts/latin-base.woff2') format('woff2') + unicode-range U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F + +// Latin 扩展(拉丁扩展 A/B + 货币符号 + 特殊字符) +@font-face + font-family 'GoogleSansCode' + font-style normal + font-weight 400 + font-display swap + src url('/fonts/latin-ext.woff2') format('woff2') + unicode-range U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF + +// CJK 常用汉字(约 3500 字,覆盖 99% 中文内容) +@font-face + font-family 'GoogleSansCode' + font-style normal + font-weight 400 + font-display swap + src url('/fonts/cjk-common.woff2') format('woff2') + unicode-range U+4E00-62FF + +// CJK 扩展汉字(次常用汉字 + 扩展 A) +@font-face + font-family 'GoogleSansCode' + font-style normal + font-weight 400 + font-display swap + src url('/fonts/cjk-ext.woff2') format('woff2') + unicode-range U+6300-9FFF, U+3400-4DBF + +// 符号(CJK 标点 + 全角字符) +@font-face + font-family 'GoogleSansCode' + font-style normal + font-weight 400 + font-display swap + src url('/fonts/symbols.woff2') format('woff2') + unicode-range U+3000-303F, U+FF00-FFEF diff --git a/themes/theme/source/css/font.styl b/themes/theme/source/css/font.styl new file mode 100644 index 00000000..4ca10b78 --- /dev/null +++ b/themes/theme/source/css/font.styl @@ -0,0 +1,105 @@ +text-style(n) + font-family $font-family + font-weight 400 + + if n == 'body-default' + font-size $font-size-body + line-height $line-height-body + color $color-text-primary + + else if n == 'body-bold' + font-size $font-size-body + line-height $line-height-body + color $color-text-primary + + else if n == 'body-italic' + font-size $font-size-body + font-style italic + line-height $line-height-body + color $color-text-primary + + else if n == 'body-delete' + font-size $font-size-body + line-height $line-height-body + text-decoration line-through + color $color-text-primary + + else if n == 'code-default' + font-family $font-family + font-size $font-size-code + line-height $line-height-code + color $color-code-default + + else if n == 'code-highlight' + font-family $font-family + font-size $font-size-code + line-height $line-height-code + color $color-code-highlight + + else if n == 'code-marker' + font-family $font-family + font-size $font-size-code + line-height $line-height-code + color $color-code-marker + + else if n == 'heading-h1' + font-size $font-size-heading-h1 + line-height $line-height-heading-h1 + color $color-text-primary + + else if n == 'heading-h2' + font-size $font-size-heading-h2 + line-height $line-height-heading-h2 + color $color-text-primary + + else if n == 'heading-h3' + font-size $font-size-heading-h3 + line-height $line-height-heading-h3 + color $color-text-primary + + else if n == 'heading-h4' + font-size $font-size-heading-h4 + line-height $line-height-heading-h4 + color $color-text-primary + + else if n == 'heading-h5' + font-size $font-size-heading-h5 + line-height $line-height-heading-h5 + color $color-text-primary + + else if n == 'heading-h6' + font-size $font-size-heading-h6 + line-height $line-height-heading-h6 + color $color-text-primary + + else if n == 'footer' + font-size $font-size-footer + line-height $line-height-footer + color $color-text-secondary + + else if n == 'header' + font-size $font-size-header + line-height $line-height-header + color $color-text-primary + + else if n == 'post-date' + font-size $font-size-post-date + line-height $line-height-post-date + color $color-text-secondary + + else if n == 'year-title' + font-size $font-size-year-title + line-height $line-height-year-title + color $color-text-third + + else if n == 'post-tag' + font-size $font-size-post-tag + line-height $line-height-post-tag + color $color-text-secondary + + else if n == 'search-result-message' + font-family $font-family + font-size $font-size-code + line-height $line-height-code + color $color-text-third + text-transform lowercase diff --git a/themes/theme/source/css/highlight/ascetic.styl b/themes/theme/source/css/highlight/ascetic.styl new file mode 100644 index 00000000..19d1eff3 --- /dev/null +++ b/themes/theme/source/css/highlight/ascetic.styl @@ -0,0 +1,37 @@ +/* + +Original style from softwaremaniacs.org (c) Ivan Sagalaev + +*/ + +.highlight + color: black + background: white + .code + .string, + .variable, + .template-variable, + .symbol, + .bullet, + .section, + .addition, + .attribute, + .link + color: #888 + + .comment, + .quote, + .meta, + .deletion + color: #ccc + + .keyword, + .selector-tag, + .section, + .name, + .type, + .strong + font-weight: normal + + .emphasis + font-style: italic diff --git a/themes/theme/source/css/highlight/brown-paper.styl b/themes/theme/source/css/highlight/brown-paper.styl new file mode 100644 index 00000000..a81bd2d7 --- /dev/null +++ b/themes/theme/source/css/highlight/brown-paper.styl @@ -0,0 +1,55 @@ +/* + +Brown Paper style from goldblog.com.ua (c) Zaripov Yura + +*/ + +.highlight + color: #363c69 + background:#b7a68e url(brown-papersq.png) + .code + .keyword, + .selector-tag, + .literal + color:#005599 + font-weight:normal + + .highlight, + .subst + color: #363c69 + + .string, + .title, + .section, + .type, + .attribute, + .symbol, + .bullet, + .built_in, + .addition, + .variable, + .template-tag, + .template-variable, + .link, + .name + color: #2c009f + + .comment, + .quote, + .meta, + .deletion + color: #802022 + + .keyword, + .selector-tag, + .literal, + .doctag, + .title, + .section, + .type, + .name, + .strong + font-weight: normal + + .emphasis + font-style: italic diff --git a/themes/theme/source/css/highlight/dark.styl b/themes/theme/source/css/highlight/dark.styl new file mode 100644 index 00000000..1cdbc9b0 --- /dev/null +++ b/themes/theme/source/css/highlight/dark.styl @@ -0,0 +1,27 @@ +/* + + Dark style from softwaremaniacs.org (c) Ivan Sagalaev + +*/ +.highlight + background: #444 + color: #ddd + + .code + .keyword, .selector-tag, .literal, .section, .link + color: white + + .subst + color: #ddd + + .string, .title, .name, .type, .attribute, .symbol, .bullet, .built_in, .addition, .variable, .template-tag, .template-variable + color: #d88 + + .comment, .quote, .deletion, .meta + color: #777 + + .keyword, .selector-tag, .literal, .title, .section, .doctag, .type, .name, .strong + font-weight: normal + + .emphasis + font-style: italic diff --git a/themes/theme/source/css/highlight/darkula.styl b/themes/theme/source/css/highlight/darkula.styl new file mode 100644 index 00000000..0295887d --- /dev/null +++ b/themes/theme/source/css/highlight/darkula.styl @@ -0,0 +1,33 @@ +/* + + Darkula color scheme from the JetBrains family of IDEs + +*/ +.highlight + background: #2b2b2b + color: #bababa + + .code + .strong, .emphasis + color: #a8a8a2 + + .bullet, .quote, .link, .number, .regexp, .literal + color: #6896ba + + .code, .selector-class + color: #a6e22e + + .emphasis + font-style: italic + + .keyword, .selector-tag, .section, .attribute, .name, .variable + color: #cb7832 + + .params + color: #b9b9b9 + + .string, .subst, .type, .built_in, .builtin-name, .symbol, .selector-id, .selector-attr, .selector-pseudo, .template-tag, .template-variable, .addition + color: #e0c46c + + .comment, .deletion, .meta + color: #7f7f7f diff --git a/themes/theme/source/css/highlight/foundation.styl b/themes/theme/source/css/highlight/foundation.styl new file mode 100644 index 00000000..8c52a5ae --- /dev/null +++ b/themes/theme/source/css/highlight/foundation.styl @@ -0,0 +1,71 @@ +/* +Description: Foundation 4 docs style for highlight.js +Author: Dan Allen +Website: http://foundation.zurb.com/docs/ +Version: 1.0 +Date: 2013-04-02 +*/ + +.highlight + color: black + background: #eee + .code + .link, + .emphasis, + .attribute, + .addition + color: #070 + + .emphasis + font-style: italic + + .strong, + .string, + .deletion + color: #d14 + + .strong + font-weight: normal + + .quote, + .comment + color: #998 + font-style: italic + + .section, + .title + color: #900 + + .class .title, + .type + color: #458 + + .variable, + .template-variable + color: #336699 + + .bullet + color: #997700 + + .meta + color: #3344bb + + .code, + .number, + .literal, + .keyword, + .selector-tag + color: #099 + + .regexp + background-color: #fff0ff + color: #880088 + + .symbol + color: #990073 + + .tag, + .name, + .selector-id, + .selector-class + color: #007700 diff --git a/themes/theme/source/css/highlight/github-gist.styl b/themes/theme/source/css/highlight/github-gist.styl new file mode 100644 index 00000000..e3a81ce3 --- /dev/null +++ b/themes/theme/source/css/highlight/github-gist.styl @@ -0,0 +1,57 @@ +/** + * GitHub Gist Theme + * Author : Louis Barranqueiro - https://github.com/LouisBarranqueiro + */ + +.highlight + padding: 0.5em + color: #333333 + .code + .comment, + .meta + color: #969896 + + .string, + .variable, + .template-variable, + .strong, + .emphasis, + .quote + color: #df5000 + + .keyword, + .selector-tag, + .type + color: #a71d5d + + .literal, + .symbol, + .bullet, + .attribute + color: #0086b3 + + .section, + .name + color: #63a35c + + .tag + color: #333333 + + .title, + .attr, + .selector-id, + .selector-class, + .selector-attr, + .selector-pseudo + color: #795da3 + + .addition + color: #55a532 + background-color: #eaffea + + .deletion + color: #bd2c00 + background-color: #ffecec + + .link + text-decoration: underline diff --git a/themes/theme/source/css/highlight/github.styl b/themes/theme/source/css/highlight/github.styl new file mode 100644 index 00000000..f06484fd --- /dev/null +++ b/themes/theme/source/css/highlight/github.styl @@ -0,0 +1,79 @@ +/* + +github.com style (c) Vasily Polovnyov + +*/ + +.highlight + color: #333 + background: #f8f8f8 + .code + .comment, + .quote + color: #998 + font-style: italic + + .keyword, + .selector-tag, + .subst + color: #333 + font-weight: normal + + .number, + .literal, + .variable, + .template-variable, + .tag .attr + color: #008080 + + .string, + .doctag + color: #d14 + + .title, + .section, + .selector-id + color: #900 + font-weight: normal + + .subst + font-weight: normal + + .type, + .class .title + color: #458 + font-weight: normal + + .tag, + .name, + .attribute + color: #000080 + font-weight: normal + + .regexp, + .link + color: #009926 + + .symbol, + .bullet + color: #990073 + + .built_in, + .builtin-name + color: #0086b3 + + .meta + color: #999 + font-weight: normal + + .deletion + background: #fdd + + .addition + background: #dfd + + .emphasis + font-style: italic + + .strong + font-weight: normal diff --git a/themes/theme/source/css/highlight/googlecode.styl b/themes/theme/source/css/highlight/googlecode.styl new file mode 100644 index 00000000..c25bb01c --- /dev/null +++ b/themes/theme/source/css/highlight/googlecode.styl @@ -0,0 +1,72 @@ +/* + +Google Code style (c) Aahan Krish + +*/ + +.highlight + color: black + background: white + .code + .comment, + .quote + color: #800 + + .keyword, + .selector-tag, + .section, + .title, + .name + color: #008 + + .variable, + .template-variable + color: #660 + + .string, + .selector-attr, + .selector-pseudo, + .regexp + color: #080 + + .literal, + .symbol, + .bullet, + .meta, + .number, + .link + color: #066 + + .title, + .doctag, + .type, + .attr, + .built_in, + .builtin-name, + .params + color: #606 + + .attribute, + .subst + color: #000 + + .formula + background-color: #eee + font-style: italic + + .selector-id, + .selector-class + color: #9B703F + + .addition + background-color: #baeeba + + .deletion + background-color: #ffc8bd + + .doctag, + .strong + font-weight: normal + + .emphasis + font-style: italic diff --git a/themes/theme/source/css/highlight/idea.styl b/themes/theme/source/css/highlight/idea.styl new file mode 100644 index 00000000..cc009c4a --- /dev/null +++ b/themes/theme/source/css/highlight/idea.styl @@ -0,0 +1,78 @@ +/* + +Intellij Idea-like styling (c) Vasily Polovnyov + +*/ + +.highlight + color: #000 + background: #fff + .code + .subst, + .title + font-weight: normal + color: #000 + + .comment, + .quote + color: #808080 + font-style: italic + + .meta + color: #808000 + + .tag + background: #efefef + + .section, + .name, + .literal, + .keyword, + .selector-tag, + .type, + .selector-id, + .selector-class + font-weight: normal + color: #000080 + + .attribute, + .number, + .regexp, + .link + font-weight: normal + color: #0000ff + + .number, + .regexp, + .link + font-weight: normal + + .string + color: #008000 + font-weight: normal + + .symbol, + .bullet, + .formula + color: #000 + background: #d0eded + font-style: italic + + .doctag + text-decoration: underline + + .variable, + .template-variable + color: #660e7a + + .addition + background: #baeeba + + .deletion + background: #ffc8bd + + .emphasis + font-style: italic + + .strong + font-weight: normal diff --git a/themes/theme/source/css/highlight/rainbow.styl b/themes/theme/source/css/highlight/rainbow.styl new file mode 100644 index 00000000..88930970 --- /dev/null +++ b/themes/theme/source/css/highlight/rainbow.styl @@ -0,0 +1,46 @@ +/* + + Style with support for rainbow parens + +*/ +.highlight + background: #474949 + color: #d1d9e1 + + .code + .comment, .quote + color: #969896 + font-style: italic + + .keyword, .selector-tag, .literal, .type, .addition + color: #cc99cc + + .number, .selector-attr, .selector-pseudo + color: #f99157 + + .string, .doctag, .regexp + color: #8abeb7 + + .title, .name, .section, .built_in + color: #b5bd68 + + .variable, .template-variable, .selector-id, .class .title + color: #ffcc66 + + .section, .name, .strong + font-weight: normal + + .symbol, .bullet, .subst, .meta, .link + color: #f99157 + + .deletion + color: #dc322f + + .formula + background: #eee8d5 + + .attr, .attribute + color: #81a2be + + .emphasis + font-style: italic diff --git a/themes/theme/source/css/highlight/school-book.styl b/themes/theme/source/css/highlight/school-book.styl new file mode 100644 index 00000000..eebfa821 --- /dev/null +++ b/themes/theme/source/css/highlight/school-book.styl @@ -0,0 +1,57 @@ +/* + +School Book style from goldblog.com.ua (c) Zaripov Yura + +*/ + +.highlight + background:#f6f6ae url(school-book.png) + border-top: solid 2px #d2e8b9 + border-bottom: solid 1px #d2e8b9 + .code + .keyword, + .selector-tag, + .literal + color:#005599 + font-weight:normal + + .highlight, + .subst + color: #3e5915 + + .string, + .title, + .section, + .type, + .symbol, + .bullet, + .attribute, + .built_in, + .builtin-name, + .addition, + .variable, + .template-tag, + .template-variable, + .link + color: #2c009f + + .comment, + .quote, + .deletion, + .meta + color: #e60415 + + .keyword, + .selector-tag, + .literal, + .doctag, + .title, + .section, + .type, + .name, + .selector-id, + .strong + font-weight: normal + + .emphasis + font-style: italic diff --git a/themes/theme/source/css/highlight/solarized-dark.styl b/themes/theme/source/css/highlight/solarized-dark.styl new file mode 100644 index 00000000..a4b3ff4a --- /dev/null +++ b/themes/theme/source/css/highlight/solarized-dark.styl @@ -0,0 +1,45 @@ +/* + + Orginal Style from ethanschoonover.com/solarized (c) Jeremy Hull + +*/ +.highlight + background: #002b36 + color: #839496 + + .code + .comment, .quote + color: #586e75 + + /* Solarized Green */ + .keyword, .selector-tag, .addition + color: #859900 + + /* Solarized Cyan */ + .number, .string, .meta .meta-string, .literal, .doctag, .regexp + color: #2aa198 + + /* Solarized Blue */ + .title, .section, .name, .selector-id, .selector-class + color: #268bd2 + + /* Solarized Yellow */ + .attribute, .attr, .variable, .template-variable, .class .title, .type + color: #b58900 + + /* Solarized Orange */ + .symbol, .bullet, .subst, .meta, .meta .keyword, .selector-attr, .selector-pseudo, .link + color: #cb4b16 + + /* Solarized Red */ + .built_in, .deletion + color: #dc322f + + .formula + background: #073642 + + .emphasis + font-style: italic + + .strong + font-weight: normal diff --git a/themes/theme/source/css/highlight/solarized-light.styl b/themes/theme/source/css/highlight/solarized-light.styl new file mode 100644 index 00000000..3b8abdad --- /dev/null +++ b/themes/theme/source/css/highlight/solarized-light.styl @@ -0,0 +1,71 @@ +/* + +Orginal Style from ethanschoonover.com/solarized (c) Jeremy Hull + +*/ + +.highlight + color: #657b83 + table + background: #fdf6e3 + .code + .comment, + .quote + color: #93a1a1 + + /* Solarized Green */ + .keyword, + .selector-tag, + .addition + color: #859900 + + /* Solarized Cyan */ + .number, + .string, + .meta .meta-string, + .literal, + .doctag, + .regexp + color: #2aa198 + + /* Solarized Blue */ + .title, + .section, + .name, + .selector-id, + .selector-class + color: #268bd2 + + /* Solarized Yellow */ + .attribute, + .attr, + .variable, + .template-variable, + .class .title, + .type + color: #b58900 + + /* Solarized Orange */ + .symbol, + .bullet, + .subst, + .meta, + .meta .keyword, + .selector-attr, + .selector-pseudo, + .link + color: #cb4b16 + + /* Solarized Red */ + .built_in, + .deletion + color: #dc322f + + .formula + background: #eee8d5 + + .emphasis + font-style: italic + + .strong + font-weight: normal diff --git a/themes/theme/source/css/highlight/tomorrow.styl b/themes/theme/source/css/highlight/tomorrow.styl new file mode 100644 index 00000000..f83057aa --- /dev/null +++ b/themes/theme/source/css/highlight/tomorrow.styl @@ -0,0 +1,56 @@ +.highlight + color: #4d4d4c + background: white + .code + /* Tomorrow Comment */ + .comment, + .quote + color: #8e908c + + /* Tomorrow Red */ + .variable, + .template-variable, + .tag, + .name, + .selector-id, + .selector-class, + .regexp, + .deletion + color: #c82829 + + /* Tomorrow Orange */ + .number, + .built_in, + .builtin-name, + .literal, + .type, + .params, + .meta, + .link + color: #f5871f + + /* Tomorrow Yellow */ + .attribute + color: #eab700 + + /* Tomorrow Green */ + .string, + .symbol, + .bullet, + .addition + color: #718c00 + + /* Tomorrow Blue */ + .title, + .section + color: #4271ae + + /* Tomorrow Purple */ + .keyword, + .selector-tag + color: #8959a8 + .emphasis + font-style: italic + + .strong + font-weight: normal \ No newline at end of file diff --git a/themes/theme/source/css/highlight/vs.styl b/themes/theme/source/css/highlight/vs.styl new file mode 100644 index 00000000..940ec690 --- /dev/null +++ b/themes/theme/source/css/highlight/vs.styl @@ -0,0 +1,58 @@ +/* + +Visual Studio-like style based on original C# coloring by Jason Diamond + +*/ +.highlight + display: block + overflow-x: auto + padding: 0.5em + background: white + color: black + .code + .comment, + .quote, + .variable + color: #008000 + + .keyword, + .selector-tag, + .built_in, + .name, + .tag + color: #00f + + .string, + .title, + .section, + .attribute, + .literal, + .template-tag, + .template-variable, + .type, + .addition + color: #a31515 + + .deletion, + .selector-attr, + .selector-pseudo, + .meta + color: #2b91af + + .doctag + color: #808080 + + .attr + color: #f00 + + .symbol, + .bullet, + .link + color: #00b0e8 + + + .emphasis + font-style: italic + + .strong + font-weight: normal diff --git a/themes/theme/source/css/highlight/xcode.styl b/themes/theme/source/css/highlight/xcode.styl new file mode 100644 index 00000000..94290cd7 --- /dev/null +++ b/themes/theme/source/css/highlight/xcode.styl @@ -0,0 +1,74 @@ +/* + +XCode style (c) Angel Garcia + +*/ + +.highlight + color: black + background: #fff + .code + .comment, + .quote + color: #006a00 + + .keyword, + .selector-tag, + .literal + color: #aa0d91 + + .name + color: #008 + + .variable, + .template-variable + color: #660 + + .string + color: #c41a16 + + .regexp, + .link + color: #080 + + .title, + .tag, + .symbol, + .bullet, + .number, + .meta + color: #1c00cf + + .section, + .class .title, + .type, + .attr, + .built_in, + .builtin-name, + .params + color: #5c2699 + + .attribute, + .subst + color: #000 + + .formula + background-color: #eee + font-style: italic + + .addition + background-color: #baeeba + + .deletion + background-color: #ffc8bd + + .selector-id, + .selector-class + color: #9b703f + + .doctag, + .strong + font-weight: normal + + .emphasis + font-style: italic diff --git a/themes/theme/source/css/highlight/zenburn.styl b/themes/theme/source/css/highlight/zenburn.styl new file mode 100644 index 00000000..941cd1f4 --- /dev/null +++ b/themes/theme/source/css/highlight/zenburn.styl @@ -0,0 +1,46 @@ +/* + + Zenburn style from voldmar.ru (c) Vladimir Epifanov + based on dark.css by Ivan Sagalaev + +*/ +.highlight + background: #3f3f3f + color: #dcdcdc + + .code + .keyword, .selector-tag, .tag + color: #e3ceab + + .template-tag + color: #dcdcdc + + .number + color: #8cd0d3 + + .variable, .template-variable, .attribute + color: #efdcbc + + .literal + color: #efefaf + + .subst + color: #8f8f8f + + .title, .name, .selector-id, .selector-class, .section, .type + color: #efef8f + + .symbol, .bullet, .link + color: #dca3a3 + + .deletion, .string, .built_in, .builtin-name + color: #cc9393 + + .addition, .comment, .quote, .meta + color: #7f9f7f + + .emphasis + font-style: italic + + .strong + font-weight: normal diff --git a/themes/theme/source/css/layout.styl b/themes/theme/source/css/layout.styl new file mode 100644 index 00000000..9da0e03d --- /dev/null +++ b/themes/theme/source/css/layout.styl @@ -0,0 +1,13 @@ +body + margin 0 + +.wrapper + display flex + flex-direction column + min-height 100vh + padding-top $header-height + +.main + flex-grow 1 + margin 0 + padding 0 \ No newline at end of file diff --git a/themes/theme/source/css/media.styl b/themes/theme/source/css/media.styl new file mode 100644 index 00000000..c0bd3879 --- /dev/null +++ b/themes/theme/source/css/media.styl @@ -0,0 +1,28 @@ +.flex-container + width 720px + margin 0 auto + +html + font-size 18px + +@media (max-width: 1600px) + html + font-size 18px + .flex-container + width 720px + +@media (max-width: 1200px) + html + font-size 18px + .flex-container + width 640px + +@media (max-width: 688px) + html + font-size 16px + + .flex-container + display block + width calc(100% - 32px) + padding-left 16px + padding-right 16px diff --git a/themes/theme/source/css/motion.styl b/themes/theme/source/css/motion.styl new file mode 100644 index 00000000..c6599e1f --- /dev/null +++ b/themes/theme/source/css/motion.styl @@ -0,0 +1,34 @@ +underline-motion(n) + if n == 'link' + background-image linear-gradient($color-background, $color-background), linear-gradient($color-accent, $color-accent) + background-size 100% $line-third, 0% $line-third + background-position 100% 100%, 0 100% + background-repeat no-repeat, no-repeat + transition background-size $transition-duration ease + + &:hover + background-size 0 $line-third, 100% $line-third + + else if n == 'underline-link' + padding-bottom $line-secondary + background-image linear-gradient($color-text-primary, $color-text-primary), linear-gradient($color-accent, $color-accent) + background-size 100% $line-third, 0 $line-secondary + background-position 100% 100%, 0 100% + background-repeat no-repeat, no-repeat + transition background-size $transition-duration ease + + &:hover + background-size 100% $line-third, 100% $line-secondary + + else if n == 'header' + &:after + content "" + transition width $transition-duration ease + position absolute + left 0 + bottom 0 + width 0 + border-bottom solid $line-third $color-accent + + &:hover:after + width 100% \ No newline at end of file diff --git a/themes/theme/source/css/normalize.styl b/themes/theme/source/css/normalize.styl new file mode 100644 index 00000000..a4d01c37 --- /dev/null +++ b/themes/theme/source/css/normalize.styl @@ -0,0 +1,308 @@ +/*! normalize.css v8.0.0 | MIT License | github.com/necolas/normalize.css */ + +/* Document + ========================================================================== */ + +/** + * 1. Correct the line height in all browsers. + * 2. Prevent adjustments of font size after orientation changes in iOS. + */ + +html + line-height 1.15 /* 1 */ + -webkit-text-size-adjust 100% /* 2 */ + +/* Sections + ========================================================================== */ + +/** + * Remove the margin in all browsers. + */ + +body + margin 0 + +/** + * Correct the font size and margin on `h1` elements within `section` and + * `article` contexts in Chrome, Firefox, and Safari. + */ + +h1 + font-size 2em + margin 0.67em 0 + +/* Grouping content + ========================================================================== */ + +/** + * 1. Add the correct box sizing in Firefox. + * 2. Show the overflow in Edge and IE. + */ + +hr + box-sizing content-box /* 1 */ + height 0 /* 1 */ + overflow visible /* 2 */ + +/** + * 1. Correct the inheritance and scaling of font size in all browsers. + * 2. Correct the odd `em` font sizing in all browsers. + */ + +pre + font-family monospace, monospace /* 1 */ + font-size 1em /* 2 */ + +/* Text-level semantics + ========================================================================== */ + +/** + * Remove the gray background on active links in IE 10. + */ + +a + background-color transparent + +/** + * 1. Remove the bottom border in Chrome 57- + * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari. + */ + +abbr[title] + border-bottom none /* 1 */ + text-decoration underline /* 2 */ + text-decoration underline dotted /* 2 */ + +/** + * Add the correct font weight in Chrome, Edge, and Safari. + */ + +b, +strong + font-weight 400 + +/** + * 1. Correct the inheritance and scaling of font size in all browsers. + * 2. Correct the odd `em` font sizing in all browsers. + */ + +code, +kbd, +samp + font-family monospace, monospace /* 1 */ + font-size 1em /* 2 */ + +/** + * Add the correct font size in all browsers. + */ + +small + font-size 80% + +/** + * Prevent `sub` and `sup` elements from affecting the line height in + * all browsers. + */ + +sub, +sup + font-size 75% + line-height 0 + position relative + vertical-align baseline + +sub + bottom -0.25em + +sup + top -0.5em + +/* Embedded content + ========================================================================== */ + +/** + * Remove the border on images inside links in IE 10. + */ + +img + border-style none + +/* Forms + ========================================================================== */ + +/** + * 1. Change the font styles in all browsers. + * 2. Remove the margin in Firefox and Safari. + */ + +button, +input, +optgroup, +select, +textarea + font-family inherit /* 1 */ + font-size 100% /* 1 */ + line-height 1.15 /* 1 */ + margin 0 /* 2 */ + +/** + * Show the overflow in IE. + * 1. Show the overflow in Edge. + */ + +button, +input /* 1 */ + overflow visible + +/** + * Remove the inheritance of text transform in Edge, Firefox, and IE. + * 1. Remove the inheritance of text transform in Firefox. + */ + +button, +select /* 1 */ + text-transform none + +/** + * Correct the inability to style clickable types in iOS and Safari. + */ + +button, +[type="button"], +[type="reset"], +[type="submit"] + -webkit-appearance button + +/** + * Remove the inner border and padding in Firefox. + */ + +button::-moz-focus-inner, +[type="button"]::-moz-focus-inner, +[type="reset"]::-moz-focus-inner, +[type="submit"]::-moz-focus-inner + border-style none + padding 0 + +/** + * Restore the focus styles unset by the previous rule. + */ + +button:-moz-focusring, +[type="button"]-moz-focusring, +[type="reset"]-moz-focusring, +[type="submit"]-moz-focusring + outline 1px dotted ButtonText + +/** + * Correct the padding in Firefox. + */ + +fieldset + padding 0.35em 0.75em 0.625em + +/** + * 1. Correct the text wrapping in Edge and IE. + * 2. Correct the color inheritance from `fieldset` elements in IE. + * 3. Remove the padding so developers are not caught out when they zero out + * `fieldset` elements in all browsers. + */ + +legend + box-sizing border-box /* 1 */ + color inherit /* 2 */ + display table /* 1 */ + max-width 100% /* 1 */ + padding 0 /* 3 */ + white-space normal /* 1 */ + +/** + * Add the correct vertical alignment in Chrome, Firefox, and Opera. + */ + +progress + vertical-align baseline + +/** + * Remove the default vertical scrollbar in IE 10+. + */ + +textarea + overflow auto + +/** + * 1. Add the correct box sizing in IE 10. + * 2. Remove the padding in IE 10. + */ + +[type="checkbox"], +[type="radio"] + box-sizing border-box /* 1 */ + padding 0 /* 2 */ + +/** + * Correct the cursor style of increment and decrement buttons in Chrome. + */ + +[type="number"]::-webkit-inner-spin-button, +[type="number"]::-webkit-outer-spin-button + height auto + +/** + * 1. Correct the odd appearance in Chrome and Safari. + * 2. Correct the outline style in Safari. + */ + +[type="search"] + -webkit-appearance textfield /* 1 */ + outline-offset -2px /* 2 */ + +/** + * Remove the inner padding in Chrome and Safari on macOS. + */ + +[type="search"]::-webkit-search-decoration + -webkit-appearance none + +/** + * 1. Correct the inability to style clickable types in iOS and Safari. + * 2. Change font properties to `inherit` in Safari. + */ + +::-webkit-file-upload-button + -webkit-appearance button /* 1 */ + font inherit /* 2 */ + +/* Interactive + ========================================================================== */ + +/* + * Add the correct display in Edge, IE 10+, and Firefox. + */ + +details + display block + +/* + * Add the correct display in all browsers. + */ + +summary + display list-item + +/* Misc + ========================================================================== */ + +/** + * Add the correct display in IE 10+. + */ + +template + display none + +/** + * Add the correct display in IE 10. + */ + +[hidden] + display none \ No newline at end of file diff --git a/themes/theme/source/css/page/search.styl b/themes/theme/source/css/page/search.styl new file mode 100644 index 00000000..88233cef --- /dev/null +++ b/themes/theme/source/css/page/search.styl @@ -0,0 +1,65 @@ +// Search page styles + +.search-page + max-width 720px + margin 0 auto + padding $margin-l-0 $margin-m-1 + +.search-input-container + margin-bottom $margin-l-0 + +.search-input + width 100% + padding $margin-m-1 $margin-m-2 + font-size $font-size-body + border $line-third solid $color-border + border-radius $margin-s-2 + background $color-background + font-family $font-family + font-weight 400 + + &:focus + outline none + border-color $color-accent + +.search-result-container + min-height 200px + +.search-result-message + color $color-text-secondary + padding $margin-l-0 0 + text-align center + +.search-result-list + list-style none + padding 0 + margin 0 + +.search-result-item + padding $margin-m-1 0 + border-bottom $line-third solid $color-border + + &:last-child + border-bottom none + + // LocalSearch generates HTML with these classes + .search-result-title + margin-bottom $margin-s-2 + font-size $font-size-heading-h4 + + a + color $color-accent + text-decoration none + + &:hover + text-decoration underline + + .search-result + text-style(body-default) + color $color-text-primary + margin-top $margin-s-2 + margin-bottom 0 + + mark + color $color-text-primary + background-color $color-search-marker diff --git a/themes/theme/source/css/partials/footer.styl b/themes/theme/source/css/partials/footer.styl new file mode 100644 index 00000000..5819da88 --- /dev/null +++ b/themes/theme/source/css/partials/footer.styl @@ -0,0 +1,20 @@ +.footer + margin-top auto + border-top 1px solid $color-border + text-style(footer) + + .footer-text + margin-top $margin-m-0 + margin-bottom $margin-m-0 + +@media (max-width: 688px) + .footer + margin-top $margin-l-0 + + .footer-text + font-size 10*$px + margin-top $margin-s-1 + margin-bottom $margin-s-1 + + + diff --git a/themes/theme/source/css/partials/header.styl b/themes/theme/source/css/partials/header.styl new file mode 100644 index 00000000..545743f3 --- /dev/null +++ b/themes/theme/source/css/partials/header.styl @@ -0,0 +1,121 @@ +.header + position fixed + top 0 + left 0 + right 0 + z-index 100 + background $color-glass + backdrop-filter blur(12px) + -webkit-backdrop-filter blur(12px) + border-bottom 1px solid $color-border + text-style(header) + +@supports not (backdrop-filter: blur(12px)) + .header + background $color-background + +@media (max-width: 688px) + @supports not (backdrop-filter: blur(12px)) + .header-inner .site-nav .menu-list + background $color-background + +.header-inner + display flex + flex-wrap nowrap + align-items center + height $header-height + + #menu-btn + display none + + .site-nav + flex-grow 1 + overflow-x auto + +.site-brand-container + a + font-weight 400 + color $color-text-primary + +.menu-list + text-align right + display flex + + &:before + content "" + flex-grow 1 + +.menu-item + position relative + margin-left $margin-l-0 + underline-motion(header) + +.menu-item-active:after + border-bottom solid $line-secondary $color-accent + width 100% + +.logo-img + max-height $line-height-heading-h1 + width auto + max-width 100% + display flex + +@media (max-width: 688px) + .header + overflow visible + + .header-inner + flex-wrap wrap + align-items center + height $header-height + padding-top 0 + padding-bottom 0 + + #menu-btn + display flex !important + align-items center + justify-content flex-end + width 50% + height 100% + cursor pointer + color $color-text-primary + transition color $transition-duration ease + + &:hover + color $color-accent + + .site-brand-container + display flex + align-items center + width 50% + height 100% + + .site-nav + width 100% + + .menu-list + display flex + flex-direction column + max-height 0 + overflow hidden + margin-top 0 + background $color-glass + backdrop-filter blur(12px) + -webkit-backdrop-filter blur(12px) + border-top 1px solid $color-border + transition max-height 300ms ease-out + text-align left + + &.active + max-height 400px + + .menu-item + margin 0 + padding $margin-m-0 $margin-m-1 + border-bottom 1px solid $color-border + + &:last-child + border-bottom none + + a + display block \ No newline at end of file diff --git a/themes/theme/source/css/partials/paginator.styl b/themes/theme/source/css/partials/paginator.styl new file mode 100644 index 00000000..08009372 --- /dev/null +++ b/themes/theme/source/css/partials/paginator.styl @@ -0,0 +1,28 @@ +.paginator + margin-top $margin-l-1 + +.pagination + margin-top $margin-m-1 + text-style(header) + display flex + + &:before + content "" + flex-grow 1 + +.page-number + position relative + margin-left $margin-l-0 + underline-motion(header) + +.pagination .current:after + border-bottom solid $line-secondary $color-accent + width 100% + +.pagination .space + margin-left $margin-l-0 + +@media (max-width: 688px) + .paginator + margin-top $margin-m-1 + margin-bottom $margin-m-1 \ No newline at end of file diff --git a/themes/theme/source/css/partials/post_gallery.styl b/themes/theme/source/css/partials/post_gallery.styl new file mode 100644 index 00000000..ca953848 --- /dev/null +++ b/themes/theme/source/css/partials/post_gallery.styl @@ -0,0 +1,39 @@ +.post-gallery-list + .h-line-secondary + margin-top $margin-m-1 + + .h-line-secondary:last-child + display none + +.post-gallery-item + display flex + margin-top $margin-l-1 + margin-bottom $margin-m-0 + .post-info + margin-right $margin-l-0 + width 50% + display flex + flex-direction column + + .post-title + margin-bottom $margin-m-1 + text-style(heading-h1) + + .post-date + text-style(post-date) + + .post-img + width 50% + + a + underline-motion(link) + +@media (max-width: 480px) + .post-gallery-item + flex-wrap wrap + .post-info + width 100% + .post-img + width 100% + margin-top $margin-m-1 + diff --git a/themes/theme/source/css/partials/post_list.styl b/themes/theme/source/css/partials/post_list.styl new file mode 100644 index 00000000..c5ea22cc --- /dev/null +++ b/themes/theme/source/css/partials/post_list.styl @@ -0,0 +1,39 @@ +.post-list + + a + underline-motion(link) + +.year-title + margin-top $margin-l-1 + margin-bottom $margin-m-1 + text-style(year-title) + +.post-list-item + display flex + flex-wrap nowrap + margin-top $margin-m-0 + align-items top + + .post-title + flex-grow 1 + text-style(body-default) + + .post-date + margin-left $margin-l-0 + min-width 8rem + text-align right + text-style(post-date) + line-height $line-height-body + color $color-text-secondary + +@media (max-width: 480px) + .post-list-item + flex-wrap wrap + .post-title + width 100% + + .post-date + margin-left 0 + width 100% + text-align left + diff --git a/themes/theme/source/css/partials/profile.styl b/themes/theme/source/css/partials/profile.styl new file mode 100644 index 00000000..44025cdb --- /dev/null +++ b/themes/theme/source/css/partials/profile.styl @@ -0,0 +1,69 @@ +.profile + margin-top 20vh + display flex + flex-direction row-reverse + align-items center + + .profile-content + width 50% + margin 0 $margin-l-0 0 0 + + .profile-title + margin-top 0 + margin-bottom $margin-m-0 + + .profile-body + margin-top 0 + margin-bottom $margin-m-1 + color $color-text-secondary + + .profile-title + text-style(heading-h1) + + .profile-body + text-style(body-default) + + .profile-link + margin-top 0 + margin-bottom $margin-m-1 + font-size 15*$px + + a + text-decoration underline + text-underline-offset 3px + transition color $transition-duration ease + + &:hover + color $color-accent + + + .profile-image + width 50% + display flex + align-items center + justify-content center + + img + max-width 100% + max-height 35vh + object-fit contain + +@media (max-width: 480px) + .profile + flex-wrap wrap + align-items flex-start + margin-top $margin-l-0 + + .profile-content + width 100% + margin-top $margin-m-0 + + .profile-link + font-size 14*$px + + .profile-image + width 100% + + img + max-height 25vh + \ No newline at end of file diff --git a/themes/theme/source/css/post/code.styl b/themes/theme/source/css/post/code.styl new file mode 100644 index 00000000..f641f8d2 --- /dev/null +++ b/themes/theme/source/css/post/code.styl @@ -0,0 +1,97 @@ +// 统一字体权重 +font-weight-normal() + font-weight 400 + +// 代码块基础样式 +code + text-style(code-highlight) + font-weight 400 + +.code + pre + span + text-style(code-default) + font-weight 400 + +// 代码高亮区域 - 设置整体背景色 +.highlight + margin 0 0 $margin-m-2 0 + overflow-x auto + border 1px solid $color-border + border-radius $margin-s-1 + // 代码块背景色 + background-color $color-code-background + + .line + width $margin-l-2 + + table + margin 0 + border-spacing 0 + border none + // 表格继承背景色 + background-color transparent + + td.code + padding 0 $margin-s-1 0 $margin-m-0 + + pre + font-weight 400 + background-color transparent + +// 行号列 - 与代码块背景色保持一致 +td.gutter + width $margin-l-0 + padding 0 $margin-m-0 + vertical-align top + position -webkit-sticky + position sticky + left 0 + // 与代码块背景色一致 + background-color $color-code-background + // 添加右边框分隔 + border-right 1px solid $color-border + // 确保层级正确 + z-index 1 + + pre + margin 0 + color $color-code-marker + font-size $font-size-code + font-weight 400 + background-color transparent + +// 代码列 +td.code + vertical-align top + background-color transparent + + pre + margin 0 + font-weight 400 + background-color transparent + +// 所有 pre 标签 +pre + margin 0 + overflow-x auto + font-weight 400 + +// 移除内联代码背景(在代码块中不需要) +.highlight code + background-color transparent + padding 0 + +@media (max-width: 688px) + code + font-size 12*$px + + .highlight + pre + font-size 12*$px + + td.gutter + width $margin-m-2 + padding-right $margin-s-2 + font-size 11*$px + background-color $color-code-background diff --git a/themes/theme/source/css/post/media.styl b/themes/theme/source/css/post/media.styl new file mode 100644 index 00000000..3d49010f --- /dev/null +++ b/themes/theme/source/css/post/media.styl @@ -0,0 +1,17 @@ +img + width 100% + height auto + +// fix 16:9 ratio +.video-container + width 100% + padding-top 56.25% + position relative + +.video-container>iframe + position absolute + top 0 + left 0 + width 100% + height 100% + diff --git a/themes/theme/source/css/post/mermaid.styl b/themes/theme/source/css/post/mermaid.styl new file mode 100644 index 00000000..aae47ec5 --- /dev/null +++ b/themes/theme/source/css/post/mermaid.styl @@ -0,0 +1,96 @@ +// Mermaid 图表样式 + +// 基础容器样式 +.mermaid + display flex + justify-content center + align-items center + margin $margin-l-0 auto + padding $margin-m-2 + background $color-text-fourth + border $line-third solid $color-border + border-radius $margin-s-2 + cursor pointer + transition all $transition-duration ease + max-width 100% + overflow auto + position relative + + // 悬停效果 + &:hover + border-color $color-accent + box-shadow 0 4*$px 12*$px rgba(0, 0, 0, 0.1) + + // 提示文字 + &::after + content "点击放大" + position absolute + bottom $margin-s-2 + right $margin-s-2 + font-size $font-size-post-tag + color $color-text-secondary + opacity 0 + transition opacity $transition-duration + + &:hover::after + opacity 1 + + // SVG 图表样式 + svg + max-width 100% + height auto + +// Mermaid 放大模态框 +.mermaid-modal + display none + position fixed + top 0 + left 0 + width 100% + height 100% + background $color-overlay + z-index 10000 + justify-content center + align-items center + padding $margin-primary + + &.active + display flex + + // 关闭按钮 + .mermaid-close + position absolute + top $margin-m-2 + right $margin-m-2 + width 48*$px + height 48*$px + background $color-background + border $line-third solid $color-border + border-radius 50% + cursor pointer + display flex + justify-content center + align-items center + font-size 24*$px + color $color-text-primary + transition all $transition-duration + + &:hover + background $color-accent + color $color-background + border-color $color-accent + + // 放大后的图表容器 + .mermaid-content + max-width 95vw + max-height 90vh + overflow auto + background $color-background + padding $margin-l-0 + border-radius $margin-s-2 + box-shadow 0 8*$px 32*$px rgba(0, 0, 0, 0.3) + + svg + display block + max-width none + max-height none diff --git a/themes/theme/source/css/post/post_comment.styl b/themes/theme/source/css/post/post_comment.styl new file mode 100644 index 00000000..b027897a --- /dev/null +++ b/themes/theme/source/css/post/post_comment.styl @@ -0,0 +1,12 @@ +.post-comment + margin-top $margin-l-1 + +.v[data-class="v"] .vsys + display none!important + +.vcontent + p + margin-top 0!important + font-size $font-size-comment!important + color $color-text-primary!important + diff --git a/themes/theme/source/css/post/post_content.styl b/themes/theme/source/css/post/post_content.styl new file mode 100644 index 00000000..701f19e3 --- /dev/null +++ b/themes/theme/source/css/post/post_content.styl @@ -0,0 +1,104 @@ +.post-content + margin-top $margin-l-1 + +h1, h2, h3, h4, h5, h6 + margin-top $margin-l-0 + margin-bottom $margin-m-1 + +h1 + text-style(heading-h1) + +h2 + text-style(heading-h2) + +h3 + text-style(heading-h3) + +h4 + text-style(heading-h4) + +h5 + text-style(heading-h5) + +h6 + text-style(heading-h6) + +p + text-style(body-default) + +strong + text-style(body-bold) + +em + text-style(body-italic) + +del + text-style(body-delete) + +.post-content + a + underline-motion(underline-link) + +blockquote + margin-left 0 + margin-right 0 + margin-top $margin-m-2 + border-left $margin-s-2 solid $color-text-secondary + + p + margin-left $margin-m-2 + margin-top 0 + margin-bottom 0 + margin-right $margin-m-2 + padding-top $margin-m-0 + padding-bottom $margin-m-0 + + blockquote + margin-left $margin-m-2 + margin-top 0 + margin-bottom 0 + +.post-content + li + text-style(body-default) + margin-top $margin-m-0 + + ol + padding-left $margin-l-0 + margin-left $margin-m-1 + margin-right $margin-m-1 + margin-top $margin-m-2 + + ol + margin-top $margin-m-0 + + ul + padding-left $margin-l-0 + margin-left $margin-m-1 + margin-right $margin-m-1 + margin-top $margin-m-2 + + ul + margin-top $margin-m-0 + + li + list-style-type disc + + + .task-list + padding-left 0 + .task-list-item + list-style none + +dl + dt + padding $margin-m-0 0 + text-style(body-bold) + + dt::after + content " :" + + dd + margin 0 + + diff --git a/themes/theme/source/css/post/post_footer.styl b/themes/theme/source/css/post/post_footer.styl new file mode 100644 index 00000000..65782aec --- /dev/null +++ b/themes/theme/source/css/post/post_footer.styl @@ -0,0 +1,29 @@ +.post-footer + margin-top $margin-l-1 + + a + underline-motion(link) + +.post-nav + margin-top $margin-m-1 + display flex + flex-wrap wrap + text-style(header) + + .prev-item + display flex + text-align left + min-width 50% + align-items center + .arrow-left + margin-right $margin-s-2 + + .next-item + display flex + flex-direction row-reverse + text-align right + min-width 50% + align-items center + .arrow-right + margin-left $margin-s-2 + \ No newline at end of file diff --git a/themes/theme/source/css/post/post_head.styl b/themes/theme/source/css/post/post_head.styl new file mode 100644 index 00000000..32f4b47b --- /dev/null +++ b/themes/theme/source/css/post/post_head.styl @@ -0,0 +1,18 @@ +.post-head + margin-top $margin-l-1 + + .post-info + width 100% + display flex + flex-direction column + + .post-title + margin-bottom $margin-m-1 + text-style(heading-h1) + + .post-date + text-style(post-date) + + .post-img + margin-top $margin-l-1 + diff --git a/themes/theme/source/css/post/table.styl b/themes/theme/source/css/post/table.styl new file mode 100644 index 00000000..405e2433 --- /dev/null +++ b/themes/theme/source/css/post/table.styl @@ -0,0 +1,36 @@ +.post-content + table + border $color-text-primary solid $line-third + width 100% + text-align left + border-collapse collapse + table-layout fixed + + td, th + padding $margin-m-1 + + th + font-weight 400 + + td + font-weight 400 + + table, tboby, tr, td + background-color inherit + +.highlight>table + width auto + min-width fit-content + border none + + td + padding 0 + border none + +@media (max-width: 480px) + .block-table + display block + overflow-x auto + + + \ No newline at end of file diff --git a/themes/theme/source/css/post/tag_plugin.styl b/themes/theme/source/css/post/tag_plugin.styl new file mode 100644 index 00000000..9a1a7d94 --- /dev/null +++ b/themes/theme/source/css/post/tag_plugin.styl @@ -0,0 +1,48 @@ +.gist + td + border 0 + + a + color $color-text-secondary + background-image none!important + +blockquote>footer + margin 0 $margin-m-2 + padding $margin-m-0 0 + font-size $font-size-blockquote-footer + color $color-text-secondary + + cite + margin-left $margin-m-0 + + cite::before + content " — " + + strong + color $color-text-secondary + font-size $font-size-blockquote-footer + + a + color $color-text-secondary + background-image none!important + + +figcaption + font-family monospace + font-size $font-size-blockquote-footer + padding $margin-m-0 0 + color $color-text-secondary + + span + padding-right $margin-m-0 + + a + color $color-text-secondary + background-image none!important + +blockquote.pullquote.left + float left + +blockquote.pullquote.right + float right + \ No newline at end of file diff --git a/themes/theme/source/css/post/task_list.styl b/themes/theme/source/css/post/task_list.styl new file mode 100644 index 00000000..ea5dabca --- /dev/null +++ b/themes/theme/source/css/post/task_list.styl @@ -0,0 +1,43 @@ +ul + li.task-list-item + position relative + + li.task-list-item>input[type=checkbox] + list-style none + background none + appearance none + -webkit-appearance none + -moz-appearance none; + width $margin-l-0 + display inline-block + border none + opacity 1 + + li.task-list-item>input[type=checkbox][checked]:before + background $color-text-primary + -webkit-mask-image url('../icon/checkbox-checked.svg') + -webkit-mask-position center center + mask-image url('../icon/checkbox-checked.svg') + -webkit-mask-repeat no-repeat + + li.task-list-item>input[type=checkbox]:before + background $color-text-primary + -webkit-mask-image url('../icon/checkbox-default.svg') + -webkit-mask-position center center + mask-image url('../icon/checkbox-default.svg') + -webkit-mask-repeat no-repeat + + li.task-list-item>input[type=checkbox]:after, li.task-list-item>input[type=checkbox]:before + display block + position absolute + content "X" + color transparent + left 0 + top 0 + width $icon-size + height $line-height-body + background-size contain + background-repeat no-repeat + background-position-x 0 + background-position-y center + --webkit-touch-callout none \ No newline at end of file diff --git a/themes/theme/source/css/style.styl b/themes/theme/source/css/style.styl new file mode 100644 index 00000000..97bd4cb9 --- /dev/null +++ b/themes/theme/source/css/style.styl @@ -0,0 +1,47 @@ +// media +@import "media.styl" + +// variable & init +@import "variable.styl" +@import "normalize.styl" + +// color mode +@import "color.styl" + +// font +@import "font-slices.styl" +@import "font.styl" + +// structure style +@import "layout.styl" +@import "base.styl" + +// motion +@import "motion.styl" + +// partials +@import "partials/header.styl" +@import "partials/footer.styl" +@import "partials/post_list.styl" +@import "partials/post_gallery.styl" +@import "partials/paginator.styl" +@import "partials/profile.styl" + +// pages +@import "page/search.styl" + +// post +@import "post/post_content.styl" +@import "post/post_head.styl" +@import "post/post_footer.styl" +@import "post/post_comment.styl" +@import "post/code.styl" +@import "post/table.styl" +@import "post/media.styl" +@import "post/tag_plugin.styl" +@import "post/task_list.styl" +@import "post/mermaid.styl" + +// component +@import "component/icon.styl" +@import "component/component.styl" diff --git a/themes/theme/source/css/variable.styl b/themes/theme/source/css/variable.styl new file mode 100644 index 00000000..f8af5332 --- /dev/null +++ b/themes/theme/source/css/variable.styl @@ -0,0 +1,72 @@ +// PIXEL +$px = 0.0625rem + +$line-primary = 4px +$line-secondary = 2px +$line-third = 1px + +$icon-size = 20*$px + +$margin-primary = 48*$px +$margin-l-2 = 40*$px +$margin-l-1 = 32*$px +$margin-l-0 = 24*$px +$margin-m-2 = 16*$px +$margin-m-1 = 12*$px +$margin-m-0 = 8*$px +$margin-s-2 = 4*$px +$margin-s-1 = 2*$px +$margin-s-0 = 1*$px + +$font-family = 'GoogleSansCode', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif + +$font-weight-light = 300 +$font-weight-regular = 400 +$font-weight-medium = 500 +$font-weight-semibold = 600 +$font-weight-bold = 700 + +$font-size-header = 13*$px +$font-size-footer = 11*$px + +$font-size-heading-h1 = 26*$px +$font-size-heading-h2 = 22*$px +$font-size-heading-h3 = 17*$px +$font-size-heading-h4 = 15*$px +$font-size-heading-h5 = 14*$px +$font-size-heading-h6 = 14*$px + +$font-size-body = 15*$px + +$font-size-code = 13*$px + +$font-size-comment = 13*$px + +$font-size-post-date = 13*$px +$font-size-year-title = 26*$px +$font-size-post-tag = 11*$px + +$font-size-blockquote-footer = 11*$px + +$line-height-header = 18*$px +$line-height-footer = 18*$px + +$line-height-heading-h1 = 32*$px +$line-height-heading-h2 = 28*$px +$line-height-heading-h3 = 22*$px +$line-height-heading-h4 = 20*$px +$line-height-heading-h5 = 18*$px +$line-height-heading-h6 = 18*$px + +$line-height-body = 22*$px + +$line-height-code = 15*$px + +$line-height-post-date = 18*$px +$line-height-year-title = 32*$px +$line-height-post-tag = 14*$px + +$transition-duration = 200ms +$header-height = 48*$px + + diff --git a/themes/theme/source/favicon.ico b/themes/theme/source/favicon.ico new file mode 100644 index 00000000..a938655c Binary files /dev/null and b/themes/theme/source/favicon.ico differ diff --git a/themes/theme/source/fonts/CarroisSong.ttf b/themes/theme/source/fonts/CarroisSong.ttf new file mode 100644 index 00000000..9105c1a8 Binary files /dev/null and b/themes/theme/source/fonts/CarroisSong.ttf differ diff --git a/themes/theme/source/fonts/cjk-common.woff2 b/themes/theme/source/fonts/cjk-common.woff2 new file mode 100644 index 00000000..3140f04a Binary files /dev/null and b/themes/theme/source/fonts/cjk-common.woff2 differ diff --git a/themes/theme/source/fonts/cjk-ext.woff2 b/themes/theme/source/fonts/cjk-ext.woff2 new file mode 100644 index 00000000..6e1b840f Binary files /dev/null and b/themes/theme/source/fonts/cjk-ext.woff2 differ diff --git a/themes/theme/source/fonts/latin-base.woff2 b/themes/theme/source/fonts/latin-base.woff2 new file mode 100644 index 00000000..6e71c681 Binary files /dev/null and b/themes/theme/source/fonts/latin-base.woff2 differ diff --git a/themes/theme/source/fonts/latin-ext.woff2 b/themes/theme/source/fonts/latin-ext.woff2 new file mode 100644 index 00000000..78abb265 Binary files /dev/null and b/themes/theme/source/fonts/latin-ext.woff2 differ diff --git a/themes/theme/source/fonts/src/GoogleSansCode-Regular.ttf b/themes/theme/source/fonts/src/GoogleSansCode-Regular.ttf new file mode 100644 index 00000000..db4d27d3 Binary files /dev/null and b/themes/theme/source/fonts/src/GoogleSansCode-Regular.ttf differ diff --git a/themes/theme/source/fonts/symbols.woff2 b/themes/theme/source/fonts/symbols.woff2 new file mode 100644 index 00000000..59bc5d8d Binary files /dev/null and b/themes/theme/source/fonts/symbols.woff2 differ diff --git a/themes/theme/source/icon/arrow-left.svg b/themes/theme/source/icon/arrow-left.svg new file mode 100644 index 00000000..9c828592 --- /dev/null +++ b/themes/theme/source/icon/arrow-left.svg @@ -0,0 +1,7 @@ + + + icon/left-arrow + + + + \ No newline at end of file diff --git a/themes/theme/source/icon/arrow-right.svg b/themes/theme/source/icon/arrow-right.svg new file mode 100644 index 00000000..7850ca44 --- /dev/null +++ b/themes/theme/source/icon/arrow-right.svg @@ -0,0 +1,7 @@ + + + icon/right-arrow + + + + \ No newline at end of file diff --git a/themes/theme/source/icon/arrow-up.svg b/themes/theme/source/icon/arrow-up.svg new file mode 100644 index 00000000..ddeab3c9 --- /dev/null +++ b/themes/theme/source/icon/arrow-up.svg @@ -0,0 +1,7 @@ + + + icon/arrow-up + + + + \ No newline at end of file diff --git a/themes/theme/source/icon/checkbox-checked.svg b/themes/theme/source/icon/checkbox-checked.svg new file mode 100644 index 00000000..da15a094 --- /dev/null +++ b/themes/theme/source/icon/checkbox-checked.svg @@ -0,0 +1,13 @@ + + + icon/checkbox/checked + + + + + + + + + + \ No newline at end of file diff --git a/themes/theme/source/icon/checkbox-default.svg b/themes/theme/source/icon/checkbox-default.svg new file mode 100644 index 00000000..51ac63dc --- /dev/null +++ b/themes/theme/source/icon/checkbox-default.svg @@ -0,0 +1,13 @@ + + + icon/checkbox/default + + + + + + + + + + \ No newline at end of file diff --git a/themes/theme/source/icon/close-btn.svg b/themes/theme/source/icon/close-btn.svg new file mode 100644 index 00000000..4d6e1bc1 --- /dev/null +++ b/themes/theme/source/icon/close-btn.svg @@ -0,0 +1,3 @@ + + + diff --git a/themes/theme/source/icon/marker.svg b/themes/theme/source/icon/marker.svg new file mode 100644 index 00000000..65ab4b2d --- /dev/null +++ b/themes/theme/source/icon/marker.svg @@ -0,0 +1,18 @@ + + + marker + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/themes/theme/source/js/format.js b/themes/theme/source/js/format.js new file mode 100644 index 00000000..9d79edce --- /dev/null +++ b/themes/theme/source/js/format.js @@ -0,0 +1,23 @@ +function detectTaskList() { + var taskListObjects = document.getElementsByTagName("input"); + for (var i = 0; i < taskListObjects.length; i++) { + var par = taskListObjects[i].parentNode; + par.classList.add("task-list-item"); + par.parentNode.classList.add("task-list"); + } +} + +function detectBlockTable() { + var tableListObjects = document.getElementsByTagName("thead"); + for (var i = 0; i < tableListObjects.length; i++) { + var par = tableListObjects[i].parentNode; + par.classList.add("block-table"); + } +} + +function detectors(){ + detectTaskList(); + detectBlockTable(); +} + + diff --git a/themes/theme/source/js/menu.js b/themes/theme/source/js/menu.js new file mode 100644 index 00000000..fd84fcc3 --- /dev/null +++ b/themes/theme/source/js/menu.js @@ -0,0 +1,27 @@ +function toggleMenu() { + var menuList = document.getElementsByClassName("menu-list")[0]; + var menuButton = document.getElementById("menu-btn"); + if (menuList.classList.contains("active")) { + menuList.classList.remove("active"); + menuButton.innerHTML = "菜单"; + } else { + menuList.classList.add("active"); + menuButton.innerHTML = "菜单"; + } +} + +function closeMenu() { + var menuList = document.getElementsByClassName("menu-list")[0]; + var menuButton = document.getElementById("menu-btn"); + if (menuList.classList.contains("active")) { + menuList.classList.remove("active"); + menuButton.innerHTML = "菜单"; + } +} + +document.addEventListener("DOMContentLoaded", function() { + var menuItems = document.querySelectorAll(".menu-item a"); + menuItems.forEach(function(item) { + item.addEventListener("click", closeMenu); + }); +}); \ No newline at end of file diff --git a/themes/theme/source/js/mermaid-zoom.js b/themes/theme/source/js/mermaid-zoom.js new file mode 100644 index 00000000..6b4f0e17 --- /dev/null +++ b/themes/theme/source/js/mermaid-zoom.js @@ -0,0 +1,169 @@ +// Mermaid 图表点击放大功能 + +(function() { + 'use strict'; + + // 等待 DOM 加载完成 + function initMermaidZoom() { + const mermaidElements = document.querySelectorAll('.mermaid'); + + if (mermaidElements.length === 0) return; + + // 检测是否为移动端 + const isMobile = window.innerWidth <= 688; + + // 移动端:为 mermaid 元素添加提示样式 + if (isMobile) { + mermaidElements.forEach(function(el) { + el.style.position = 'relative'; + // 创建提示元素 + const hint = document.createElement('span'); + hint.textContent = '点击放大'; + hint.style.cssText = 'position:absolute;bottom:4px;right:4px;font-size:10px;padding:2px 6px;background:rgba(0,0,0,0.5);color:#fff;border-radius:4px;pointer-events:none;'; + el.appendChild(hint); + }); + } + + // 创建模态框 + const modal = document.createElement('div'); + modal.className = 'mermaid-modal'; + modal.innerHTML = ` + +
+ `; + document.body.appendChild(modal); + + const closeBtn = modal.querySelector('.mermaid-close'); + const content = modal.querySelector('.mermaid-content'); + + // 关闭模态框函数 + function closeModal() { + modal.classList.remove('active'); + document.body.style.overflow = ''; + } + + // 为每个 mermaid 图表添加点击事件 + mermaidElements.forEach(function(el) { + el.addEventListener('click', function(e) { + // 等待 mermaid 渲染完成 + const svg = el.querySelector('svg'); + if (!svg) return; + + // 复制 SVG 到模态框 + content.innerHTML = ''; + const clonedSvg = svg.cloneNode(true); + + // 获取原始 SVG 的尺寸 + const originalWidth = svg.viewBox.baseVal.width || svg.width.baseVal.value || 800; + const originalHeight = svg.viewBox.baseVal.height || svg.height.baseVal.value || 600; + + // 检测是否为移动端 + const isMobile = window.innerWidth <= 688; + + // 计算放大比例 + let targetWidth; + if (isMobile) { + // 移动端:适配屏幕宽度,留出边距 + targetWidth = window.innerWidth - 32; // 16px padding × 2 + } else { + // 桌面端:85% 视口宽度,最大 1600px + targetWidth = Math.min(window.innerWidth * 0.85, 1600); + } + + const scale = targetWidth / originalWidth; + const newWidth = originalWidth * scale; + const newHeight = originalHeight * scale; + + // 设置放大后的尺寸 + clonedSvg.setAttribute('width', newWidth + 'px'); + clonedSvg.setAttribute('height', newHeight + 'px'); + clonedSvg.style.width = newWidth + 'px'; + clonedSvg.style.height = newHeight + 'px'; + clonedSvg.style.maxWidth = 'none'; + clonedSvg.style.maxHeight = 'none'; + + // 确保 viewBox 存在 + if (!clonedSvg.getAttribute('viewBox')) { + clonedSvg.setAttribute('viewBox', '0 0 ' + originalWidth + ' ' + originalHeight); + } + + content.appendChild(clonedSvg); + + // 显示模态框 + modal.classList.add('active'); + document.body.style.overflow = 'hidden'; + + // 移动端样式调整 + if (isMobile) { + content.style.maxWidth = '100vw'; + content.style.maxHeight = '100vh'; + content.style.padding = '12px'; + content.style.borderRadius = '0'; + modal.style.padding = '0'; + } else { + // 恢复桌面端样式 + content.style.maxWidth = ''; + content.style.maxHeight = ''; + content.style.padding = ''; + content.style.borderRadius = ''; + modal.style.padding = ''; + } + }); + }); + + // 关闭按钮事件 + closeBtn.addEventListener('click', closeModal); + + // 点击背景关闭 + modal.addEventListener('click', function(e) { + if (e.target === modal) { + closeModal(); + } + }); + + // ESC 键关闭 + document.addEventListener('keydown', function(e) { + if (e.key === 'Escape' && modal.classList.contains('active')) { + closeModal(); + } + }); + } + + // 等待 mermaid 渲染完成后再初始化 + function waitForMermaid() { + const mermaidElements = document.querySelectorAll('.mermaid'); + let renderedCount = 0; + + function checkRendered() { + let allRendered = true; + mermaidElements.forEach(function(el) { + if (!el.querySelector('svg')) { + allRendered = false; + } + }); + + if (allRendered) { + initMermaidZoom(); + } else { + // 如果还没渲染完,继续等待 + if (renderedCount < 50) { // 最多等待 5 秒 + renderedCount++; + setTimeout(checkRendered, 100); + } else { + // 超时,仍然初始化(可能有些图表渲染失败) + initMermaidZoom(); + } + } + } + + // 开始检查 + setTimeout(checkRendered, 500); + } + + // 页面加载完成后初始化 + if (document.readyState === 'loading') { + document.addEventListener('DOMContentLoaded', waitForMermaid); + } else { + waitForMermaid(); + } +})(); diff --git a/themes/theme/source/js/search.js b/themes/theme/source/js/search.js new file mode 100644 index 00000000..27abb4e0 --- /dev/null +++ b/themes/theme/source/js/search.js @@ -0,0 +1,68 @@ +// Search functionality for standalone search page + +(function () { + 'use strict'; + + let localSearch = null; + let isDataLoaded = false; + + function initSearch() { + const input = document.getElementById('search-input'); + const container = document.getElementById('search-results'); + + if (!input || !container || typeof LocalSearch === 'undefined') { + container.innerHTML = '
搜索功能初始化失败
'; + return; + } + + localSearch = new LocalSearch({ + path: searchConfig.path, + top_n_per_article: searchConfig.top_n_per_article, + unescape: searchConfig.unescape + }); + + localSearch.fetchData(); + + window.addEventListener('search:loaded', function () { + isDataLoaded = true; + container.innerHTML = '
'; + }); + + function displaySearchResult() { + if (!isDataLoaded) { + container.innerHTML = '
加载中...
'; + return; + } + + const searchText = input.value.trim().toLowerCase(); + + if (searchText.length === 0) { + container.innerHTML = '
'; + return; + } + + const keywords = searchText.split(/[-\s]+/); + const resultItems = localSearch.getResultItems(keywords); + + if (resultItems.length === 0) { + container.innerHTML = '
未找到相关结果
'; + } else { + container.innerHTML = ` +
找到 ${resultItems.length} 个结果
+
    + ${resultItems.map(result => result.item).join('')} +
+ `; + } + } + + input.addEventListener('input', displaySearchResult); + input.focus(); + } + + if (document.readyState === 'loading') { + document.addEventListener('DOMContentLoaded', initSearch); + } else { + initSearch(); + } +})(); diff --git a/themes/theme/source/js/theme-switch.js b/themes/theme/source/js/theme-switch.js new file mode 100644 index 00000000..4dddd304 --- /dev/null +++ b/themes/theme/source/js/theme-switch.js @@ -0,0 +1,31 @@ +document.addEventListener('DOMContentLoaded', () => { + const themeSwitch = document.getElementById('theme-switch-btn'); + const prefersDarkScheme = window.matchMedia('(prefers-color-scheme: dark)'); + + // 检查本地存储中的主题设置 + const currentTheme = localStorage.getItem('theme'); + if (currentTheme === 'dark') { + document.body.classList.add('dark-theme'); + themeSwitch.querySelector('i').classList.replace('icon-moon', 'icon-sun'); + } else if (currentTheme === 'light') { + document.body.classList.remove('dark-theme'); + } else if (prefersDarkScheme.matches) { + document.body.classList.add('dark-theme'); + themeSwitch.querySelector('i').classList.replace('icon-moon', 'icon-sun'); + } + + // 切换主题 + themeSwitch.addEventListener('click', (e) => { + e.preventDefault(); + + if (document.body.classList.contains('dark-theme')) { + document.body.classList.remove('dark-theme'); + localStorage.setItem('theme', 'light'); + themeSwitch.querySelector('i').classList.replace('icon-sun', 'icon-moon'); + } else { + document.body.classList.add('dark-theme'); + localStorage.setItem('theme', 'dark'); + themeSwitch.querySelector('i').classList.replace('icon-moon', 'icon-sun'); + } + }); +}); \ No newline at end of file diff --git a/themes/theme/source/profile_cover.jpg b/themes/theme/source/profile_cover.jpg new file mode 100644 index 00000000..c57f8b1a Binary files /dev/null and b/themes/theme/source/profile_cover.jpg differ -- cgit v1.2.3