aboutsummaryrefslogtreecommitdiff
path: root/src/hydrilla_website/templates/website_base.html.jinja
blob: 777a3d388c673db0ed234a10e202f77489d21a5e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
{#
SPDX-License-Identifier: CC0-1.0

Proxy web UI base page template.

This file is part of Hydrilla&Haketilo.

Copyright (C) 2022 Wojtek Kosior <koszko@koszko.org>

Available under the terms of Creative Commons Zero v1.0 Universal.
#}
{% extends "base.html.jinja" %}

{% block head %}
  {{ super() }}
  <link rel="icon" type="image/x-icon" href="static/haketilo-favicon.ico">
  <title>
    {% block title %}
      {{ _('base.title.haketilo') }}
    {% endblock %}
  </title>
  <meta http-equiv="Content-Security-Policy"
        content="script-src 'none'; default-src 'self'">
  <meta name="viewport" content="width=device-width, initial-scale=1"/>
{% endblock head %}

{% block style %}
  {{ super() }}

  .nav-container {
      display: block;
      padding: 20px 10px;
  }

  nav {
      display: inline-flex;
      flex-direction: column;
      padding: 0;
      margin: auto;
      min-height: calc(100vh - 40px);
      justify-content: space-evenly;
  }

  nav > a {
      margin: 0;
  }

  .navigation-dots {
      display: none;
      padding: 20px 10px;
      position: absolute;
      right: 0;
      top: 0;
      opacity: 0.75;
  }

  .navigation-dots img {
      width: 10px;
      height: auto;
  }

  body {
      width: 100%;
  }

  .subpage {
      width: calc(100% - 20px);
      overflow: hidden;
      padding: 0 10px;
  }

  .subpage-layout {
      display: flex;
      width: calc(700px + 300px);
      margin: auto;
      position: relative;
      overflow: hidden;
  }

  @media screen and (max-width: 1020px) {
      .subpage-layout {
          width: 100%;
      }
  }

  .subpage:nth-child(2n) {
      background-color: #f6fff9;
  }

  .subpage-left-part {
      min-height: calc(100vh - 20px);
      flex: 1 1 700px;
      max-width: 700px;
      padding: 10px 0;
      display: flex;
      flex-direction: column;
      justify-content: center;
  }

  .subpage-main-contents {
      margin: 10px;
  }

  @media screen and (max-width: 500px) {
      .nav-container {
          position: absolute;
          right: -340px;
          /* border will cover the 3 dots */
          border-right: 30px solid white;
          border-left: 2px solid #f4f4f4;
          padding-right: 0;
          background-color: #ffffffc0;
          z-index: 1;
      }

      .subpage:nth-child(2n) .nav-container {
            background-color: #f6fff9c0;
            border-right: 30px solid #f6fff9;
      }

      .nav-container:target {
          right: -10px;
      }

      .navigation-dots {
          display: block;
      }
  }

  h3 {
      text-align: center;
  }

  li {
      margin-bottom: 10px;
  }
{% endblock style %}

{% macro nav(current_subpage_id) %}
  <div id="nav-{{ current_subpage_id }}" class="nav-container">
    <nav>
      {% for subpage_id, href, text in nav_links_data %}
        {% set attrs = {'href': href, 'draggable': 'false'} %}
        {% if current_subpage_id == subpage_id %}
          {% do attrs.update({'class': 'blue-button'}) %}
        {% else %}
          {% do attrs.update({'class': 'green-button'}) %}
        {% endif %}
        <a{{ attrs|xmlattr }}>{{ text }}</a>
      {% endfor %}
    </nav>
  </div>
  <a class="navigation-dots" href="#nav-{{ current_subpage_id }}">
    <img alt="Three dots, click to view mobile navigation panel"
         src="static/three-green-dots.svg" draggable="false">
  </a>
{% endmacro %}

{% macro subpage(subpage_id) %}
  <div id="{{ subpage_id }}" class="subpage">
    <div class="subpage-layout">
      <div class="subpage-left-part">
        <div class="subpage-main-contents">
          {{ caller() }}
        </div>
      </div>
      {{ nav(subpage_id) }}
    </div>
  </div>
{% endmacro %}