diff --git a/layout/_layout.pug b/layout/_layout.pug index f74ba771ac95af0d02e544227a710dba0ee3ff13..caed7a4c2fcad2bcaf3ce9470e574e5f1381d372 100644 --- a/layout/_layout.pug +++ b/layout/_layout.pug @@ -19,17 +19,17 @@ html(lang=config.language) main#main.main div.main-inner - div#content.content - div.content-inner(class=`${is_home() ? 'content-home' : ''}`) + div#content-wrap.content-wrap + div.content(class=`${is_home() ? 'content-home' : ''}`) block content + if page.comments + include ./_partials/widgets/comments.pug + aside#sidebar.sidebar div.sidebar-inner != partial('./_partials/sidebar/sidebar.pug', null, { cache: theme.cache }) - if page.comments - include ./_partials/widgets/comments.pug - div.clearfix footer#footer.footer diff --git a/layout/_third-party/pjax.pug b/layout/_third-party/pjax.pug index 68897e29bee56c7b431b82601bc34b134315cffd..cd3690514801959ce5f5c8fd8faa5f564210cdee 100644 --- a/layout/_third-party/pjax.pug +++ b/layout/_third-party/pjax.pug @@ -46,6 +46,8 @@ script. // 重置页面 Y 方向上的滚动偏移量 document.addEventListener('pjax:send', function () { + $('.header-nav-menu').removeClass('show'); + $('html').velocity('scroll', { duration: 500, offset: $('#header').height(), diff --git a/layout/page.pug b/layout/page.pug index fa854c228bc847c00dcae8d37571c59200ab5d3e..61598a2f4a6c6a59a42a5cfec22bec8d59bd4e66 100644 --- a/layout/page.pug +++ b/layout/page.pug @@ -17,13 +17,8 @@ block content div.category-total= __("page.categories") + " - " span= site.categories.length != list_categories() - else if (page.type === "about") - div.about - if page.photos && page.photos.length - +gallery(page) - != page.content else - div.custom + div.custom-page if page.photos && page.photos.length +gallery(page) != page.content diff --git a/source/css/_common/components/pages/page.styl b/source/css/_common/components/pages/page.styl index e2c8589e1a789617706fc08fdb9e6c09d1804f27..cf43d0ef082c4e2078d617ed56efbf38477acf18 100644 --- a/source/css/_common/components/pages/page.styl +++ b/source/css/_common/components/pages/page.styl @@ -1,27 +1,15 @@ .archive { - position: relative; - margin: 0 0 0 1rem; - - &::before { - content: ''; - position: absolute; - top: $font-size-main; - bottom: $font-size-main; - left: 0; - border-left: .3rem dashed $post-timeline-line-color; - transform: translateX(-50%); - } + margin-left: 1rem; &-total { position: relative; - margin-bottom: 1.5rem; - padding-left: 1.5rem; - font-size: 1.2em; + padding: 0 0 1.5rem 1.5rem; + font-size: calc(1em + 2px); &::before { content: ''; position: absolute; - top: 50%; + top: 1em; left: 0; z-index: $z-index0; border: .2rem solid $post-timeline-dot-color; @@ -32,6 +20,16 @@ transform: translate(-50%, -50%); } + &::after { + content: ''; + position: absolute; + top: 1em; + bottom: 0; + left: 0; + border-left: .3rem dashed $post-timeline-line-color; + transform: translateX(-50%); + } + &:hover { &::before { border-color: $post-timeline-dot-hover-color; @@ -40,10 +38,16 @@ } } +.custom-page { + width: 100%; +} + .tagcloud, .category { + width: 100%; + &-total { - font-size: $font-size-base + 10px; + font-size: calc(1em + 10px); text-align: center; cursor: default; } diff --git a/source/css/_common/components/plugins/friends.styl b/source/css/_common/components/plugins/friends.styl index d54b308f85b4ad82a8e89c00fcc53a28d1707c28..dc0255490ad2589dd98488650e1823afce33c568 100644 --- a/source/css/_common/components/plugins/friends.styl +++ b/source/css/_common/components/plugins/friends.styl @@ -5,7 +5,7 @@ &__item { display: block; float: left; - padding: .5rem; + padding: .5rem 1rem; width: 50%; height: 100px; transition: background-color .3s; diff --git a/source/css/_common/components/post/post-list.styl b/source/css/_common/components/post/post-list.styl index 4f1664eac2842a662344979c8e0905a92e104c25..7a21df9675228b4fe277a6253a26b9c5679b3ad5 100644 --- a/source/css/_common/components/post/post-list.styl +++ b/source/css/_common/components/post/post-list.styl @@ -3,10 +3,8 @@ .post-list { .post { margin: 0 0 1.5rem; - border-radius: 5px; - padding: 1.5rem 2rem; width: 100%; - background-color: $white; + layout-card(); &-body { &-more { diff --git a/source/css/_common/components/widgets/comments.styl b/source/css/_common/components/widgets/comments.styl index 92a8f9df8fb3fc62bd9192d1a8f39a8e2e895ee1..717181455902f860578ff963c84479e6a3c9c42b 100644 --- a/source/css/_common/components/widgets/comments.styl +++ b/source/css/_common/components/widgets/comments.styl @@ -1,7 +1,7 @@ if (hexo-config('gitalk.enable') || hexo-config('valine.enable') || hexo-config('livere.enable') || hexo-config('disqus.enable')) { .comments { margin: 1.5rem 0 0; - width: $content-width; + width: 100%; layout-card(); if (hexo-config('sidebar.position') == 'left') { diff --git a/source/css/_common/components/widgets/pagination.styl b/source/css/_common/components/widgets/pagination.styl index 5129a5a775b247d220f8cd7b02cdb639e291a0b8..6c6da89dd7e46d294297d4c3b4e89e3878356a9b 100644 --- a/source/css/_common/components/widgets/pagination.styl +++ b/source/css/_common/components/widgets/pagination.styl @@ -2,10 +2,10 @@ margin-top: 1.5em; border-radius: 5px; text-align: center; - background-color: $white; &-inner { padding: .8em 0; + background-color: $white; } .space, diff --git a/source/css/_common/outline/macro.styl b/source/css/_common/outline/macro.styl index 2dd0f2ea98561975972be8df4fcb1e5645ee7823..586f17856c90ca61eb63b77fb26719c2943f52ee 100644 --- a/source/css/_common/outline/macro.styl +++ b/source/css/_common/outline/macro.styl @@ -39,7 +39,7 @@ if (hexo-config('sidebar.enable')) { } } -.content { +.content-wrap { width: 'calc(100% - %s)' % ($sidebar-width + $main-sidebar-gap); if (hexo-config('sidebar.position') == 'left') { @@ -47,51 +47,50 @@ if (hexo-config('sidebar.enable')) { } else if (hexo-config('sidebar.position') == 'right') { float: left; } +} - &-inner { - width: 100%; - height: 100%; - layout-card(); +.content { + width: 100%; + layout-card(); - img { - border: 1px solid $img-border-color; - border-radius: 3px; - padding: .2rem; - } + img { + border: 1px solid $img-border-color; + border-radius: 3px; + padding: .2rem; + } - .post-body { - if (hexo-config('heading_line')) { - h1, - h2 { - border-bottom: 1px solid $heading-line-color; - padding-bottom: .3em; - } + .post-body { + if (hexo-config('heading_line')) { + h1, + h2 { + border-bottom: 1px solid $heading-line-color; + padding-bottom: .3em; } } + } - .table-container { - overflow: auto; - margin-bottom: 1rem; - } + .table-container { + overflow: auto; + margin-bottom: 1rem; + } - .heading-link { - color: $heading-color; - cursor: pointer; + .heading-link { + color: $heading-color; + cursor: pointer; + + &::after { + content: $icon-heading-link; + margin-left: .3em; + color: $heading-logo-color; + opacity: 0; + transition-property: opacity; + transition-ease(); + fontawesome-base(); + } + &:hover { &::after { - content: $icon-heading-link; - margin-left: .3em; - color: $heading-logo-color; - opacity: 0; - transition-property: opacity; - transition-ease(); - fontawesome-base(); - } - - &:hover { - &::after { - opacity: 1; - } + opacity: 1; } } } diff --git a/source/css/_common/responsive.styl b/source/css/_common/responsive.styl index dea7d1fe9785e1eb0dba3f14ac4c880c810c245b..83d3e0d4818760c3dd518c3279d21e383272f3f3 100644 --- a/source/css/_common/responsive.styl +++ b/source/css/_common/responsive.styl @@ -28,7 +28,7 @@ margin: 1rem 0; } - .content { + .content-wrap { width: 100%; } @@ -129,13 +129,24 @@ width: 100%; } - .content-inner { + .content, + .comments { padding: .6rem .8rem; font-size: $font-size-base; } .archive { margin-left: .5rem; + + &-total { + padding-left: 1rem; + } + } + + .post-timeline { + &-item { + padding-left: 1rem; + } } .header-nav-search { @@ -160,7 +171,7 @@ } .friends-plugin { - .friends-item { + &__item { margin: 0; padding: .5rem 1rem; width: 100%; diff --git a/source/css/_common/scaffolding/base.styl b/source/css/_common/scaffolding/base.styl index 2826801926b6c8bb829a05248870bc606d9fc57b..3992e14ab1db4e616871b1026a293e1224619f3d 100644 --- a/source/css/_common/scaffolding/base.styl +++ b/source/css/_common/scaffolding/base.styl @@ -32,7 +32,7 @@ h5, h6 { padding: 0; font-family: $font-family-heading; - font-weight: $font-weight-bold; + font-weight: $font-weight-bolder; line-height: $line-height-heading; } @@ -58,6 +58,10 @@ a { } } +ul { + padding-left: 1.5em; +} + img, video, iframe { diff --git a/source/js/scroll.js b/source/js/scroll.js index 95483c4e96f0818e5dad1e6ff0e7bb3940728080..1349c0294692d58cf54375d6d33fb38530016c05 100644 --- a/source/js/scroll.js +++ b/source/js/scroll.js @@ -89,7 +89,7 @@ $(document).ready(function () { Stun.utils.pjaxReloadScroll = function () { // Click the heading. - $('#content') + $('#content-wrap') .find('h1,h2,h3,h4,h5,h6') .on('click', function () { scrollHeadingToTop('#' + $(this).attr('id')); diff --git a/source/js/sidebar.js b/source/js/sidebar.js index 954b8e108ea703d23c8cfafd675edf8c08d7b68f..716f74dd9fd71ceb067e22598f362c7f1fd94a89 100644 --- a/source/js/sidebar.js +++ b/source/js/sidebar.js @@ -103,7 +103,7 @@ $(document).ready(function () { // Update the reading progress lines of post. function readProgress () { - var $post = $('#content'); + var $post = $('#content-wrap'); var scrollH = ($post[0] && $post[0].getBoundingClientRect().top * -1) || 0; @@ -138,7 +138,7 @@ $(document).ready(function () { var $navOv = $('.sidebar-nav-ov'); var $tocWrap = $('.sidebar-toc'); var $overview = $('.sidebar-ov'); - + $navToc.on('click', function () { if ($(this).hasClass('current')) return; diff --git a/source/js/utils.js b/source/js/utils.js index bb698e6c586d53210c0737abd5fceefe83081515..e094e7f8cc129dd004ad81b52e319a91cc63ef7c 100644 --- a/source/js/utils.js +++ b/source/js/utils.js @@ -304,7 +304,7 @@ Stun.utils = Stun.$u = { }, // Click to zoom in image, without fancybox. registerClickToZoomImage: function () { - $('#content img').not(':hidden').each(function () { + $('#content-wrap img').not(':hidden').each(function () { $(this).addClass('zoom-image'); });