123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- <!DOCTYPE html>
- <html lang="zh">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
- {% block font %}
- <link rel="preconnect" href="https://fonts.googleapis.com">
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
- <link href="https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@100;400&display=swap" rel="stylesheet">
- {% endblock %}
- {% block style %}
- <link href="https://cdn.staticfile.org/bootstrap/4.6.1/css/bootstrap.min.css" rel="stylesheet">
- <link href="{{ url_for('static', filename='styles/base.css') }}" rel="stylesheet">
- <style>
- html {
- font-family: 'Noto Sans SC', sans-serif;
- }
- body{
- background-color: #f0fcff;
- }
- </style>
- {% endblock %}
- <title>{% block title %} {% endblock %} - {{ blog_name }} </title>
- </head>
- <body>
- {% block nav %}
- <h1 class="text-center mt-2"> 《{{ blog_name }}》—— <small>{{ blog_describe }}</small> </h1>
- <header>
- <nav>
- <ul class="nav nav-tabs justify-content-center mt-3" id="top-nav">
- <li class="nav-item">
- <a href="{{ url_for('base.index_page') }}" class="nav-link {{ top_nav[0] }}">
- 首页
- </a>
- </li>
- {% if current_user.check_role("ReadBlog") %}
- <li class="nav-item">
- <a href="{{ url_for('archive.archive_page') }}" class="nav-link {{ top_nav[1] }}">
- 归档
- </a>
- </li>
- <li class="nav-item">
- <a href="{{ url_for('docx.docx_page', page=1) }}" class="nav-link {{ top_nav[2] }}">
- 文章
- </a>
- </li>
- {% endif %}
- <li class="nav-item">
- <a href="{{ url_for('msg.msg_page', page=1) }}" class="nav-link {{ top_nav[3] }}">
- 留言
- </a>
- </li>
- <li class="nav-item">
- <a href="{{ url_for('about_me.about_me_page') }}" class="nav-link {{ top_nav[4] }}">
- 关于我
- </a>
- </li>
- <li class="nav-item">
- {% if current_user.is_authenticated %}
- <a href="{{ url_for('auth.yours_page') }}" class="nav-link {{ top_nav[5] }}">
- 你的
- </a>
- {% else %}
- <a href="{{ url_for('auth.login_page') }}" class="nav-link {{ top_nav[5] }}">
- 登录
- </a>
- {% endif %}
- </li>
- </ul>
- </nav>
- <section class="container mt-2 mb-2">
- {% for message in get_flashed_messages() %}
- <div class="alert alert-info">
- <button type="button" class="close" data-dismiss="alert">×</button>
- {{ message }}
- </div>
- {% endfor %}
- </section>
- </header>
- {% endblock %}
- <div id="context" class="mb-2">
- {% block context %} {% endblock %}
- </div>
- {% block footer %}
- <footer id="foot">
- <hr>
- {{ conf['foot-info'] }}
- </footer>
- <script>
- let context = document.getElementById('context')
- let foot = document.getElementById('foot')
- let context_height = context.getBoundingClientRect().bottom
- let win_height = 0
- if (window.innerHeight)
- win_height = window.innerHeight;
- else if ((document.body) && (document.body.clientHeight))
- win_height = document.body.clientHeight;
- console.log(context_height, win_height, foot.clientHeight, (win_height - context_height - foot.clientHeight).toString())
- if (win_height - context_height - foot.clientHeight <= 0)
- foot.style.marginTop = "0"
- else {
- foot.style.marginTop = (win_height - context_height - foot.clientHeight).toString() + "px"
- console.log(foot.style.marginTop)
- console.log("HAHAH")
- }
- </script>
- {% endblock %}
- {% block javascript %}
- <script src="https://cdn.staticfile.org/popper.js/0.2.0/popper.min.js"></script>
- <script src="https://cdn.staticfile.org/jquery/1.10.0/jquery.min.js"></script>
- <script src="https://cdn.staticfile.org/bootstrap/4.6.1/js/bootstrap.min.js"></script>
- {% endblock %}
- </body>
- </html>
|