Unverified Commit 0919b6c3 authored by ir1d's avatar ir1d Committed by GitHub
Browse files

Merge pull request #274 from frank-xjh/master

Feat: back to top
parents 76ac94ef 1f38ce8d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -20,5 +20,6 @@ sed -i 's/fonts.gstatic.com/gstatic.loli.net/g' mkdocs-material/material/base.ht
sed -i 's/fonts.googleapis.com/fonts.loli.net/g' mkdocs-material/material/base.html
sed -i 's/{{ page.content }}/{% set pagetime = config.extra.pagetime %} {% if page and page.meta and page.meta.pagetime is string %} {% set pagetime = page.meta.pagetime %} {% endif %}{% if pagetime %}<blockquote class="page-time"><\/blockquote>{% endif %}\n                {{ page.content }}/g' mkdocs-material/material/base.html
cp ./static/disqus.html mkdocs-material/material/partials/integrations/disqus.html
cp ./static/footer.html mkdocs-material/material/partials/footer.html

mkdocs build -v
 No newline at end of file
+17 −0
Original line number Diff line number Diff line
@@ -11,3 +11,20 @@ blockquote.page-time{
  padding-left: 1.5rem;
  border-left: 5px solid #64b5f6; /* Just change the color value and that's it*/
}
#myBtn {
    display: none;
    position: fixed; 
    bottom: 3rem; 
    right: 4rem; 
    z-index: 99; 
    border: none;
    outline: none; 
    color: #8590a6;
    cursor: pointer; 
    padding: .7rem; 
    border-radius: .4rem;
}
 
#myBtn:hover {
    background-color: #d3d3d3; 
}
 No newline at end of file
+0 −1
Original line number Diff line number Diff line
@@ -217,7 +217,6 @@ theme:
  palette:
    primary: 'white'
    accent: 'red'

  include_search_page: false
  search_index_only: true

static/footer.html

0 → 100644
+129 −0
Original line number Diff line number Diff line
<!--
  Copyright (c) 2016-2018 Martin Donath <martin.donath@squidfunk.com>

  Permission is hereby granted, free of charge, to any person obtaining a copy
  of this software and associated documentation files (the "Software"), to
  deal in the Software without restriction, including without limitation the
  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  sell copies of the Software, and to permit persons to whom the Software is
  furnished to do so, subject to the following conditions:

  The above copyright notice and this permission notice shall be included in
  all copies or substantial portions of the Software.

  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  IN THE SOFTWARE.
-->

{% import "partials/language.html" as lang with context %}

<!-- back to top -->
<link rel="stylesheet" href="https://npmcdn.com/data-tip@0.0.52/dist/data-tip.css">
<script>
// 当网页向下滑动 20px 出现"返回顶部" 按钮
window.onscroll = function() {scrollFunction()};
 
function scrollFunction() {console.log(121);
    if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
        document.getElementById("myBtn").style.display = "block";
    } else {
        document.getElementById("myBtn").style.display = "none";
    }
}
 
// 点击按钮,返回顶部
function topFunction() {
    document.body.scrollTop = 0;
    document.documentElement.scrollTop = 0;
}
</script>
<button onclick="topFunction()" id="myBtn" class="data-tip-left" data-tip="回到顶部">
  <svg class="Zi Zi--BackToTop data-tip-left" data-tip="回到顶部" fill="currentColor" viewBox="0 0 24 24" width="24" height="24"><path d="M16.036 19.59a1 1 0 0 1-.997.995H9.032a.996.996 0 0 1-.997-.996v-7.005H5.03c-1.1 0-1.36-.633-.578-1.416L11.33 4.29a1.003 1.003 0 0 1 1.412 0l6.878 6.88c.782.78.523 1.415-.58 1.415h-3.004v7.005z"></path></svg>
</button>


<!-- Application footer -->
<footer class="md-footer">

  <!-- Link to previous and/or next page -->
  {% if page.previous_page or page.next_page %}
    <div class="md-footer-nav">
      <nav class="md-footer-nav__inner md-grid">

        <!-- Link to previous page -->
        {% if page.previous_page %}
          <a href="{{ page.previous_page.url | url }}"
              title="{{ page.previous_page.title }}"
              class="md-flex md-footer-nav__link md-footer-nav__link--prev"
              rel="prev">
            <div class="md-flex__cell md-flex__cell--shrink">
              <i class="md-icon md-icon--arrow-back
                    md-footer-nav__button"></i>
            </div>
            <div class="md-flex__cell md-flex__cell--stretch
                  md-footer-nav__title">
              <span class="md-flex__ellipsis">
                <span class="md-footer-nav__direction">
                  {{ lang.t("footer.previous") }}
                </span>
                {{ page.previous_page.title }}
              </span>
            </div>
          </a>
        {% endif %}

        <!-- Link to next page -->
        {% if page.next_page %}
          <a href="{{ page.next_page.url | url }}"
              title="{{ page.next_page.title }}"
              class="md-flex md-footer-nav__link md-footer-nav__link--next"
              rel="next">
            <div class="md-flex__cell md-flex__cell--stretch
                  md-footer-nav__title">
              <span class="md-flex__ellipsis">
                <span class="md-footer-nav__direction">
                  {{ lang.t("footer.next") }}
                </span>
                {{ page.next_page.title }}
              </span>
            </div>
            <div class="md-flex__cell md-flex__cell--shrink">
              <i class="md-icon md-icon--arrow-forward
                    md-footer-nav__button"></i>
            </div>
          </a>
        {% endif %}
      </nav>
    </div>
  {% endif %}

  <!-- Further information -->
  <div class="md-footer-meta md-typeset">
    <div class="md-footer-meta__inner md-grid">

      <!-- Copyright and theme information -->
      <div class="md-footer-copyright">
        {% if config.copyright %}
          <div class="md-footer-copyright__highlight">
            {{ config.copyright }}
          </div>
        {% endif %}
        powered by
        <a href="https://www.mkdocs.org">MkDocs</a>
        and
        <a href="https://squidfunk.github.io/mkdocs-material/">
          Material for MkDocs</a>
      </div>

      <!-- Social links -->
      {% block social %}
        {% include "partials/social.html" %}
      {% endblock %}
    </div>
  </div>
</footer>
+1 −1

File changed.

Contains only whitespace changes.