feat: Overhaul UI styling and structure

Introduced a modular CSS variable system for easier theme management, enhancing the maintainability and scalability of our site's design. Reorganized the HTML structure in the index page for a more semantic layout, improving accessibility and SEO. Additionally, updated the styling of UI components, such as navigation and cards, for a more modern and cohesive look. This change not only refreshes the website's aesthetics but also improves the user experience on both desktop and mobile devices.
This commit is contained in:
Kumi 2024-05-22 18:10:32 +02:00
parent d20f1d2e1b
commit b0adb37ce7
Signed by: kumi
GPG key ID: ECBCC9082395383F
2 changed files with 129 additions and 53 deletions

View file

@ -1,55 +1,121 @@
:root {
--main-font: "DejaVu Sans Mono", monospace;
--main-color: #bbc2cf;
--link-color: #ff6c6b;
--heading-color: #51afef;
--code-bg: #20232a;
--code-color: #969ba6;
--border-color: lightgrey;
}
body { body {
font-family: DejaVu Sans Mono, monospace; font-family: var(--main-font);
margin: 20px auto; margin: 20px auto;
line-height: 1.5em; line-height: 1.5;
font-size: 1.1em; font-size: 1.1em;
max-width: 100vw; max-width: 100vw;
color: #bbc2cf; color: var(--main-color);
padding: 0 10px; padding: 0 10px;
hyphens: auto; hyphens: auto;
} }
a { a {
color: #ff6c6b; color: var(--link-color);
text-decoration: none; text-decoration: none;
} }
a:hover { a:hover {
color: #ff6c6b;
text-decoration: underline; text-decoration: underline;
} }
h1, h1,
h2, h2,
h3, h3 {
.fact_check_info_title {
line-height: 1.2; line-height: 1.2;
color: #51afef; color: var(--heading-color);
}
h1 {
font-size: 1.5em;
}
h2 {
font-size: 1.3em; font-size: 1.3em;
} }
h2 {
h3 {
font-size: 1.2em; font-size: 1.2em;
} }
h3,
.fact_check_info_title {
font-size: 1.1em;
}
pre, pre,
code { code {
tab-size: 8; background: var(--code-bg);
background: #20232a; color: var(--code-color);
color: #969ba6; border: 1px solid var(--border-color);
border: 1px solid lightgrey;
padding: 5px; padding: 5px;
tab-size: 4; tab-size: 4;
overflow-x: auto;
} }
blockquote { blockquote {
border-left: 10px solid #969ba6; border-left: 10px solid var(--code-color);
padding-left: 10px; padding-left: 10px;
margin-right: 10px; margin-right: 10px;
} }
.navbar-logo {
height: 64px;
}
.card {
background-color: #fff;
border: 1px solid #ddd;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
overflow: hidden;
}
.card-img-top {
max-width: 100%;
height: auto;
object-fit: cover;
}
.navbar-collapse {
display: flex;
justify-content: space-between;
}
.navbar-nav {
flex-direction: row;
}
.nav-item {
margin-left: 1rem;
}
@media (max-width: 768px) {
.navbar-nav {
flex-direction: column;
align-items: center;
}
.nav-item {
margin-left: 0;
margin-bottom: 0.5rem;
}
.navbar-collapse {
flex-direction: column;
align-items: center;
}
.form-control {
width: 100%;
margin-bottom: 0.5rem;
}
}
.ibles { .ibles {
display: inline-block; display: inline-block;
vertical-align: top; vertical-align: top;
@ -77,13 +143,13 @@ blockquote {
display: none; display: none;
} }
.reply-button + label { .reply-button+label {
position: relative; position: relative;
display: block; display: block;
cursor: pointer; cursor: pointer;
} }
input.reply-button:checked + label + .replies { input.reply-button:checked+label+.replies {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 1rem; gap: 1rem;

View file

@ -1,33 +1,43 @@
{% extends "base.html" %} {% extends "base.html" %} {% block content %}
<div class="container text-center">
{% block content %}
<center>
<h1>{{ title }}</h1> <h1>{{ title }}</h1>
{% for section in sections %} {% for section in sections %}
<div class="container"> <section>
<div class="row"> <div class="row">
<h3></strong><a href="{{ section[1] }}">{{ section[0] }}</a></h3> <h3><a href="{{ section[1] }}">{{ section[0] }}</a></h3>
</div> </div>
<div class="row justify-content-center"> <div class="row justify-content-center">
{% for ible in section[2] %} {% for ible in section[2] %}
<div class="ibles col-xs-12 col-sm-6 col-lg-4"> <div class="col-xs-12 col-sm-6 col-lg-4 mb-4">
<div class="card h-100">
<a href="{{ ible.link }}"> <a href="{{ ible.link }}">
<img style="max-width:19vw;" src="{{ ible.img }}" alt="{{ ible.alt }}"> <img
<p> class="card-img-top"
<strong style="max-width:19vw;">{{ ible.title }}</strong> src="{{ ible.img }}"
</p> alt="{{ ible.alt }}"
style="max-width: 100%"
/>
<div class="card-body">
<h5 class="card-title">{{ ible.title }}</h5>
</div>
</a> </a>
<div class="ible-small"> <div class="card-footer">
<p>by <a href="{{ ible.author_link }}">{{ ible.author }}</a></p> <p class="card-text">
<p>in <a href="{{ ible.channel_link }}">{{ ible.channel }}</a></p> by <a href="{{ ible.author_link }}">{{ ible.author }}</a>
<p>{{ ible.favorites }} Favorites, {{ ible.views }} Views</p> </p>
<p class="card-text">
in <a href="{{ ible.channel_link }}">{{ ible.channel }}</a>
</p>
<p class="card-text">
{{ ible.favorites }} Favorites, {{ ible.views }} Views
</p>
</div>
</div> </div>
</div> </div>
{% endfor %} {% endfor %}
</div> </div>
</div> <hr />
<hr> </section>
{% endfor %} {% endfor %}
</center> </div>
{% endblock %} {% endblock %}