Make Design More Compact

This commit is contained in:
spikecodes 2021-01-03 19:44:44 -08:00
parent 4124fa87d3
commit a422a74747
7 changed files with 106 additions and 87 deletions

View file

@ -12,12 +12,14 @@
{% endblock %}
</head>
<body>
<!-- NAVIGATION BAR -->
<nav>
<a id="logo" href="/"><span id="lib">lib</span>reddit. <span id="version">v{{ env!("CARGO_PKG_VERSION") }}</span></a>
{% block search %}{% endblock %}
<a id="github" href="https://github.com/spikecodes/libreddit">GITHUB</a>
</nav>
<!-- MAIN CONTENT -->
{% block body %}
<main>
{% block content %}

View file

@ -13,8 +13,8 @@
<meta name="author" content="u/{{ post.author }}">
{% endblock %}
<!-- OPEN COMMENT MACRO -->
{% macro comment(item) -%}
<div id="{{ item.id }}" class="comment">
<div class="comment_left">
<p class="comment_score">{{ item.score }}</p>
@ -28,18 +28,24 @@
&bull; <span class="datetime">{{ item.time }}</span>
</summary>
<p class="comment_body">{{ item.body }}</p>
{%- endmacro %}
<!-- CLOSE COMMENT MACRO -->
{% macro close() %}
</details></div>
{% endmacro %}
{% block content %}
<div id="column_one">
<div class="post highlighted">
<!-- POST CONTENT -->
<div class="post highlighted panel">
<div class="post_left">
<p class="post_score">{{ post.score }}</p>
{% if post.flags.nsfw %}<div class="nsfw">NSFW</div>{% endif %}
</div>
<div class="post_right">
<p>
<p class="post_header">
<b><a class="post_subreddit" href="/r/{{ post.community }}">r/{{ post.community }}</a></b>
&bull;
<a class="post_author" href="/u/{{ post.author }}">u/{{ post.author }}</a>
@ -71,35 +77,38 @@
</div>
</div>
</div>
<!-- SORT FORM -->
<form id="sort">
<select name="sort">
{% call utils::options(sort, ["confidence", "top", "new", "controversial", "old"], "") %}
</select><input id="sort_submit" type="submit" value="&rarr;">
</form>
<!-- COMMENTS -->
{% for c in comments -%}
<div class="thread">
{% call comment(c) %}
<div class="replies">
{% for reply1 in c.replies %}
{% call comment(reply1) %}
<div class="replies">
{% for reply2 in reply1.replies %}
{% call comment(reply2) %}
<div class="replies">
{% for reply3 in reply2.replies %}
{% call comment(reply3) %}
{% if reply3.replies.len() > 0 %}
<a class="deeper_replies" href="{{ post.permalink }}{{ reply3.id }}">&rarr; More replies</a>
{% endif %}
</details></div>
{% endfor %}
</div></details></div>
{% endfor %}
</div></details></div>
<div class="thread">
<!-- EACH COMMENT -->
{% call comment(c) %}
<div class="replies">{% for reply1 in c.replies %}{% call comment(reply1) %}
<!-- FIRST-LEVEL REPLIES -->
<div class="replies">{% for reply2 in reply1.replies %}{% call comment(reply2) %}
<!-- SECOND-LEVEL REPLIES -->
<div class="replies">{% for reply3 in reply2.replies %}{% call comment(reply3) %}
<!-- THIRD-LEVEL REPLIES -->
{% if reply3.replies.len() > 0 %}
<!-- LINK TO CONTINUE REPLIES -->
<a class="deeper_replies" href="{{ post.permalink }}{{ reply3.id }}">&rarr; More replies</a>
{% endif %}
{% call close() %}
{% endfor %}
</div></details></div>
</div>
</div>{% call close() %}
{% endfor %}
</div>{% call close() %}
{% endfor %}
</div>{% call close() %}
</div>
{%- endfor %}
</div>
{% endblock %}

View file

@ -21,13 +21,13 @@
</form>
{% for post in posts %}
{% if post.title != "Comment" %}
<div class="post">
<div class="post panel">
<div class="post_left">
<p class="post_score">{{ post.score }}</p>
{% if post.flags.nsfw %}<div class="nsfw">NSFW</div>{% endif %}
</div>
<div class="post_right">
<p>
<p class="post_header">
<b><a class="post_subreddit" href="/r/{{ post.community }}">r/{{ post.community }}</a></b>
&bull; <a class="post_author" href="/u/{{ post.author }}">u/{{ post.author }}</a>
{% if post.author_flair.0 != "" %}
@ -43,7 +43,7 @@
</p>
</div>
<img class="post_thumbnail" src="{{ post.media }}">
</div><br>
</div>
{% else %}
<div class="comment">
<div class="comment_left">
@ -57,7 +57,7 @@
</summary>
<p class="comment_body">{{ post.body }}</p>
</details>
</div><br>
</div>
{% endif %}
{% endfor %}

View file

@ -28,13 +28,13 @@
</select>{% endif %}
</form>
{% for post in posts %}
<div class="post {% if post.flags.stickied %}stickied{% endif %}">
<div class="post {% if post.flags.stickied %}stickied{% endif %} panel">
<div class="post_left">
<p class="post_score">{{ post.score }}</p>
{% if post.flags.nsfw %}<div class="nsfw">NSFW</div>{% endif %}
</div>
<div class="post_right">
<p>
<p class="post_header">
<b><a class="post_subreddit" href="/r/{{ post.community }}">r/{{ post.community }}</a></b>
&bull; <a class="post_author" href="/u/{{ post.author }}">u/{{ post.author }}</a>
{% if post.author_flair.0 != "" %}
@ -50,7 +50,7 @@
</p>
</div>
<img class="post_thumbnail" src="{{ post.media }}">
</div><br>
</div>
{% endfor %}
<footer>
@ -65,7 +65,7 @@
</div>
{% if sub.name != "" %}
<aside>
<div id="subreddit">
<div class="panel" id="subreddit">
{% if sub.wiki %}
<div id="top">
<div>Posts</div>
@ -85,7 +85,7 @@
</div>
</div>
</div>
<details id="sidebar">
<details class="panel" id="sidebar">
<summary id="sidebar_label">Sidebar</summary>
<div id="sidebar_contents">{{ sub.info }}</div>
</details>

View file

@ -18,13 +18,13 @@
</form>
{% for post in posts %}
{% if post.title != "Comment" %}
<div class='post'>
<div class="post panel">
<div class="post_left">
<p class="post_score">{{ post.score }}</p>
{% if post.flags.nsfw %}<div class="nsfw">NSFW</div>{% endif %}
</div>
<div class="post_right">
<p>
<p class="post_header">
<b><a class="post_subreddit" href="/r/{{ post.community }}">r/{{ post.community }}</a></b>
&bull; <a class="post_author" href="/u/{{ post.author }}">u/{{ post.author }}</a>
{% if post.author_flair.0 != "" %}
@ -42,7 +42,7 @@
</p>
</div>
<img class="post_thumbnail" src="{{ post.media }}">
</div><br>
</div>
{% else %}
<div class="comment">
<div class="comment_left">
@ -56,7 +56,7 @@
</summary>
<p class="comment_body">{{ post.body }}</p>
</details>
</div><br>
</div>
{% endif %}
{% endfor %}
<footer>
@ -70,7 +70,7 @@
</footer>
</div>
<aside>
<div id="user">
<div class="panel" id="user">
<img id="user_icon" src="{{ user.icon }}">
<p id="user_title">{{ user.title }}</p>
<p id="user_name">u/{{ user.name }}</p>

View file

@ -12,7 +12,7 @@
{% block body %}
<main>
<div id="column_one">
<div class="panel" id="column_one">
<div id="top">
<a href="/r/{{ sub }}">Posts</a>
<div>Wiki</div>