Remove .container

This commit is contained in:
Mimi 2020-08-08 18:00:34 +08:00
parent acc5a74268
commit 9ec4d87ddc
5 changed files with 29 additions and 36 deletions

View File

@ -9,37 +9,35 @@
{{ partial('_scripts/noscript.njk', {}, {cache: theme.cache.enable}) }}
</head>
<body itemscope itemtype="http://schema.org/WebPage">
<div class="container{%- if theme.motion.enable %} use-motion{%- endif %}">
<div class="headband"></div>
<body itemscope itemtype="http://schema.org/WebPage"{% if theme.motion.enable %} class="use-motion"{% endif %}>
<div class="headband"></div>
<main class="main">
<header class="header" itemscope itemtype="http://schema.org/WPHeader">
<div class="header-inner">{% include '_partials/header/index.njk' %}</div>
{%- if theme.sidebar.display !== 'remove' %}
{% block sidebar %}{% endblock %}
{%- endif %}
</header>
<main class="main">
<header class="header" itemscope itemtype="http://schema.org/WPHeader">
<div class="header-inner">{% include '_partials/header/index.njk' %}</div>
{%- if theme.sidebar.display !== 'remove' %}
{% block sidebar %}{% endblock %}
{%- endif %}
</header>
{{ partial('_partials/widgets.njk', {}, {cache: theme.cache.enable}) }}
{{ partial('_partials/widgets.njk', {}, {cache: theme.cache.enable}) }}
<div class="main-inner">
{% include '_partials/header/sub-menu.njk' %}
<div class="content {% block class %}{% endblock %}">
{% block content %}{% endblock %}
</div>
{% include '_partials/comments.njk' %}
<div class="main-inner">
{% include '_partials/header/sub-menu.njk' %}
<div class="content {% block class %}{% endblock %}">
{% block content %}{% endblock %}
</div>
</main>
{% include '_partials/comments.njk' %}
</div>
</main>
<footer class="footer">
<div class="footer-inner">
{% include '_partials/languages.njk' %}
{{ partial('_partials/footer.njk', {}, {cache: theme.cache.enable}) }}
{{ partial('_third-party/statistics/index.njk', {}, {cache: theme.cache.enable}) }}
</div>
</footer>
</div>
<footer class="footer">
<div class="footer-inner">
{% include '_partials/languages.njk' %}
{{ partial('_partials/footer.njk', {}, {cache: theme.cache.enable}) }}
{{ partial('_third-party/statistics/index.njk', {}, {cache: theme.cache.enable}) }}
</div>
</footer>
{{ partial('_scripts/index.njk', {}, {cache: theme.cache.enable}) }}
{{ partial('_third-party/index.njk', {}, {cache: theme.cache.enable}) }}

View File

@ -1,8 +1,3 @@
.container {
min-height: 100%;
position: relative;
}
@import 'header';
@import 'sidebar';
@import 'footer';

View File

@ -13,6 +13,8 @@ body {
font-family: $font-family-base;
font-size: $font-size-base;
line-height: $line-height-base;
min-height: 100%;
position: relative;
transition: all $transition-ease;
}

View File

@ -1,7 +1,7 @@
if (hexo-config('sidebar.position') == 'right') {
.sidebar-active {
+desktop() {
padding-right: $sidebar-desktop;
margin-right: $sidebar-desktop;
}
}
@ -15,7 +15,7 @@ if (hexo-config('sidebar.position') == 'right') {
} else {
.sidebar-active {
+desktop() {
padding-left: $sidebar-desktop;
margin-left: $sidebar-desktop;
}
}

View File

@ -145,9 +145,7 @@ NexT.utils = {
// For init back to top in sidebar if page was scrolled after page refresh.
window.addEventListener('scroll', () => {
if (backToTop || readingProgressBar) {
const docHeight = document.querySelector('.container').offsetHeight;
const winHeight = window.innerHeight;
const contentHeight = docHeight > winHeight ? docHeight - winHeight : document.body.scrollHeight - winHeight;
const contentHeight = document.body.scrollHeight - window.innerHeight;
const scrollPercent = contentHeight > 0 ? Math.min(100 * window.scrollY / contentHeight, 100) : 0;
if (backToTop) {
backToTop.classList.toggle('back-to-top-on', Math.round(scrollPercent) >= 5);