From d97dc32c5ebd866b8b5bcb5bdf6f3bd53509d458 Mon Sep 17 00:00:00 2001 From: Mimi <1119186082@qq.com> Date: Thu, 10 Jan 2019 23:55:02 +0800 Subject: [PATCH] Fix #573: [Muse & Mist] Footer is not at the bottom of the page (#574) --- layout/_macro/post-collapse.swig | 2 +- layout/_macro/post.swig | 6 +++--- layout/_scripts/schemes/mist.swig | 1 + layout/_scripts/schemes/muse.swig | 9 +++++++++ .../css/_common/components/footer/footer.styl | 18 ++---------------- .../components/highlight/highlight.styl | 1 - .../components/sidebar/sidebar-nav.styl | 1 + .../_common/components/sidebar/sidebar.styl | 14 ++++++++++++++ .../_common/components/sidebar/site-state.styl | 1 + source/css/_common/outline/outline.styl | 1 - source/css/_common/scaffolding/base.styl | 1 - source/css/_common/scaffolding/mobile.styl | 1 - source/js/src/schemes/muse.js | 9 +++++++++ source/js/src/utils.js | 1 - 14 files changed, 41 insertions(+), 25 deletions(-) create mode 100644 source/js/src/schemes/muse.js diff --git a/layout/_macro/post-collapse.swig b/layout/_macro/post-collapse.swig index e2a3b99225..528edee7c7 100644 --- a/layout/_macro/post-collapse.swig +++ b/layout/_macro/post-collapse.swig @@ -22,7 +22,7 @@
diff --git a/layout/_macro/post.swig b/layout/_macro/post.swig index 97d92b9e84..3e81d806c4 100644 --- a/layout/_macro/post.swig +++ b/layout/_macro/post.swig @@ -113,7 +113,7 @@ {% if post.categories and post.categories.length and theme.post_meta.categories %} - + {% if theme.post_meta.created_at or theme.post_meta.updated_at %} {% endif %} diff --git a/layout/_scripts/schemes/mist.swig b/layout/_scripts/schemes/mist.swig index e69de29bb2..e18aaff235 100644 --- a/layout/_scripts/schemes/mist.swig +++ b/layout/_scripts/schemes/mist.swig @@ -0,0 +1 @@ +{% include 'muse.swig' %} diff --git a/layout/_scripts/schemes/muse.swig b/layout/_scripts/schemes/muse.swig index e69de29bb2..0e94a1e2d1 100644 --- a/layout/_scripts/schemes/muse.swig +++ b/layout/_scripts/schemes/muse.swig @@ -0,0 +1,9 @@ +{% + set scripts = [ + 'src/schemes/muse.js' + ] +%} + +{% for script in scripts %} + +{% endfor %} diff --git a/source/css/_common/components/footer/footer.styl b/source/css/_common/components/footer/footer.styl index a49636ce7d..f3f3775722 100644 --- a/source/css/_common/components/footer/footer.styl +++ b/source/css/_common/components/footer/footer.styl @@ -10,8 +10,8 @@ @keyframes iconAnimate { 0%, 100% { transform: scale(1); } 10%, 30% { transform: scale(0.9); } - 20%, 40%, 60%, 80% {transform: scale(1.1); } - 50%, 70% {transform: scale(1.1); } + 20%, 40%, 60%, 80% { transform: scale(1.1); } + 50%, 70% { transform: scale(1.1); } } if hexo-config('footer.icon.animated') { @@ -28,17 +28,3 @@ if hexo-config('footer.icon.animated') { .powered-by, .theme-info { display: inline-block; } - -.cc-license { - margin-top: 10px; - text-align: center; - - .cc-opacity { - opacity: 0.7; - border-bottom: none; - - &:hover { opacity: 0.9; } - } - - img { display: inline-block; } -} diff --git a/source/css/_common/components/highlight/highlight.styl b/source/css/_common/components/highlight/highlight.styl index ca33e22348..f23ab67f4e 100644 --- a/source/css/_common/components/highlight/highlight.styl +++ b/source/css/_common/components/highlight/highlight.styl @@ -96,7 +96,6 @@ pre { .line { height: 20px; } } - .gutter { -webkit-user-select: none; -moz-user-select: none; diff --git a/source/css/_common/components/sidebar/sidebar-nav.styl b/source/css/_common/components/sidebar/sidebar-nav.styl index 973eda70f1..cfdb0f196b 100644 --- a/source/css/_common/components/sidebar/sidebar-nav.styl +++ b/source/css/_common/components/sidebar/sidebar-nav.styl @@ -4,6 +4,7 @@ margin: 0 0 20px; padding-left: 0; } + .sidebar-nav li { display: inline-block; cursor: pointer; diff --git a/source/css/_common/components/sidebar/sidebar.styl b/source/css/_common/components/sidebar/sidebar.styl index 70b3dcbacc..ca4cbb7f84 100644 --- a/source/css/_common/components/sidebar/sidebar.styl +++ b/source/css/_common/components/sidebar/sidebar.styl @@ -40,6 +40,20 @@ overflow-x: hidden; } +.cc-license { + margin-top: 10px; + text-align: center; + + .cc-opacity { + opacity: 0.7; + border-bottom: none; + + &:hover { opacity: 0.9; } + } + + img { display: inline-block; } +} + @import "sidebar-toggle"; @import "sidebar-author"; @import "site-state"; diff --git a/source/css/_common/components/sidebar/site-state.styl b/source/css/_common/components/sidebar/site-state.styl index c05b0ea09b..a4cafb4587 100644 --- a/source/css/_common/components/sidebar/site-state.styl +++ b/source/css/_common/components/sidebar/site-state.styl @@ -14,6 +14,7 @@ a { border-bottom: none; } } + .site-state-item-count { display: block; text-align: center; diff --git a/source/css/_common/outline/outline.styl b/source/css/_common/outline/outline.styl index 77deedb76c..b0ac5f36a1 100644 --- a/source/css/_common/outline/outline.styl +++ b/source/css/_common/outline/outline.styl @@ -9,7 +9,6 @@ html, body { height: 100%; } .container { position: relative; - min-height: 100%; } diff --git a/source/css/_common/scaffolding/base.styl b/source/css/_common/scaffolding/base.styl index ffa13da817..dd18b4c106 100644 --- a/source/css/_common/scaffolding/base.styl +++ b/source/css/_common/scaffolding/base.styl @@ -76,7 +76,6 @@ img { height: auto; } - hr { margin: 40px 0; height: 3px; diff --git a/source/css/_common/scaffolding/mobile.styl b/source/css/_common/scaffolding/mobile.styl index eb02ef6a90..576f46f5b1 100644 --- a/source/css/_common/scaffolding/mobile.styl +++ b/source/css/_common/scaffolding/mobile.styl @@ -14,7 +14,6 @@ } - // < 767px +mobile() { diff --git a/source/js/src/schemes/muse.js b/source/js/src/schemes/muse.js new file mode 100644 index 0000000000..a0e2c5662f --- /dev/null +++ b/source/js/src/schemes/muse.js @@ -0,0 +1,9 @@ +$(document).ready(function() { + function updateFooterPosition() { + var containerHeight = $('#footer').attr('position') ? $('.container').height() + $('#footer').outerHeight(true) : $('.container').height(); + if (containerHeight < window.innerHeight) $('#footer').css({ 'position': 'fixed', 'bottom': 0, 'left': 0, 'right': 0 }).attr('position', 'fixed'); + else $('#footer').removeAttr('style position'); + } + updateFooterPosition(); + $(window).on('resize scroll', updateFooterPosition); +}); diff --git a/source/js/src/utils.js b/source/js/src/utils.js index 2ab8f3c820..01886d8512 100644 --- a/source/js/src/utils.js +++ b/source/js/src/utils.js @@ -295,7 +295,6 @@ $(document).ready(function() { * Init Sidebar & TOC inner dimensions on all pages and for all schemes. * Need for Sidebar/TOC inner scrolling if content taller then viewport. */ - function updateSidebarHeight(height) { height = height || 'auto'; $('.site-overview, .post-toc').css('max-height', height); {% endif %} @@ -175,7 +175,7 @@ {% else %} - + {% endif %} {% elseif is_post() and theme.gitment.enable and theme.gitment.mint and theme.gitment.count %} @@ -221,7 +221,7 @@ {% if not theme.post_meta.item_text %} title="{{ __('post.views') }}" {% endif %}> {% if theme.post_meta.item_text %} {{ __('post.views') + __('symbol.colon') }} {% endif %} - +