Complete layout restructure

This should help with visual separation of content.
master
Emil Miler 2 years ago
parent e3cb52787c
commit 7ffad10601

@ -1,4 +1,6 @@
+++ +++
[extra]
meetings_string = "Schůzky probíhají ve <strong>čtvrtek od 18:00</strong> v učebně <strong>R013H</strong>."
+++ +++
## Co je to microlab ## Co je to microlab

@ -2,12 +2,13 @@
$width-wrap: 960px; $width-wrap: 960px;
$width-narrow: ($width-wrap/3)*2; $width-narrow: $width-wrap*0.75;
$col-light: #e8e6e3;
$col-dark: #131516;
$col-gray: lighten($col-dark, 5);
$col-accent: #fc0; $col-accent: #fc0;
$col-dark: #131516;
$col-medium: lighten($col-dark, 4);
$col-light: lighten($col-dark, 18);
$col-white: #e8e6e3;
*, *:before, *:after { *, *:before, *:after {
@ -17,12 +18,13 @@ $col-accent: #fc0;
body { body {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 1rem;
max-width: 60em; max-width: 60em;
width: 100%; width: 100%;
min-height: 100vh; min-height: 100vh;
margin: 0 auto; margin: 0 auto;
background: $col-dark; background: $col-medium;
color: $col-light; color: $col-white;
font-family: open-sans, sans; font-family: open-sans, sans;
text-rendering: optimizeLegibility; text-rendering: optimizeLegibility;
} }
@ -51,31 +53,44 @@ body>header {
@media only screen and (min-width: $width-narrow) { @media only screen and (min-width: $width-narrow) {
height: 10rem; height: 10rem;
background-position: 3em, center, center; background-position: 3rem, center, center;
}
} }
} }
body>nav { nav {
position: relative;
width: 100%; width: 100%;
height: 3rem; height: 3rem;
background: $col-gray; background: $col-dark;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: stretch; align-items: stretch;
&:after {
content: "";
display: block;
position: absolute;
bottom: 0;
height: 2px;
width: 100%;
background: $col-light;
}
a { a {
display: flex; display: flex;
align-items: center; align-items: center;
padding: 0 1em; padding: 0 1em;
height: 100%; height: 100%;
z-index: 1;
border-bottom: 2px solid $col-light;
color: $col-accent; color: $col-accent;
text-decoration: none; text-decoration: none;
&:hover, &.active { &:hover, &.active {
background: $col-dark; background: $col-medium;
border-bottom: 2px solid $col-accent;
} }
@media only screen and (min-width: $width-narrow) { @media only screen and (min-width: $width-narrow) {
@ -83,13 +98,50 @@ body>nav {
} }
} }
} }
}
body>main { body>main {
margin-top: 3em; display: flex;
padding: 0 1em; flex-direction: column;
gap: 1rem;
@media only screen and (min-width: $width-wrap) { section {
padding: 1.5rem;
background: $col-dark;
h2:before {
content: "";
display: block;
width: 3em;
height: 1px;
margin-bottom: 1rem;
background: $col-accent;
}
*:first-child {
margin-top: 0;
}
*:last-child {
margin-bottom: 0;
}
}
section.flex {
display: flex;
flex-direction: column;
gap: 1rem;
padding: 0; padding: 0;
background: inherit;
@media only screen and (min-width: $width-narrow) {
flex-direction: row;
}
div {
width: 100%;
background: $col-dark;
padding: 1.5rem;
}
} }
} }
@ -100,6 +152,6 @@ body>footer {
font-size: .8em; font-size: .8em;
@media only screen and (min-width: $width-wrap) { @media only screen and (min-width: $width-wrap) {
padding: 1em 0; padding: 1rem 0;
} }
} }

@ -23,7 +23,6 @@
<body> <body>
<header> <header>
<a class="img" href="/"></a> <a class="img" href="/"></a>
</header>
<nav> <nav>
{% for item in config.extra.nav_items %} {% for item in config.extra.nav_items %}
<a href="{{ item.path }}" <a href="{{ item.path }}"
@ -33,14 +32,17 @@
>{{ item.name }}</a> >{{ item.name }}</a>
{% endfor %} {% endfor %}
</nav> </nav>
</header>
</body> </body>
<main> <main>
{% block content %} {% block content %}
<section>
{% if section %} {% if section %}
{{ section.content | safe }} {{ section.content | safe }}
{% elif page %} {% elif page %}
{{ page.content | safe }} {{ page.content | safe }}
{% endif %} {% endif %}
</section>
{% endblock content %} {% endblock content %}
</main> </main>
<footer> <footer>

@ -1 +1,23 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block content %}
<section class="flex">
<div>
<h2>Schůzky</h2>
{% if section.extra.meetings_string %}
<p>{{ section.extra.meetings_string | safe }}</p>
{% endif %}
</div>
<div>
<h2>Plánované akce</h2>
<p>Lorem ipsum dolor sit amet, officia excepteur ex fugiat reprehenderit enim labore culpa sint ad nisi Lorem pariatur mollit ex esse exercitation amet.</p>
</div>
</section>
<section>
{% if section %}
{{ section.content | safe }}
{% elif page %}
{{ page.content | safe }}
{% endif %}
</section>
{% endblock content %}

Loading…
Cancel
Save