pref: change back2top position

This commit is contained in:
XPoet 2020-09-05 23:08:03 +08:00
parent 999c97b883
commit 8cb7861da3
5 changed files with 16 additions and 18 deletions

View File

@ -17,5 +17,10 @@
<li class="page-aside-toggle"> <li class="page-aside-toggle">
<i class="fa fa-bars"></i> <i class="fa fa-bars"></i>
</li> </li>
<% if (theme.back2top.enable) { %>
<li class="scroll-to-top">
<i class="fa fa-caret-up"></i>
</li>
<% } %>
</ul> </ul>
</div> </div>

View File

@ -59,17 +59,7 @@
<%- partial('_partial/tools') %> <%- partial('_partial/tools') %>
</div> </div>
<% if (theme.back2top.enable) { %>
<div class="scroll-to-top">
<ul>
<li>
<span class="scroll-percent">
<i class="fa fa-caret-up"></i>
</span>
</li>
</ul>
</div>
<% } %>
<!-- page aside --> <!-- page aside -->
<aside class="page-aside"> <aside class="page-aside">

View File

@ -20,6 +20,10 @@ $li-margin-bottom = 12px;
margin-bottom: $li-margin-bottom; margin-bottom: $li-margin-bottom;
background: var(--background-color); background: var(--background-color);
&:last-child {
margin-bottom: 0;
}
if (hexo-config('magic.enable') == true) { if (hexo-config('magic.enable') == true) {
magic-style(1.1, 1.1); magic-style(1.1, 1.1);
} else { } else {
@ -32,7 +36,6 @@ $li-margin-bottom = 12px;
background: var(--primary-color); background: var(--primary-color);
} }
&.rss { &.rss {
a { a {
@ -52,8 +55,8 @@ $li-margin-bottom = 12px;
} }
&:last-child { &.scroll-to-top {
margin-bottom: 0; display: none;
} }
} }

View File

@ -151,7 +151,7 @@ $page-aside-width = 248px;
} }
.scroll-to-top { /*.scroll-to-top {
display: none; display: none;
position: fixed; position: fixed;
@ -186,6 +186,6 @@ $page-aside-width = 248px;
} }
} }
} }
*/
} }

View File

@ -33,7 +33,7 @@
scrollToTopDom.style.display = 'none'; scrollToTopDom.style.display = 'none';
headerProgressDom.style.display = 'none'; headerProgressDom.style.display = 'none';
} else { } else {
scrollToTopDom.style.display = 'block'; scrollToTopDom.style.display = 'flex';
// scrollPercentDom.innerHTML = parseInt(percent) < 10 ? `0${percent}` : percent; // scrollPercentDom.innerHTML = parseInt(percent) < 10 ? `0${percent}` : percent;
headerProgressDom.style.display = 'block'; headerProgressDom.style.display = 'block';