diff --git a/layout/home-content.ejs b/layout/home-content.ejs
index 341d1f5..71bfffe 100644
--- a/layout/home-content.ejs
+++ b/layout/home-content.ejs
@@ -1,11 +1,9 @@
-
-
-
<% page.posts.forEach(post => { %>
-
- <%= post.title %> + <%= post.title %>
@@ -18,7 +16,7 @@- <%= date(post.date, 'YYYY-MM-DD') %> + <%= date(post.date, 'YYYY-MM-DD') %>
阅读全文 diff --git a/package.json b/package.json index 09fffe7..9d6dee8 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "hexo-theme-poem", + "name": "hexo-theme-ils", "version": "0.0.1", "description": "A simple and beautiful theme for Hexo.", "main": "index.js", @@ -8,12 +8,12 @@ }, "repository": { "type": "git", - "url": "git+ssh://git@github.com/XPoet/hexo-theme-poem.git" + "url": "git+ssh://git@github.com/XPoet/hexo-theme-ils.git" }, "author": "XPoet", "license": "MIT", "bugs": { - "url": "https://github.com/XPoet/hexo-theme-poem/issues" + "url": "https://github.com/XPoet/hexo-theme-ils/issues" }, - "homepage": "https://github.com/XPoet/hexo-theme-poem#readme" + "homepage": "https://github.com/XPoet/hexo-theme-ils#readme" } diff --git a/scripts/helpers/engine.js b/scripts/helpers/engine.js deleted file mode 100644 index a961625..0000000 --- a/scripts/helpers/engine.js +++ /dev/null @@ -1,49 +0,0 @@ -/* global hexo */ - -'use strict'; - -hexo.extend.helper.register('next_inject', function(point) { - return hexo.theme.config.injects[point] - .map(item => this.partial(item.layout, item.locals, item.options)) - .join(''); -}); - -hexo.extend.helper.register('next_js', function(...urls) { - const { js } = hexo.theme.config; - return urls.map(url => this.js(`${js}/${url}`)).join(''); -}); - -hexo.extend.helper.register('next_vendors', function(url) { - if (url.startsWith('//')) return url; - const internal = hexo.theme.config.vendors._internal; - return this.url_for(`${internal}/${url}`); -}); - -hexo.extend.helper.register('post_edit', function(src) { - const theme = hexo.theme.config; - if (!theme.post_edit.enable) return ''; - return this.next_url(theme.post_edit.url + src, '', { - class: 'post-edit-link', - title: this.__('post.edit') - }); -}); - -hexo.extend.helper.register('post_nav', function(post) { - const theme = hexo.theme.config; - if (theme.post_navigation === false || (!post.prev && !post.next)) return ''; - const prev = theme.post_navigation === 'right' ? post.prev : post.next; - const next = theme.post_navigation === 'right' ? post.next : post.prev; - const left = prev ? ` - - ${prev.title} - ` : ''; - const right = next ? ` - - ${next.title} - ` : ''; - return ` --`; -}); diff --git a/scripts/helpers/export-config.js b/scripts/helpers/export-config.js index 1e8e0ac..ebb8598 100644 --- a/scripts/helpers/export-config.js +++ b/scripts/helpers/export-config.js @@ -13,9 +13,7 @@ hexo.extend.helper.register('export_config', function() { hostname : url.parse(config.url).hostname || config.url, root : config.root, localsearch: theme.local_search, - themeName: theme.theme_name, - themeVersion: theme.theme_version, - pageLayout: theme.page + themeInfo: theme.theme_info }; if (config.search) { exportConfig.path = config.search.path; diff --git a/source/css/layout/_partial/article-meta-info.styl b/source/css/layout/_partial/article-meta-info.styl index 940ccdf..e7b004b 100644 --- a/source/css/layout/_partial/article-meta-info.styl +++ b/source/css/layout/_partial/article-meta-info.styl @@ -1,11 +1,9 @@ @require '../common/variables.styl' -$article-meta-info-font-size = 12px; - .article-meta-info { color: var(--third-text-color); - font-size: $article-meta-info-font-size; + font-size: 0.8em; .article-meta-item { margin-right: 10px; @@ -26,7 +24,7 @@ $article-meta-info-font-size = 12px; color: var(--third-text-color); &:hover { - color: $primary-color; + color: var(--primary-color); } } } diff --git a/source/css/layout/_partial/header.styl b/source/css/layout/_partial/header.styl index 9610d70..9c6200a 100644 --- a/source/css/layout/_partial/header.styl +++ b/source/css/layout/_partial/header.styl @@ -22,12 +22,11 @@ z-index: $z-index-5; .logo-title { - font-size: 28px; + font-size: 2.2em; font-weight: bold; letter-spacing: 1px; color: var(--first-text-color); transform-origin: left center; - transition: all 0.5s ease; } diff --git a/source/css/layout/_partial/local-search.styl b/source/css/layout/_partial/local-search.styl index 76c2de9..4dfd703 100644 --- a/source/css/layout/_partial/local-search.styl +++ b/source/css/layout/_partial/local-search.styl @@ -1,6 +1,6 @@ @require '../common/variables.styl' -$icon-size = 18px; +$icon-size = 1.2em; .search-pop-overlay { display: none; @@ -25,10 +25,13 @@ $icon-size = 18px; width: 70%; z-index: $z-index-6; + .search-icon, .popup-btn-close { color: var(--normal-text-color); font-size: $icon-size; padding: 0 10px; + display: flex; + align-items: center; } .popup-btn-close { @@ -54,7 +57,7 @@ input.search-input { border: 0; outline: 0; width: 100%; - font-size: 16px; + font-size: 1.2em; &::-webkit-search-cancel-button { display: none; diff --git a/source/css/layout/_partial/tools.styl b/source/css/layout/_partial/tools.styl index 1b9e359..010bb2d 100644 --- a/source/css/layout/_partial/tools.styl +++ b/source/css/layout/_partial/tools.styl @@ -10,7 +10,7 @@ border: 1px solid var(--third-text-color); width: 26px; height: 26px; - font-size: 16px; + font-size: 1.2em; display: flex; align-items: center; justify-content: center; diff --git a/source/css/layout/archive-content.styl b/source/css/layout/archive-content.styl index e21b613..0598950 100644 --- a/source/css/layout/archive-content.styl +++ b/source/css/layout/archive-content.styl @@ -1,8 +1,8 @@ @require 'common/variables.styl' -$archive-year-font-size = 24px; -$article-title-font-size = 16px; -$article-date-font-size = 14px; +$archive-year-font-size = 1.8em; +$article-title-font-size = 1.12em; +$article-date-font-size = 0.8em; .archive-container { @@ -21,10 +21,9 @@ $article-date-font-size = 14px; .article-list { - padding-left: 20px; .article-item { - margin: 20px 0; + margin: 22px 0; font-size: $article-title-font-size; a.article-title { diff --git a/source/css/layout/article-content.styl b/source/css/layout/article-content.styl index 222618c..50c9e46 100644 --- a/source/css/layout/article-content.styl +++ b/source/css/layout/article-content.styl @@ -6,7 +6,7 @@ h3 { font-weight: 600; - font-size: 22px; + font-size: 1.8em; margin: 0; } @@ -17,11 +17,11 @@ } .meta-info { - margin: 10px 0 20px 0; + margin: 10px 0 30px 0; } .article-content { - padding-bottom: 20px; + padding-bottom: 30px; border-bottom: 1px solid $border-color; } diff --git a/source/css/layout/category-content.styl b/source/css/layout/category-content.styl index efd5dd9..54becd4 100644 --- a/source/css/layout/category-content.styl +++ b/source/css/layout/category-content.styl @@ -3,8 +3,8 @@ .category-container { .category-name { color: var(--second-text-color); - font-size 20px - font-weight 600 - margin-bottom 10px + font-size: 1.6em; + font-weight: 600; + margin-bottom: 32px; } } \ No newline at end of file diff --git a/source/css/layout/common/animated.styl b/source/css/layout/common/animated.styl index d28f0c2..9e73fcc 100644 --- a/source/css/layout/common/animated.styl +++ b/source/css/layout/common/animated.styl @@ -1,13 +1,27 @@ -.animated { +the-transition() { + transition-duration: 0.2s; + transition-timing-function: ease-in-out; + transition-delay: 0s; +} + +the-transition-ease-in() { + transition-duration: 0.2s; + transition-timing-function: ease-in; + transition-delay: 0s; +} + +the-transition-ease-out() { + transition-duration: 0.2s; + transition-timing-function: ease-out; + transition-delay: 0s; +} + +.fade-in-down-animation { animation-fill-mode: both; animation-duration: 1s; animation-name fade-in-down } -.animated.hinge { - animation-duration: 1s; -} - @keyframes fade-in-down { 0% { opacity: 0; @@ -20,22 +34,30 @@ } } -the-transition() { - transition-duration: 0.2s; - transition-timing-function: ease-in-out; - transition-delay: 0s; -} - - -the-transition-ease-in() { - transition-duration: 0.2s; - transition-timing-function: ease-in; - transition-delay: 0s; -} - - -the-transition-ease-out() { - transition-duration: 0.2s; - transition-timing-function: ease-out; - transition-delay: 0s; +.title-hover-animation { + display: inline-block; + position: relative; + color: var(--second-text-color); + border-bottom: none; + line-height: 1.3; + vertical-align: top; + + &::before { + content: ""; + position: absolute; + width: 100%; + height: 2px; + bottom: -4px; + left: 0; + background-color: var(--second-text-color); + visibility: hidden; + transform: scaleX(0); + the-transition(); + } + + &:hover::before { + visibility: visible; + transform: scaleX(1); + } + } diff --git a/source/css/layout/common/basic.styl b/source/css/layout/common/basic.styl index 68ce62d..e58cef3 100644 --- a/source/css/layout/common/basic.styl +++ b/source/css/layout/common/basic.styl @@ -10,10 +10,14 @@ html, body { font-family: $default-font-family; font-weight: $default-font-weight; line-height: $default-font-line-height; - //-webkit-font-smoothing antialiased; transition: all 0.5s ease; } +::selection { + background: var(--selection-color); + color: #fff; +} + ul, li, ol { @@ -22,15 +26,6 @@ ol { list-style: none; } -button { - padding: 0; - margin: 0; - border: 0; - outline: none; - cursor: pointer; - background: transparent; -} - a { text-decoration: none; color: var(--normal-text-color); @@ -40,8 +35,15 @@ a:hover, a:active { color: var(--primary-color); } +button { + padding: 0; + margin: 0; + border: 0; + outline: none; + cursor: pointer; + background: transparent; +} -// 预设的按钮样式 .btn { display: inline-block; position: relative; @@ -57,40 +59,4 @@ a:hover, a:active { color: var(--primary-color); border: 1px solid var(--primary-color); } -} - - -// 文章标题悬浮动画 -.article-title-hover-animation { - display: inline-block; - position: relative; - color: var(--second-text-color); - border-bottom: none; - line-height: 1.3; - vertical-align: top; - - &::before { - content: ""; - position: absolute; - width: 100%; - height: 2px; - bottom: -4px; - left: 0; - background-color: var(--second-text-color); - visibility: hidden; - transform: scaleX(0); - the-transition(); - } - - &:hover::before { - visibility: visible; - transform: scaleX(1); - } - -} - - -::selection { - background: var(--selection-color); - color: #fff; } \ No newline at end of file diff --git a/source/css/layout/common/markdown.styl b/source/css/layout/common/markdown.styl index fd2a8d9..f4fb115 100644 --- a/source/css/layout/common/markdown.styl +++ b/source/css/layout/common/markdown.styl @@ -3,10 +3,10 @@ .markdown-body { blockquote { - border-left: 5px solid var(--normal-text-color); - margin: 0; + border-left: 5px solid var(--third-text-color); + margin: 20px 0; padding: 0 0 0 10px; - color : var(--third-text-color); + color: var(--third-text-color); } p { @@ -14,51 +14,117 @@ } a { - color: var(--primary-color); + color: #2050ff; } - a:hover { text-decoration: underline; } + ul > li, ol > li { + margin-left: 35px; + line-height: 1.8em; + } + + ul { + + li { + list-style: disc; + + ul { + + li { + list-style: circle; + + ul { + li { + list-style: square; + } + } + } + } + } + } + + + ol { + + li { + list-style: upper-roman; + + ol { + + li { + list-style: lower-roman; + + ol { + li { + list-style: lower-alpha; + } + } + } + } + } + } + + + h1, + h2, + h3, + h4, + h5, + h6 { + } h1 { color: var(--second-text-color); - font-size: 2.2em; + font-size: 2em; font-weight: 600; + margin-block-start: 1.1em; + margin-block-end: 1.1em; } h2 { color: var(--second-text-color); - font-size: 2em; + font-size: 1.8em; font-weight: 600; + margin-block-start: 1.1em; + margin-block-end: 1.1em; } h3 { color: var(--second-text-color); - font-size: 1.8em; + font-size: 1.6em; font-weight: 550; + margin-block-start: 1em; + margin-block-end: 1em; } h4 { color: var(--second-text-color); - font-size: 1.6em; - font-weight: 500; + font-size: 1.4em; + font-weight: 550; + margin-block-start: 1em; + margin-block-end: 1em; } h5 { color: var(--second-text-color); - font-size: 1.4em; - font-weight: 450; + font-size: 1.2em; + font-weight: 500; + margin-block-start: 0.9em; + margin-block-end: 0.9em; + } h6 { color: var(--second-text-color); font-size: 1.2em; - font-weight: 400; + font-weight: 500; + margin-block-start: 0.9em; + margin-block-end: 0.9em; } @@ -69,39 +135,38 @@ border: 1px solid var(--border-color); } - table:not(figure.highlight) { + & > table { + border-spacing: 0; + border-collapse: collapse; + display: block; + width: 100%; + overflow: auto; - border: solid var(--border-color); - border-width: 1px 0 0 1px; - - thead { - - background: var(--border-color); - - tr { - th { - margin: 0; - padding: 4px; - border: solid var(--border-color); - border-width: 0 1px 1px 0; - } - } + td, + th { + padding: 0; } - tbody { - - tr { - margin: 0; - - td { - padding: 4px; - border: solid var(--border-color); - border-width: 0 1px 1px 0; - } - } - + th { + font-weight: 600; } + + td, + th { + padding: 6px 13px; + border: 1px solid #dfe2e5; + } + + tr { + //background-color: #fff; + border-top: 1px solid #c6cbd1; + } + + tr:nth-child(2n) { + //background-color: #f6f8fa; + } + + } - } diff --git a/source/css/layout/common/variables.styl b/source/css/layout/common/variables.styl index 8a81a79..ad23b4b 100644 --- a/source/css/layout/common/variables.styl +++ b/source/css/layout/common/variables.styl @@ -25,23 +25,23 @@ $z-index-6 = 1006; // color // =============================== // normal mode color -$primary-color = #a13b17; // 主题颜色 +$primary-color = #62bbbd; // 主题颜色 $background-color = #fcfcfc; // 背景颜色 $normal-text-color = #515061; // 通用文本颜色(默认字体颜色) $first-text-color = darken($normal-text-color, 20%); // 第一文本颜色 $second-text-color = darken($normal-text-color, 10%); // 第二文本颜色 -$third-text-color = lighten($normal-text-color, 20%); // 第三文本颜色 +$third-text-color = lighten($normal-text-color, 30%); // 第三文本颜色 $border-color = darken($background-color, 15%); // 边框颜色 $selection-color = lighten($primary-color, 8%); // dark mode color $dark-primary-color = $primary-color; -$dark-background-color = #444; +$dark-background-color = #3a3a3a; $dark-normal-text-color = #bbb; $dark-first-text-color = lighten($dark-normal-text-color, 30%); $dark-second-text-color = lighten($dark-normal-text-color, 20%); $dark-third-text-color = darken($dark-normal-text-color, 20%); -$dark-border-color = lighten($dark-background-color, 15%); +$dark-border-color = lighten($dark-background-color, 20%); $dark-selection-color = $selection-color; diff --git a/source/css/layout/home-content.styl b/source/css/layout/home-content.styl index 136bb3d..00cf73a 100644 --- a/source/css/layout/home-content.styl +++ b/source/css/layout/home-content.styl @@ -18,15 +18,15 @@ top: 50%; transform: translateY(-50%); left: -16px; - width: 2px; - height: 20px; + width: 3px; + height: 22px; background: $primary-color; transition: all 0.5s ease; } font-weight: 600; color: var(--second-text-color); - font-size: 22px; + font-size: 1.5em; margin: 0; a { @@ -43,18 +43,28 @@ display: flex; justify-content: space-between; align-items: center; + color: var(--third-text-color); + font-size: 0.9em; - span { - letter-spacing: 1px; + span.article-date { + letter-spacing: 0.5px; } hr { border: none; flex: 1; height: 1px; - background: $border-color; + background: var(--border-color); margin: 0 10px; } + + a { + color: var(--third-text-color); + + &:hover { + color: var(--primary-color) + } + } } } diff --git a/source/css/layout/page.styl b/source/css/layout/page.styl index 6137b27..a8058e0 100644 --- a/source/css/layout/page.styl +++ b/source/css/layout/page.styl @@ -50,7 +50,7 @@ color: var(--frist-text-color); i { - font-size: 16px; + font-size: 1.2em; } } } diff --git a/source/css/layout/tag-content.styl b/source/css/layout/tag-content.styl index 004f55a..f8858bc 100644 --- a/source/css/layout/tag-content.styl +++ b/source/css/layout/tag-content.styl @@ -3,8 +3,8 @@ .tag-container { .tag-name { color: var(--second-text-color); - font-size 20px - font-weight 600 - margin-bottom 10px + font-size: 1.6em; + font-weight: 600; + margin-bottom: 32px; } } \ No newline at end of file diff --git a/source/js/main.js b/source/js/main.js index 97cf980..8620d25 100644 --- a/source/js/main.js +++ b/source/js/main.js @@ -1,3 +1,3 @@ window.addEventListener('DOMContentLoaded', () => { - console.log(`${CONFIG.themeName} v${CONFIG.themeVersion}`); + console.log(`${CONFIG.themeInfo.name} v${CONFIG.themeInfo.version}`); }); \ No newline at end of file diff --git a/source/js/scroll-to-top.js b/source/js/scroll-to-top.js index 174c3cb..ef09e6a 100644 --- a/source/js/scroll-to-top.js +++ b/source/js/scroll-to-top.js @@ -1,7 +1,7 @@ scrollToTopDom.addEventListener('click', () => { let scrollTopTimer = setInterval(function () { let top = document.body.scrollTop || document.documentElement.scrollTop; - let speed = top / 4; + let speed = top / 3; if (document.body.scrollTop !== 0) { document.body.scrollTop -= speed; } else { @@ -11,5 +11,4 @@ scrollToTopDom.addEventListener('click', () => { clearInterval(scrollTopTimer); } }, 30); -}); - +}); \ No newline at end of file${left}-${right}-