Major frontend overhaul. Added tailwindcss.

This commit is contained in:
2025-07-30 23:51:33 +02:00
parent ff0f528d36
commit 3beadf57a3
12 changed files with 3096 additions and 694 deletions

View File

@@ -3,30 +3,52 @@
{% block title %}Deep Dive: {{ symbol }}{% endblock %}
{% block content %}
<!-- We wrap the content in the .image-container class to get the same beautiful styling -->
<div class="image-container">
<h1>Deep Dive Analysis for: <strong>{{ symbol }}</strong></h1>
<p style="text-align: left; color: #a0aec0;">Showing posts that mention {{ symbol }}, sorted by most recent.</p>
<!-- This outer div handles the centering -->
<div class="flex flex-col items-center">
<div class="w-full max-w-3xl bg-slate-800/50 ring-1 ring-slate-700 rounded-2xl p-6 sm:p-10 shadow-2xl">
{% for post in posts %}
<div class="post-card">
<h3><a href="{{ post.post_url }}" target="_blank">{{ post.title }}</a></h3>
<div class="post-meta">
<span>r/{{ post.subreddit_name }}</span> |
<span>{{ post.comment_count }} comments analyzed</span> |
<span>Avg. Sentiment:
{% if post.avg_comment_sentiment > 0.1 %}
<span class="sentiment-bullish">{{ "%.2f"|format(post.avg_comment_sentiment) }}</span>
{% elif post.avg_comment_sentiment < -0.1 %} <span class="sentiment-bearish">{{
"%.2f"|format(post.avg_comment_sentiment) }}</span>
{% else %}
<span class="sentiment-neutral">{{ "%.2f"|format(post.avg_comment_sentiment) }}</span>
{% endif %}
</span>
</div>
<!-- --- THIS IS THE KEY CHANGE --- -->
<!-- We wrap all the content in an <article> tag with the 'prose' classes -->
<article class="prose prose-slate prose-invert max-w-none">
<header class="text-center mb-8">
<!-- The h1 and p tags will now be beautifully styled by 'prose' -->
<h1>Deep Dive Analysis: <span class="text-sky-400">{{ symbol }}</span></h1>
<p>Showing posts that mention {{ symbol }}, sorted by most recent.</p>
</header>
<div class="space-y-4 not-prose">
{% for post in posts %}
<!-- 'not-prose' is used on the container so we can control styling precisely -->
<div class="bg-slate-800/50 ring-1 ring-slate-700/50 rounded-lg p-4 text-left not-prose">
<h3 class="text-lg font-bold text-slate-200 mb-2">
<!-- This link WILL be styled by the parent 'prose' class -->
<a href="{{ post.post_url }}" target="_blank">{{ post.title }}</a>
</h3>
<div class="text-sm text-slate-400 flex flex-col sm:flex-row sm:items-center gap-x-4 gap-y-1">
<span class="font-semibold">r/{{ post.subreddit_name }}</span>
<span class="hidden sm:inline">|</span>
<span>{{ post.comment_count }} comments analyzed</span>
<span class="hidden sm:inline">|</span>
<span>Avg. Sentiment:
{% if post.avg_comment_sentiment > 0.1 %}
<span class="font-bold text-green-400">{{ "%.2f"|format(post.avg_comment_sentiment) }}
(Bullish)</span>
{% elif post.avg_comment_sentiment < -0.1 %} <span class="font-bold text-red-400">{{
"%.2f"|format(post.avg_comment_sentiment) }} (Bearish)</span>
{% else %}
<span class="font-bold text-slate-500">{{ "%.2f"|format(post.avg_comment_sentiment) }}
(Neutral)</span>
{% endif %}
</span>
</div>
</div>
{% else %}
<div class="text-center text-slate-500 p-8 not-prose">No analyzed posts found for this ticker.</div>
{% endfor %}
</div>
</article>
</div>
{% else %}
<p>No analyzed posts found for this ticker. Run the 'rstat' scraper to gather data.</p>
{% endfor %}
</div>
{% endblock %}