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:
parent
8623aa4792
commit
e7b34b5e1d
4 changed files with 20 additions and 0 deletions
|
@ -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">
|
||||
|
|
5
layouts/partials/arrow.html
Normal file
5
layouts/partials/arrow.html
Normal 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 |
2
layouts/partials/head.html
Normal file
2
layouts/partials/head.html
Normal file
|
@ -0,0 +1,2 @@
|
|||
<!--back to top-->
|
||||
<span id="top"></span>
|
|
@ -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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue