Add back to top button to all pages (#95)

This commit is contained in:
Alex Ling 2020-08-10 11:42:23 +00:00
parent 85a65f84d0
commit 3cdd4b29a5
2 changed files with 21 additions and 1 deletions

View File

@ -135,3 +135,20 @@ td>.uk-dropdown {
#select-bar-controls a:hover { #select-bar-controls a:hover {
color: orange; color: orange;
} }
#main-section {
position: relative;
}
#totop-wrapper {
position: absolute;
top: 100vh;
right: 2em;
bottom: 0;
}
#totop-wrapper a {
position: fixed;
position: sticky;
top: calc(100vh - 5em);
}

View File

@ -67,10 +67,13 @@
</div> </div>
<div class="uk-section uk-section-small"> <div class="uk-section uk-section-small">
</div> </div>
<div class="uk-section uk-section-small"> <div class="uk-section uk-section-small" id="main-section">
<div class="uk-container uk-container-small"> <div class="uk-container uk-container-small">
<div id="alert"></div> <div id="alert"></div>
<%= content %> <%= content %>
<div class="uk-visible@m" id="totop-wrapper" x-data="{}" x-show="$('body').height() > 1.5 * $(window).height()">
<a href="#" uk-totop uk-scroll></a>
</div>
</div> </div>
</div> </div>
<script> <script>