impl: Enhanced styling

This commit is contained in:
Dendy 2024-02-24 13:38:56 +01:00
parent 2e8fdf67f1
commit 903f648b58
3 changed files with 66 additions and 20 deletions

View File

@ -1,7 +1,6 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import traceback import traceback
import os
import posixpath import posixpath
from flask import Flask, render_template, request from flask import Flask, render_template, request

View File

@ -1,18 +1,19 @@
html {
min-height: 100%;
}
body { body {
padding: 20px; /*padding: 20px;*/
background-color: #191919; background-color: #191919;
color: white; color: white;
font-family: monospace; font-family: monospace;
margin-bottom: 100px; /*margin-bottom: 100px;*/
min-height: 100vh;
margin: 0px;
} }
h1, h2, h3, h4, h5, h6 { h1, h2 {
color: orange; color: orange;
} }
h3, h4 {
color: gray;
}
a { a {
text-decoration: none; text-decoration: none;
@ -23,12 +24,18 @@ a {
background-color: orange; background-color: orange;
} }
hr {
border: none;
border-bottom: 1px solid #444;
margin: 0px;
}
input { input {
border: 1px solid black; border: 1px solid black;
background-color: white; background-color: white;
} }
footer { body > footer {
background-color: black; background-color: black;
position: fixed; position: fixed;
left: 0; left: 0;
@ -40,27 +47,45 @@ footer {
} }
ul { ul {
padding-left: 20px; margin: 0px;
padding-left: 10px;
padding-bottom: 0px; padding-bottom: 0px;
list-style-type: none; list-style-type: none;
} }
main { li {
margin-top: -2px;
margin-bottom: -1px;
}
body > main {
display: flex; display: flex;
gap: 20px; min-height: 100vh;
min-height: 80vh; }
body > main > * > *:not(hr) {
padding: 20px;
}
body > main hr {
width: 100%;
}
body > main > nav {
background-color: black;
} }
nav { nav {
padding-right: 10px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
border-right: 1px solid orange; border-right: 1px solid #444;
width: 200px; width: 200px;
} }
article { article {
flex-grow: 1; flex-grow: 1;
display: flex;
flex-direction: column;
}
article > main {
flex-grow: 1;
} }
pre { pre {

View File

@ -2,12 +2,20 @@
{% block title %}{{ path }}{% endblock %} {% block title %}{{ path }}{% endblock %}
{% macro render_tree(tree, root='/') %} {% macro render_tree(tree, root='') %}
<ul> <ul>
{% for entry in tree %} {% for entry in tree %}
<li> <li>
{% set url = path_join(root, entry.name) %} {% set url = path_join(root, entry.name) %}
<a href="{{ url }}">{{ entry.name }}</a>
{#{% if loop.last or entry.children|length > 0 %}#}
{% if entry.children|length > 0 %}
{% else %}
·
{% endif %}
<a href="{{ path_join('/', url ) }}">{{ entry.name }}</a>
{{ render_tree(entry.children, url) }} {{ render_tree(entry.children, url) }}
</li> </li>
{% endfor %} {% endfor %}
@ -16,11 +24,19 @@
{% block body %} {% block body %}
<main> <main>
<nav> <nav>
<div>
&gt; <a href="/">index</a>/{{ path }}
</div>
<hr/>
{{ render_tree(document_tree.root.children) }} {{ render_tree(document_tree.root.children) }}
</nav> </nav>
<article> <article>
<main>
{% if not edit %} {% if not edit %}
{% if path != '' %} {% if path != '' %}
<a href="/{{ path }}?edit">Edit</a> <a href="/{{ path }}?edit">Edit</a>
@ -65,16 +81,22 @@
}); });
</script> </script>
{% endif %} {% endif %}
</main>
<hr/> <hr/>
{% for child in document_tree.get_node(path).children %} {% for child in document_tree.get_node(path).children %}
{% if loop.first %} {% if loop.first %}
<footer>
<h1>Children</h1> <h1>Children</h1>
{% endif %} {% endif %}
<a href="{{ path_join(path, child.name) }}">{{child.name}}</a>{% if not loop.last %},{% endif %} <a href="{{ path_join(path, child.name) }}">{{child.name}}</a>{% if not loop.last %},{% endif %}
{% if loop.last %}
</footer>
{% endif %}
{% endfor %} {% endfor %}
</article> </article>