Add one-click return to the top function on the article page

Signed-off-by: Ray <Chow-Ray@outlook.com>
This commit is contained in:
Ray 2021-01-06 23:23:09 +08:00
parent 8623aa4792
commit e7b34b5e1d
No known key found for this signature in database
GPG key ID: 09145848F23A5994
4 changed files with 20 additions and 0 deletions

View file

@ -31,6 +31,8 @@
{{ end }}
{{ define "content" }}
<!--back to top-->
<a href="#top" class="backtop">{{ partial "arrow.html" . }}</a>
<section class="content-section" id="content-section">
<div class="content">
<div class="container p-0 read-area">

View file

@ -0,0 +1,5 @@
<!--Back to top-->
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="chevron-circle-up" class="svg-inline--fa fa-chevron-circle-up fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
<path fill="currentColor" d="M8 256C8 119 119 8 256 8s248 111 248 248-111 248-248 248S8 393 8 256zm231-113.9L103.5 277.6c-9.4 9.4-9.4 24.6 0 33.9l17 17c9.4 9.4 24.6 9.4 33.9 0L256 226.9l101.6 101.6c9.4 9.4 24.6 9.4 33.9 0l17-17c9.4-9.4 9.4-24.6 0-33.9L273 142.1c-9.4-9.4-24.6-9.4-34 0z">
</path>
</svg>

After

Width:  |  Height:  |  Size: 540 B

View file

@ -0,0 +1,2 @@
<!--back to top-->
<span id="top"></span>

View file

@ -44,3 +44,14 @@
/* iPhone 5 or before */
@media only screen and (max-width: 320px) {
}
/* Back to top */
.backtop {
color: #b3b1b1;
position: fixed;
right: 16px;
bottom: 16px;
width: 32px;
height: 32px;
z-index: 999998;
}